lkml.org 
[lkml]   [2020]   [Dec]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH] scsi: qedi: add printf attribute to log function
Date

> -----Original Message-----
> From: trix@redhat.com <trix@redhat.com>
> Sent: Monday, December 21, 2020 9:54 PM
> To: Nilesh Javali <njavali@marvell.com>; Manish Rangankar
> <mrangankar@marvell.com>; jejb@linux.ibm.com;
> martin.petersen@oracle.com
> Cc: GR-QLogic-Storage-Upstream <GR-QLogic-Storage-
> Upstream@marvell.com>; linux-scsi@vger.kernel.org; linux-
> kernel@vger.kernel.org; Tom Rix <trix@redhat.com>
> Subject: [PATCH] scsi: qedi: add printf attribute to log function
>
> From: Tom Rix <trix@redhat.com>
>
> Attributing the function allows the compiler to more thoroughly check the
> use of the function with -Wformat and similar flags.
>
> Signed-off-by: Tom Rix <trix@redhat.com>
> ---
> drivers/scsi/qedi/qedi_dbg.h | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/qedi/qedi_dbg.h b/drivers/scsi/qedi/qedi_dbg.h
> index 37d084086fd4..b2c9b0a2db6a 100644
> --- a/drivers/scsi/qedi/qedi_dbg.h
> +++ b/drivers/scsi/qedi/qedi_dbg.h
> @@ -78,13 +78,16 @@ struct qedi_dbg_ctx {
> #define QEDI_INFO(pdev, level, fmt, ...) \
> qedi_dbg_info(pdev, __func__, __LINE__, level, fmt, \
> ## __VA_ARGS__)
> -
> +__printf(4, 5)
> void qedi_dbg_err(struct qedi_dbg_ctx *qedi, const char *func, u32 line,
> const char *fmt, ...);
> +__printf(4, 5)
> void qedi_dbg_warn(struct qedi_dbg_ctx *qedi, const char *func, u32 line,
> const char *fmt, ...);
> +__printf(4, 5)
> void qedi_dbg_notice(struct qedi_dbg_ctx *qedi, const char *func, u32
> line,
> const char *fmt, ...);
> +__printf(5, 6)
> void qedi_dbg_info(struct qedi_dbg_ctx *qedi, const char *func, u32 line,
> u32 info, const char *fmt, ...);
>

Thanks,
Acked-by: Manish Rangankar <mrangankar@marvell.com>

\
 
 \ /
  Last update: 2020-12-28 07:18    [W:0.047 / U:0.760 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site