All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/6] [media] atomisp: disable several warnings when W=1
@ 2017-05-19 12:09 Mauro Carvalho Chehab
  2017-05-19 12:10 ` [PATCH 2/6] [media] av7110: avoid switch fall through Mauro Carvalho Chehab
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Mauro Carvalho Chehab @ 2017-05-19 12:09 UTC (permalink / raw)
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List,
	Mauro Carvalho Chehab, Greg Kroah-Hartman, Alan Cox,
	Arnd Bergmann, devel

The atomisp currently produce hundreds of warnings when W=1.

It is a known fact that this driver is currently in bad
shape, and there are lot of things to be done here.

We don't want to be bothered by those "minor" stuff for now,
while the driver doesn't receive a major cleanup. So,
disable those warnings.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
---
 drivers/staging/media/atomisp/i2c/Makefile          | 4 ++++
 drivers/staging/media/atomisp/i2c/imx/Makefile      | 5 +++++
 drivers/staging/media/atomisp/i2c/ov5693/Makefile   | 5 +++++
 drivers/staging/media/atomisp/pci/atomisp2/Makefile | 6 ++++++
 4 files changed, 20 insertions(+)

diff --git a/drivers/staging/media/atomisp/i2c/Makefile b/drivers/staging/media/atomisp/i2c/Makefile
index 466517c7c8e6..a1afca6ec31f 100644
--- a/drivers/staging/media/atomisp/i2c/Makefile
+++ b/drivers/staging/media/atomisp/i2c/Makefile
@@ -19,3 +19,7 @@ obj-$(CONFIG_VIDEO_AP1302)     += ap1302.o
 
 obj-$(CONFIG_VIDEO_LM3554) += lm3554.o
 
+# HACK! While this driver is in bad shape, don't enable several warnings
+#       that would be otherwise enabled with W=1
+ccflags-y += -Wno-unused-but-set-variable -Wno-missing-prototypes \
+	     -Wno-unused-const-variable -Wno-missing-declarations
diff --git a/drivers/staging/media/atomisp/i2c/imx/Makefile b/drivers/staging/media/atomisp/i2c/imx/Makefile
index 6b13a3a66e49..0eceb7374bec 100644
--- a/drivers/staging/media/atomisp/i2c/imx/Makefile
+++ b/drivers/staging/media/atomisp/i2c/imx/Makefile
@@ -4,3 +4,8 @@ imx1x5-objs := imx.o drv201.o ad5816g.o dw9714.o dw9719.o dw9718.o vcm.o otp.o o
 
 ov8858_driver-objs := ../ov8858.o dw9718.o vcm.o
 obj-$(CONFIG_VIDEO_OV8858)     += ov8858_driver.o
+
+# HACK! While this driver is in bad shape, don't enable several warnings
+#       that would be otherwise enabled with W=1
+ccflags-y += -Wno-unused-but-set-variable -Wno-missing-prototypes \
+             -Wno-unused-const-variable -Wno-missing-declarations
diff --git a/drivers/staging/media/atomisp/i2c/ov5693/Makefile b/drivers/staging/media/atomisp/i2c/ov5693/Makefile
index c9c0e1245858..fd2ef2e3c31e 100644
--- a/drivers/staging/media/atomisp/i2c/ov5693/Makefile
+++ b/drivers/staging/media/atomisp/i2c/ov5693/Makefile
@@ -1 +1,6 @@
 obj-$(CONFIG_VIDEO_OV5693) += ov5693.o
+
+# HACK! While this driver is in bad shape, don't enable several warnings
+#       that would be otherwise enabled with W=1
+ccflags-y += -Wno-unused-but-set-variable -Wno-missing-prototypes \
+             -Wno-unused-const-variable -Wno-missing-declarations
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/Makefile b/drivers/staging/media/atomisp/pci/atomisp2/Makefile
index f126a89a08e9..68a9ab1c3b61 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/Makefile
+++ b/drivers/staging/media/atomisp/pci/atomisp2/Makefile
@@ -353,3 +353,9 @@ DEFINES += -DSYSTEM_hive_isp_css_2400_system -DISP2400
 
 ccflags-y += $(INCLUDES) $(DEFINES) -fno-common
 
+# HACK! While this driver is in bad shape, don't enable several warnings
+#       that would be otherwise enabled with W=1
+ccflags-y += -Wno-unused-const-variable -Wno-missing-prototypes \
+	     -Wno-unused-but-set-variable -Wno-missing-declarations \
+	     -Wno-suggest-attribute=format -Wno-missing-prototypes \
+	     -Wno-implicit-fallthrough
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/6] [media] av7110: avoid switch fall through
  2017-05-19 12:09 [PATCH v2 1/6] [media] atomisp: disable several warnings when W=1 Mauro Carvalho Chehab
@ 2017-05-19 12:10 ` Mauro Carvalho Chehab
  2017-05-19 12:10 ` [PATCH 3/6] [media] zoran: annotate " Mauro Carvalho Chehab
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Mauro Carvalho Chehab @ 2017-05-19 12:10 UTC (permalink / raw)
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List,
	Mauro Carvalho Chehab, Hans Verkuil, Sakari Ailus,
	Masahiro Yamada

On two switches, this driver have unannotated switch
fall through.

in the first case, it falls through a return. On the second
one, it prints undesired log messages on fall through.

Solve that by copying the commands that it should be
running. Gcc will very likely optimize it anyway, so this
sholdn't be causing any harm, and shuts up gcc warnings.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
---
 drivers/media/pci/ttpci/av7110.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/media/pci/ttpci/av7110.c b/drivers/media/pci/ttpci/av7110.c
index df9395c87178..f2905bd80366 100644
--- a/drivers/media/pci/ttpci/av7110.c
+++ b/drivers/media/pci/ttpci/av7110.c
@@ -336,6 +336,7 @@ static int DvbDmxFilterCallback(u8 *buffer1, size_t buffer1_len,
 			av7110_p2t_write(buffer1, buffer1_len,
 					 dvbdmxfilter->feed->pid,
 					 &av7110->p2t_filter[dvbdmxfilter->index]);
+		return 0;
 	default:
 		return 0;
 	}
@@ -451,8 +452,12 @@ static void debiirq(unsigned long cookie)
 
 	case DATA_CI_PUT:
 		dprintk(4, "debi DATA_CI_PUT\n");
+		xfer = TX_BUFF;
+		break;
 	case DATA_MPEG_PLAY:
 		dprintk(4, "debi DATA_MPEG_PLAY\n");
+		xfer = TX_BUFF;
+		break;
 	case DATA_BMP_LOAD:
 		dprintk(4, "debi DATA_BMP_LOAD\n");
 		xfer = TX_BUFF;
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/6] [media] zoran: annotate switch fall through
  2017-05-19 12:09 [PATCH v2 1/6] [media] atomisp: disable several warnings when W=1 Mauro Carvalho Chehab
  2017-05-19 12:10 ` [PATCH 2/6] [media] av7110: avoid switch fall through Mauro Carvalho Chehab
@ 2017-05-19 12:10 ` Mauro Carvalho Chehab
  2017-05-19 12:10 ` [PATCH 4/6] [media] soc_camera: annotate a " Mauro Carvalho Chehab
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Mauro Carvalho Chehab @ 2017-05-19 12:10 UTC (permalink / raw)
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List,
	Mauro Carvalho Chehab, Hans Verkuil, Colin Ian King,
	Santosh Kumar Singh, Sakari Ailus, mjpeg-users

There are two cases here that it does a switch fall through.
Annotate it, in order to shut up gcc warnings.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
---
 drivers/media/pci/zoran/zoran_driver.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/media/pci/zoran/zoran_driver.c b/drivers/media/pci/zoran/zoran_driver.c
index 180f3d7af3e1..a11cb501c550 100644
--- a/drivers/media/pci/zoran/zoran_driver.c
+++ b/drivers/media/pci/zoran/zoran_driver.c
@@ -534,6 +534,7 @@ static int zoran_v4l_queue_frame(struct zoran_fh *fh, int num)
 				KERN_WARNING
 				"%s: %s - queueing buffer %d in state DONE!?\n",
 				ZR_DEVNAME(zr), __func__, num);
+			/* fall through */
 		case BUZ_STATE_USER:
 			/* since there is at least one unused buffer there's room for at least
 			 * one more pend[] entry */
@@ -693,6 +694,7 @@ static int zoran_jpg_queue_frame(struct zoran_fh *fh, int num,
 				KERN_WARNING
 				"%s: %s - queing frame in BUZ_STATE_DONE state!?\n",
 				ZR_DEVNAME(zr), __func__);
+			/* fall through */
 		case BUZ_STATE_USER:
 			/* since there is at least one unused buffer there's room for at
 			 *least one more pend[] entry */
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 4/6] [media] soc_camera: annotate a switch fall through
  2017-05-19 12:09 [PATCH v2 1/6] [media] atomisp: disable several warnings when W=1 Mauro Carvalho Chehab
  2017-05-19 12:10 ` [PATCH 2/6] [media] av7110: avoid switch fall through Mauro Carvalho Chehab
  2017-05-19 12:10 ` [PATCH 3/6] [media] zoran: annotate " Mauro Carvalho Chehab
@ 2017-05-19 12:10 ` Mauro Carvalho Chehab
  2017-05-19 12:10 ` [PATCH 5/6] [media] s2255drv: avoid " Mauro Carvalho Chehab
  2017-05-19 12:10 ` [PATCH 6/6] [media] uvcvideo: annotate " Mauro Carvalho Chehab
  4 siblings, 0 replies; 6+ messages in thread
From: Mauro Carvalho Chehab @ 2017-05-19 12:10 UTC (permalink / raw)
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List,
	Mauro Carvalho Chehab, Guennadi Liakhovetski

Clearly, hsync and vsinc bool vars are part of the return
logic on the second case of the switch. Annotate that, in
order to shut up gcc warnings.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
---
 drivers/media/platform/soc_camera/soc_mediabus.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/platform/soc_camera/soc_mediabus.c b/drivers/media/platform/soc_camera/soc_mediabus.c
index e3e665e1c503..57581f626f4c 100644
--- a/drivers/media/platform/soc_camera/soc_mediabus.c
+++ b/drivers/media/platform/soc_camera/soc_mediabus.c
@@ -494,6 +494,7 @@ unsigned int soc_mbus_config_compatible(const struct v4l2_mbus_config *cfg,
 					V4L2_MBUS_HSYNC_ACTIVE_LOW);
 		vsync = common_flags & (V4L2_MBUS_VSYNC_ACTIVE_HIGH |
 					V4L2_MBUS_VSYNC_ACTIVE_LOW);
+		/* fall through */
 	case V4L2_MBUS_BT656:
 		pclk = common_flags & (V4L2_MBUS_PCLK_SAMPLE_RISING |
 				       V4L2_MBUS_PCLK_SAMPLE_FALLING);
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 5/6] [media] s2255drv: avoid a switch fall through
  2017-05-19 12:09 [PATCH v2 1/6] [media] atomisp: disable several warnings when W=1 Mauro Carvalho Chehab
                   ` (2 preceding siblings ...)
  2017-05-19 12:10 ` [PATCH 4/6] [media] soc_camera: annotate a " Mauro Carvalho Chehab
@ 2017-05-19 12:10 ` Mauro Carvalho Chehab
  2017-05-19 12:10 ` [PATCH 6/6] [media] uvcvideo: annotate " Mauro Carvalho Chehab
  4 siblings, 0 replies; 6+ messages in thread
From: Mauro Carvalho Chehab @ 2017-05-19 12:10 UTC (permalink / raw)
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List,
	Mauro Carvalho Chehab, Hans Verkuil, Laurent Pinchart,
	Wolfram Sang, Greg Kroah-Hartman, Sakari Ailus, Julia Lawall

On this driver, it can fall through a switch. I tried to
annotate it, in order to shut up a gcc warning, but that
didn't work, as the logic there is somewhat complex.

So, instead, let's just repeat the code. gcc should likely
optimize it anyway, and this makes the code better readable,
IMHO.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
---
 drivers/media/usb/s2255/s2255drv.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/media/usb/s2255/s2255drv.c b/drivers/media/usb/s2255/s2255drv.c
index a9d4484f7626..6a88b1dbb3a0 100644
--- a/drivers/media/usb/s2255/s2255drv.c
+++ b/drivers/media/usb/s2255/s2255drv.c
@@ -1803,6 +1803,8 @@ static int save_frame(struct s2255_dev *dev, struct s2255_pipeinfo *pipe_info)
 				default:
 					pr_info("s2255 unknown resp\n");
 				}
+				pdata++;
+				break;
 			default:
 				pdata++;
 				break;
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 6/6] [media] uvcvideo: annotate a switch fall through
  2017-05-19 12:09 [PATCH v2 1/6] [media] atomisp: disable several warnings when W=1 Mauro Carvalho Chehab
                   ` (3 preceding siblings ...)
  2017-05-19 12:10 ` [PATCH 5/6] [media] s2255drv: avoid " Mauro Carvalho Chehab
@ 2017-05-19 12:10 ` Mauro Carvalho Chehab
  4 siblings, 0 replies; 6+ messages in thread
From: Mauro Carvalho Chehab @ 2017-05-19 12:10 UTC (permalink / raw)
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List,
	Mauro Carvalho Chehab, Laurent Pinchart

Without annotations, gcc 7.1 will complain.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
---
 drivers/media/usb/uvc/uvc_video.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c
index a29f39d4e05b..fb86d6af398d 100644
--- a/drivers/media/usb/uvc/uvc_video.c
+++ b/drivers/media/usb/uvc/uvc_video.c
@@ -1323,7 +1323,7 @@ static void uvc_video_complete(struct urb *urb)
 	default:
 		uvc_printk(KERN_WARNING, "Non-zero status (%d) in video "
 			"completion handler.\n", urb->status);
-
+		/* fall through */
 	case -ENOENT:		/* usb_kill_urb() called. */
 		if (stream->frozen)
 			return;
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-05-19 12:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-19 12:09 [PATCH v2 1/6] [media] atomisp: disable several warnings when W=1 Mauro Carvalho Chehab
2017-05-19 12:10 ` [PATCH 2/6] [media] av7110: avoid switch fall through Mauro Carvalho Chehab
2017-05-19 12:10 ` [PATCH 3/6] [media] zoran: annotate " Mauro Carvalho Chehab
2017-05-19 12:10 ` [PATCH 4/6] [media] soc_camera: annotate a " Mauro Carvalho Chehab
2017-05-19 12:10 ` [PATCH 5/6] [media] s2255drv: avoid " Mauro Carvalho Chehab
2017-05-19 12:10 ` [PATCH 6/6] [media] uvcvideo: annotate " Mauro Carvalho Chehab

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.