Skip to content

Commit

Permalink
scsi: esas2r: Supply __printf(x, y) formatting for esas2r_log_master()
Browse files Browse the repository at this point in the history
Fixes the following W=1 kernel build warning(s):

 drivers/scsi/esas2r/esas2r_log.c: In function ‘esas2r_log_master’:
 drivers/scsi/esas2r/esas2r_log.c:155:3: warning: function ‘esas2r_log_master’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]

Link: https://lore.kernel.org/r/20210312094738.2207817-19-lee.jones@linaro.org
Cc: Bradley Grove <linuxdrivers@attotech.com>
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
  • Loading branch information
Lee Jones authored and Martin K. Petersen committed Mar 16, 2021
1 parent 1818837 commit 1c666a3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/scsi/esas2r/esas2r_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ static const char *translate_esas2r_event_level_to_kernel(const long level)
}
}

#pragma GCC diagnostic push
#ifndef __clang__
#pragma GCC diagnostic ignored "-Wsuggest-attribute=format"
#endif

/*
* the master logging function. this function will format the message as
* outlined by the formatting string, the input device information and the
Expand Down Expand Up @@ -170,6 +175,8 @@ static int esas2r_log_master(const long level,
return 0;
}

#pragma GCC diagnostic pop

/*
* formats and logs a message to the system log.
*
Expand Down

0 comments on commit 1c666a3

Please sign in to comment.