lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <15bec1f27f5e45e6aa3eb9125d973a06@AcuMS.aculab.com>
Date:   Wed, 23 Sep 2020 08:33:37 +0000
From:   David Laight <David.Laight@...LAB.COM>
To:     'Mauro Carvalho Chehab' <mchehab+huawei@...nel.org>,
        "Linux Media Mailing List" <linux-media@...r.kernel.org>
CC:     "linuxarm@...wei.com" <linuxarm@...wei.com>,
        "mauro.chehab@...wei.com" <mauro.chehab@...wei.com>,
        "Gustavo A. R. Silva" <gustavoars@...nel.org>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        Sakari Ailus <sakari.ailus@...ux.intel.com>,
        "devel@...verdev.osuosl.org" <devel@...verdev.osuosl.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH 1/2] media: atomisp: fix gcc warnings

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@...nel.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)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ