LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Manish Rangankar <mrangankar@marvell.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: Nilesh Javali <njavali@marvell.com>,
	GR-QLogic-Storage-Upstream
	<GR-QLogic-Storage-Upstream@marvell.com>,
	"James E.J. Bottomley" <jejb@linux.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	"open list:QLOGIC QL41xxx ISCSI DRIVER"
	<linux-scsi@vger.kernel.org>
Subject: Re: [EXT] [PATCH 2/2] scsi: qedi: Fix SYSFS_FLAG_FW_SEL_BOOT formatting
Date: Fri, 26 Nov 2021 21:31:37 -0800	[thread overview]
Message-ID: <5b5ec5df-962a-e0f5-c88c-ecc26249c659@gmail.com> (raw)
In-Reply-To: <CO6PR18MB4419E1ADDB4D336E83C624FBD8639@CO6PR18MB4419.namprd18.prod.outlook.com>



On 11/26/2021 12:43 AM, Manish Rangankar wrote:
> 
> 
>> -----Original Message-----
>> From: Florian Fainelli <f.fainelli@gmail.com>
>> Sent: Friday, November 26, 2021 10:45 AM
>> To: linux-kernel@vger.kernel.org
>> Cc: Florian Fainelli <f.fainelli@gmail.com>; Nilesh Javali <njavali@marvell.com>;
>> Manish Rangankar <mrangankar@marvell.com>; GR-QLogic-Storage-Upstream
>> <GR-QLogic-Storage-Upstream@marvell.com>; James E.J. Bottomley
>> <jejb@linux.ibm.com>; Martin K. Petersen <martin.petersen@oracle.com>;
>> open list:QLOGIC QL41xxx ISCSI DRIVER <linux-scsi@vger.kernel.org>
>> Subject: [EXT] [PATCH 2/2] scsi: qedi: Fix SYSFS_FLAG_FW_SEL_BOOT formatting
>>
>> External Email
>>
>> ----------------------------------------------------------------------
>> The format used for formatting SYSFS_FLAG_FW_SEL_BOOT creates the
>> following warning:
>>
>> drivers/scsi/qedi/qedi_main.c:2259:35: warning: format specifies type 'char' but
>> the argument has type 'int' [-Wformat]
>>                     rc = snprintf(buf, 3, "%hhd\n", SYSFS_FLAG_FW_SEL_BOOT);
>>
>> Fix this to use %d since this is a plain integer.
>>
>> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
>> ---
>>   drivers/scsi/qedi/qedi_main.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/scsi/qedi/qedi_main.c b/drivers/scsi/qedi/qedi_main.c index
>> f1c933070884..367a0337b53e 100644
>> --- a/drivers/scsi/qedi/qedi_main.c
>> +++ b/drivers/scsi/qedi/qedi_main.c
>> @@ -2254,7 +2254,7 @@ qedi_show_boot_tgt_info(struct qedi_ctx *qedi, int
>> type,
>>   			     mchap_secret);
>>   		break;
>>   	case ISCSI_BOOT_TGT_FLAGS:
>> -		rc = snprintf(buf, 3, "%hhd\n", SYSFS_FLAG_FW_SEL_BOOT);
>> +		rc = snprintf(buf, 3, "%d\n", SYSFS_FLAG_FW_SEL_BOOT);
>>   		break;
>>   	case ISCSI_BOOT_TGT_NIC_ASSOC:
>>   		rc = snprintf(buf, 3, "0\n");
>> --
>> 2.25.1
> 
> SYSFS_FLAG_FW_SEL_BOOT is always going to have value 2, that's why it is given %hhd to limit the size to 1 byte.
> Is there other way to suppress this warning, such as typecasting or any other ?

Yes typecasting would work, if you are fine with that.
-- 
Florian

      reply	other threads:[~2021-11-27  5:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-26  5:15 [PATCH 0/2] scsi: qedi: Couple of warning fixes Florian Fainelli
2021-11-26  5:15 ` [PATCH 1/2] scsi: qedi: Remove set but unused 'page' variable Florian Fainelli
2021-11-26  8:52   ` [EXT] " Manish Rangankar
2021-11-27  5:31     ` Florian Fainelli
2021-11-27  9:14       ` Manish Rangankar
2021-11-26  5:15 ` [PATCH 2/2] scsi: qedi: Fix SYSFS_FLAG_FW_SEL_BOOT formatting Florian Fainelli
2021-11-26  8:43   ` [EXT] " Manish Rangankar
2021-11-27  5:31     ` Florian Fainelli [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=5b5ec5df-962a-e0f5-c88c-ecc26249c659@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=GR-QLogic-Storage-Upstream@marvell.com \
    --cc=jejb@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=mrangankar@marvell.com \
    --cc=njavali@marvell.com \
    --subject='Re: [EXT] [PATCH 2/2] scsi: qedi: Fix SYSFS_FLAG_FW_SEL_BOOT formatting' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).