From: David Laight <David.Laight@ACULAB.COM>
To: 'Mauro Carvalho Chehab' <mchehab+huawei@kernel.org>,
"Linux Media Mailing List" <linux-media@vger.kernel.org>
Cc: "linuxarm@huawei.com" <linuxarm@huawei.com>,
"mauro.chehab@huawei.com" <mauro.chehab@huawei.com>,
"Gustavo A. R. Silva" <gustavoars@kernel.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
"devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH 1/2] media: atomisp: fix gcc warnings
Date: Wed, 23 Sep 2020 08:33:37 +0000 [thread overview]
Message-ID: <15bec1f27f5e45e6aa3eb9125d973a06@AcuMS.aculab.com> (raw)
In-Reply-To: <8e3d5d4baf0781974a224e284e837665c0d26f92.1600849288.git.mchehab+huawei@kernel.org>
From: Mauro Carvalho Chehab
> Sent: 23 September 2020 09:22
>
> Depending on the gcc version, after changeset
> 72a9ff3bf7fb ("media: atomisp: get rid of -Wsuggest-attribute=format warnings"),
> we're now getting two warnings, which are breaking the Jenkins
> CI instance at https://builder.linuxtv.org:
>
> ../drivers/staging/media/atomisp/pci/atomisp_compat_css20.c: In function ‘__set_css_print_env’:
> ../drivers/staging/media/atomisp/pci/atomisp_compat_css20.c:860:50: error: assignment to ‘int
> (*)(const char *, char *)’ from incompatible pointer type ‘int (__attribute__((regparm(0))) *)(const
> char *, char *)’ [-Werror=incompatible-pointer-types]
> isp->css_env.isp_css_env.print_env.debug_print = vprintk;
> ^
> ../drivers/staging/media/atomisp/pci/atomisp_compat_css20.c: In function
> ‘atomisp_css_load_firmware’:
> ../drivers/staging/media/atomisp/pci/atomisp_compat_css20.c:893:49: error: assignment to ‘int
> (*)(const char *, char *)’ from incompatible pointer type ‘int (__attribute__((regparm(0))) *)(const
> char *, char *)’ [-Werror=incompatible-pointer-types]
> isp->css_env.isp_css_env.print_env.error_print = vprintk;
> ^
> cc1: some warnings being treated as errors
>
> So, we need to partially revert the patch.
That looks like completely the wrong commit message.
From the error message it looks like vprintk() is using a non-standard
calling convention '__attribute__((regparm(0)))' so can't be assigned
to 'debug_print' - which expects the normal convention.
The fix is correct though.
David
>
> Fixes: 72a9ff3bf7fb ("media: atomisp: get rid of -Wsuggest-attribute=format warnings")
> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
> ---
> .../staging/media/atomisp/pci/atomisp_compat_css20.c | 11 +++++++++--
> 1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
> b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
> index 28796ec177e3..85b39de7bc28 100644
> --- a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
> +++ b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
> @@ -166,6 +166,13 @@ atomisp_css2_dbg_ftrace_print(const char *fmt, va_list args)
> return 0;
> }
>
> +static int __attribute__((format (printf, 1, 0)))
> +atomisp_vprintk(const char *fmt, va_list args)
> +{
> + vprintk(fmt, args);
> + return 0;
> +}
> +
> void atomisp_load_uint32(hrt_address addr, uint32_t *data)
> {
> *data = atomisp_css2_hw_load_32(addr);
> @@ -857,7 +864,7 @@ static inline int __set_css_print_env(struct atomisp_device *isp, int opt)
> isp->css_env.isp_css_env.print_env.debug_print =
> atomisp_css2_dbg_ftrace_print;
> else if (opt == 2)
> - isp->css_env.isp_css_env.print_env.debug_print = vprintk;
> + isp->css_env.isp_css_env.print_env.debug_print = atomisp_vprintk;
> else
> ret = -EINVAL;
>
> @@ -890,7 +897,7 @@ int atomisp_css_load_firmware(struct atomisp_device *isp)
>
> __set_css_print_env(isp, dbg_func);
>
> - isp->css_env.isp_css_env.print_env.error_print = vprintk;
> + isp->css_env.isp_css_env.print_env.error_print = atomisp_vprintk;
>
> /* load isp fw into ISP memory */
> err = ia_css_load_firmware(isp->dev, &isp->css_env.isp_css_env,
> --
> 2.26.2
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
prev parent reply other threads:[~2020-09-23 8:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-23 8:21 Mauro Carvalho Chehab
2020-09-23 8:22 ` [PATCH 2/2] media: atomisp: cleanup __printf() atributes on printk messages Mauro Carvalho Chehab
2020-09-23 8:33 ` David Laight [this message]
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=15bec1f27f5e45e6aa3eb9125d973a06@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=gustavoars@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=mauro.chehab@huawei.com \
--cc=mchehab+huawei@kernel.org \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@linux.intel.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®