All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>,
	Mauro Carvalho Chehab <mchehab@infradead.org>
Subject: Re: [PATCH 5/6] media: isp: fix a warning about a wrong struct initializer
Date: Wed, 08 Aug 2018 18:45:49 +0300	[thread overview]
Message-ID: <1638882.BEPym44MaE@avalon> (raw)
In-Reply-To: <cf5719a1cb77e6322d8dd4c679529aec4c07ee27.1533739965.git.mchehab+samsung@kernel.org>

Hi Mauro,

Thank you for the patch.

The subject line should be "media: omap3isp: ...".

On Wednesday, 8 August 2018 17:52:55 EEST Mauro Carvalho Chehab wrote:
> As sparse complains:
> 	drivers/media/platform/omap3isp/isp.c:303:39: warning: Using plain integer
> as NULL pointer
> 
> when a struct is initialized with { 0 }, actually the first
> element of the struct is initialized with zeros, initializing the
> other elements recursively. That can even generate gcc warnings
> on nested structs.
> 
> So, instead, use the gcc-specific syntax for that (with is used
> broadly inside the Kernel), initializing it with {};
> 
> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
> ---
>  drivers/media/platform/omap3isp/isp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/omap3isp/isp.c
> b/drivers/media/platform/omap3isp/isp.c index 03354d513311..842e2235047d
> 100644
> --- a/drivers/media/platform/omap3isp/isp.c
> +++ b/drivers/media/platform/omap3isp/isp.c
> @@ -300,7 +300,7 @@ static struct clk *isp_xclk_src_get(struct
> of_phandle_args *clkspec, void *data) static int isp_xclk_init(struct
> isp_device *isp)
>  {
>  	struct device_node *np = isp->dev->of_node;
> -	struct clk_init_data init = { 0 };
> +	struct clk_init_data init = {};

How about = { NULL }; to avoid a gcc-specific syntax ?

>  	unsigned int i;
> 
>  	for (i = 0; i < ARRAY_SIZE(isp->xclks); ++i)

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2018-08-08 18:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-08 14:52 [PATCH 1/6] media: exynos-gsc: fix return code if mutex was interrupted Mauro Carvalho Chehab
2018-08-08 14:52 ` Mauro Carvalho Chehab
2018-08-08 14:52 ` Mauro Carvalho Chehab
2018-08-08 14:52 ` [PATCH 2/6] media: saa7164: fix return codes for the polling routine Mauro Carvalho Chehab
2018-08-08 14:52 ` [PATCH 3/6] media: s3c-camif: fix return code " Mauro Carvalho Chehab
2018-08-08 14:52 ` [PATCH 4/6] media: radio-wl1273: " Mauro Carvalho Chehab
2018-08-08 14:52 ` [PATCH 5/6] media: isp: fix a warning about a wrong struct initializer Mauro Carvalho Chehab
2018-08-08 15:45   ` Laurent Pinchart [this message]
2018-09-07 11:46     ` Laurent Pinchart
2018-09-11 15:30       ` Laurent Pinchart
2018-09-20 14:44       ` Mauro Carvalho Chehab
2018-09-20 17:20         ` Laurent Pinchart
2018-08-08 14:52 ` [PATCH 6/6] siano: get rid of an unused return code for debugfs register Mauro Carvalho Chehab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1638882.BEPym44MaE@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab+samsung@kernel.org \
    --cc=mchehab@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.