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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5b5ec5df-962a-e0f5-c88c-ecc26249c659@gmail.com>
Date:   Fri, 26 Nov 2021 21:31:37 -0800
From:   Florian Fainelli <f.fainelli@...il.com>
To:     Manish Rangankar <mrangankar@...vell.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Cc:     Nilesh Javali <njavali@...vell.com>,
        GR-QLogic-Storage-Upstream <GR-QLogic-Storage-Upstream@...vell.com>,
        "James E.J. Bottomley" <jejb@...ux.ibm.com>,
        "Martin K. Petersen" <martin.petersen@...cle.com>,
        "open list:QLOGIC QL41xxx ISCSI DRIVER" <linux-scsi@...r.kernel.org>
Subject: Re: [EXT] [PATCH 2/2] scsi: qedi: Fix SYSFS_FLAG_FW_SEL_BOOT
 formatting



On 11/26/2021 12:43 AM, Manish Rangankar wrote:
> 
> 
>> -----Original Message-----
>> From: Florian Fainelli <f.fainelli@...il.com>
>> Sent: Friday, November 26, 2021 10:45 AM
>> To: linux-kernel@...r.kernel.org
>> Cc: Florian Fainelli <f.fainelli@...il.com>; Nilesh Javali <njavali@...vell.com>;
>> Manish Rangankar <mrangankar@...vell.com>; GR-QLogic-Storage-Upstream
>> <GR-QLogic-Storage-Upstream@...vell.com>; James E.J. Bottomley
>> <jejb@...ux.ibm.com>; Martin K. Petersen <martin.petersen@...cle.com>;
>> open list:QLOGIC QL41xxx ISCSI DRIVER <linux-scsi@...r.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@...il.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ