All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-media@vger.kernel.org, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 5/5] media: atomisp: get rid of -Wsuggest-attribute=format warnings
Date: Thu, 3 Sep 2020 17:07:24 +0300	[thread overview]
Message-ID: <20200903140724.GE1891694@smile.fi.intel.com> (raw)
In-Reply-To: <6c77d765707b1e6b2901fd23d85b4d032f1a1799.1599141140.git.mchehab+huawei@kernel.org>

On Thu, Sep 03, 2020 at 03:57:32PM +0200, Mauro Carvalho Chehab wrote:
> There are some warnings reported by gcc:
> 	drivers/staging/media/atomisp//pci/atomisp_compat_css20.c:164:2: warning: function ‘atomisp_css2_dbg_print’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
> 	drivers/staging/media/atomisp//pci/atomisp_compat_css20.c:170:2: warning: function ‘atomisp_css2_dbg_ftrace_print’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
> 	drivers/staging/media/atomisp//pci/atomisp_compat_css20.c:170:2: warning: function ‘atomisp_css2_dbg_ftrace_print’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
> 	drivers/staging/media/atomisp//pci/atomisp_compat_css20.c:176:2: warning: function ‘atomisp_css2_err_print’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
> 
> That are due to the usage of printf-like messages without
> enabling the error checking logic.
> 
> Add the proper attributes in order to shut up such warnings.

> +static int  __attribute__((format (printf, 1, 0)))
> +atomisp_css2_dbg_ftrace_print(const char *fmt, va_list args)
>  {
>  	ftrace_vprintk(fmt, args);
>  	return 0;
>  }
>  

Why not to drop it completely as well?

> -static int atomisp_css2_err_print(const char *fmt, va_list args)
> -{
> -	vprintk(fmt, args);
> -	return 0;
> -}


-- 
With Best Regards,
Andy Shevchenko



WARNING: multiple messages have this Message-ID (diff)
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Cc: devel@driverdev.osuosl.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	linux-media@vger.kernel.org
Subject: Re: [PATCH 5/5] media: atomisp: get rid of -Wsuggest-attribute=format warnings
Date: Thu, 3 Sep 2020 17:07:24 +0300	[thread overview]
Message-ID: <20200903140724.GE1891694@smile.fi.intel.com> (raw)
In-Reply-To: <6c77d765707b1e6b2901fd23d85b4d032f1a1799.1599141140.git.mchehab+huawei@kernel.org>

On Thu, Sep 03, 2020 at 03:57:32PM +0200, Mauro Carvalho Chehab wrote:
> There are some warnings reported by gcc:
> 	drivers/staging/media/atomisp//pci/atomisp_compat_css20.c:164:2: warning: function ‘atomisp_css2_dbg_print’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
> 	drivers/staging/media/atomisp//pci/atomisp_compat_css20.c:170:2: warning: function ‘atomisp_css2_dbg_ftrace_print’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
> 	drivers/staging/media/atomisp//pci/atomisp_compat_css20.c:170:2: warning: function ‘atomisp_css2_dbg_ftrace_print’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
> 	drivers/staging/media/atomisp//pci/atomisp_compat_css20.c:176:2: warning: function ‘atomisp_css2_err_print’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
> 
> That are due to the usage of printf-like messages without
> enabling the error checking logic.
> 
> Add the proper attributes in order to shut up such warnings.

> +static int  __attribute__((format (printf, 1, 0)))
> +atomisp_css2_dbg_ftrace_print(const char *fmt, va_list args)
>  {
>  	ftrace_vprintk(fmt, args);
>  	return 0;
>  }
>  

Why not to drop it completely as well?

> -static int atomisp_css2_err_print(const char *fmt, va_list args)
> -{
> -	vprintk(fmt, args);
> -	return 0;
> -}


-- 
With Best Regards,
Andy Shevchenko


_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

  reply	other threads:[~2020-09-03 14:13 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-03 13:57 [PATCH 0/5] address W=1 warnings at staging/media/atomisp Mauro Carvalho Chehab
2020-09-08 10:12 ` Mauro Carvalho Chehab
2020-09-08 10:12 ` Mauro Carvalho Chehab
2020-09-03 13:57 ` Mauro Carvalho Chehab
2020-09-03 13:57 ` [PATCH 1/5] media: atomisp: get rid of some cleanup leftovers Mauro Carvalho Chehab
2020-09-08 10:12   ` Mauro Carvalho Chehab
2020-09-08 10:12   ` Mauro Carvalho Chehab
2020-09-03 13:57   ` Mauro Carvalho Chehab
2020-09-03 13:57 ` [PATCH 2/5] media: atomisp: print a warning if error while setting downscaler Mauro Carvalho Chehab
2020-09-08 10:12   ` Mauro Carvalho Chehab
2020-09-08 10:12   ` Mauro Carvalho Chehab
2020-09-03 13:57   ` Mauro Carvalho Chehab
2020-09-03 13:57 ` [PATCH 3/5] media: atomisp: get rid of unused vars Mauro Carvalho Chehab
2020-09-08 10:12   ` Mauro Carvalho Chehab
2020-09-08 10:12   ` Mauro Carvalho Chehab
2020-09-03 13:57   ` Mauro Carvalho Chehab
2020-09-03 13:57 ` [PATCH 4/5] media: atomisp: move a static constant out of a header file Mauro Carvalho Chehab
2020-09-08 10:12   ` Mauro Carvalho Chehab
2020-09-08 10:12   ` Mauro Carvalho Chehab
2020-09-03 13:57   ` Mauro Carvalho Chehab
2020-09-03 13:57 ` [PATCH 5/5] media: atomisp: get rid of -Wsuggest-attribute=format warnings Mauro Carvalho Chehab
2020-09-08 10:12   ` Mauro Carvalho Chehab
2020-09-08 10:12   ` Mauro Carvalho Chehab
2020-09-03 13:57   ` Mauro Carvalho Chehab
2020-09-03 14:07   ` Andy Shevchenko [this message]
2020-09-03 14:07     ` Andy Shevchenko
2020-09-03 14:27     ` Mauro Carvalho Chehab
2020-09-03 14:27       ` Mauro Carvalho Chehab
2020-09-03 17:02   ` kernel test robot
2020-09-03 17:02     ` kernel test robot
2020-09-03 17:02     ` kernel test robot
2020-09-08 10:27 ` [PATCH 0/5] address W=1 warnings at staging/media/atomisp Mauro Carvalho Chehab
2020-09-08 10:27   ` 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=20200903140724.GE1891694@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab+huawei@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 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.