linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] ipu3-imgu: Fix compiler warnings
@ 2018-12-10 12:22 Sakari Ailus
  2018-12-11  5:35 ` Tomasz Figa
  0 siblings, 1 reply; 2+ messages in thread
From: Sakari Ailus @ 2018-12-10 12:22 UTC (permalink / raw)
  To: linux-media; +Cc: yong.zhi, tfiga, rajmohan.mani

Address a few false positive compiler warnings related to uninitialised
variables. While at it, use bool where bool is needed and %u to print an
unsigned integer.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 drivers/staging/media/ipu3/ipu3.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/media/ipu3/ipu3.c b/drivers/staging/media/ipu3/ipu3.c
index b7886edeb01b7..d521b3afb8b1a 100644
--- a/drivers/staging/media/ipu3/ipu3.c
+++ b/drivers/staging/media/ipu3/ipu3.c
@@ -228,7 +228,6 @@ int imgu_queue_buffers(struct imgu_device *imgu, bool initial, unsigned int pipe
 {
 	unsigned int node;
 	int r = 0;
-	struct imgu_buffer *ibuf;
 	struct imgu_media_pipe *imgu_pipe = &imgu->imgu_pipe[pipe];
 
 	if (!ipu3_css_is_streaming(&imgu->css))
@@ -250,7 +249,8 @@ int imgu_queue_buffers(struct imgu_device *imgu, bool initial, unsigned int pipe
 		} else if (imgu_pipe->queue_enabled[node]) {
 			struct ipu3_css_buffer *buf =
 				imgu_queue_getbuf(imgu, node, pipe);
-			int dummy;
+			struct imgu_buffer *ibuf = NULL;
+			bool dummy;
 
 			if (!buf)
 				break;
@@ -263,7 +263,7 @@ int imgu_queue_buffers(struct imgu_device *imgu, bool initial, unsigned int pipe
 				ibuf = container_of(buf, struct imgu_buffer,
 						    css_buf);
 			dev_dbg(&imgu->pci_dev->dev,
-				"queue %s %s buffer %d to css da: 0x%08x\n",
+				"queue %s %s buffer %u to css da: 0x%08x\n",
 				dummy ? "dummy" : "user",
 				imgu_node_map[node].name,
 				dummy ? 0 : ibuf->vid_buf.vbb.vb2_buf.index,
@@ -479,7 +479,7 @@ static irqreturn_t imgu_isr_threaded(int irq, void *imgu_ptr)
 	do {
 		u64 ns = ktime_get_ns();
 		struct ipu3_css_buffer *b;
-		struct imgu_buffer *buf;
+		struct imgu_buffer *buf = NULL;
 		unsigned int node, pipe;
 		bool dummy;
 
-- 
2.11.0


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

* Re: [PATCH 1/1] ipu3-imgu: Fix compiler warnings
  2018-12-10 12:22 [PATCH 1/1] ipu3-imgu: Fix compiler warnings Sakari Ailus
@ 2018-12-11  5:35 ` Tomasz Figa
  0 siblings, 0 replies; 2+ messages in thread
From: Tomasz Figa @ 2018-12-11  5:35 UTC (permalink / raw)
  To: Sakari Ailus; +Cc: Linux Media Mailing List, Yong Zhi, Mani, Rajmohan

Hi Sakari,

On Mon, Dec 10, 2018 at 9:22 PM Sakari Ailus
<sakari.ailus@linux.intel.com> wrote:
>
> Address a few false positive compiler warnings related to uninitialised
> variables. While at it, use bool where bool is needed and %u to print an
> unsigned integer.
>
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> ---
>  drivers/staging/media/ipu3/ipu3.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/media/ipu3/ipu3.c b/drivers/staging/media/ipu3/ipu3.c
> index b7886edeb01b7..d521b3afb8b1a 100644
> --- a/drivers/staging/media/ipu3/ipu3.c
> +++ b/drivers/staging/media/ipu3/ipu3.c
> @@ -228,7 +228,6 @@ int imgu_queue_buffers(struct imgu_device *imgu, bool initial, unsigned int pipe
>  {
>         unsigned int node;
>         int r = 0;
> -       struct imgu_buffer *ibuf;
>         struct imgu_media_pipe *imgu_pipe = &imgu->imgu_pipe[pipe];
>
>         if (!ipu3_css_is_streaming(&imgu->css))
> @@ -250,7 +249,8 @@ int imgu_queue_buffers(struct imgu_device *imgu, bool initial, unsigned int pipe
>                 } else if (imgu_pipe->queue_enabled[node]) {
>                         struct ipu3_css_buffer *buf =
>                                 imgu_queue_getbuf(imgu, node, pipe);
> -                       int dummy;
> +                       struct imgu_buffer *ibuf = NULL;
> +                       bool dummy;
>
>                         if (!buf)
>                                 break;
> @@ -263,7 +263,7 @@ int imgu_queue_buffers(struct imgu_device *imgu, bool initial, unsigned int pipe
>                                 ibuf = container_of(buf, struct imgu_buffer,
>                                                     css_buf);
>                         dev_dbg(&imgu->pci_dev->dev,
> -                               "queue %s %s buffer %d to css da: 0x%08x\n",
> +                               "queue %s %s buffer %u to css da: 0x%08x\n",
>                                 dummy ? "dummy" : "user",
>                                 imgu_node_map[node].name,
>                                 dummy ? 0 : ibuf->vid_buf.vbb.vb2_buf.index,
> @@ -479,7 +479,7 @@ static irqreturn_t imgu_isr_threaded(int irq, void *imgu_ptr)
>         do {
>                 u64 ns = ktime_get_ns();
>                 struct ipu3_css_buffer *b;
> -               struct imgu_buffer *buf;
> +               struct imgu_buffer *buf = NULL;
>                 unsigned int node, pipe;
>                 bool dummy;

Reviewed-by: Tomasz Figa <tfiga@chromium.org>

Both cases look very straightforward, I wonder why they triggered
those false positives...

Best regards,
Tomasz

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

end of thread, other threads:[~2018-12-11  5:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-10 12:22 [PATCH 1/1] ipu3-imgu: Fix compiler warnings Sakari Ailus
2018-12-11  5:35 ` Tomasz Figa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).