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: <71df15e7-af2e-0326-78fe-0271a1e240fe@embeddedor.com>
Date:   Wed, 10 Apr 2019 16:16:51 -0500
From:   "Gustavo A. R. Silva" <gustavo@...eddedor.com>
To:     David Woodhouse <dwmw2@...radead.org>,
        Brian Norris <computersforpeace@...il.com>,
        Boris Brezillon <bbrezillon@...nel.org>,
        Marek Vasut <marek.vasut@...il.com>,
        Richard Weinberger <richard@....at>
Cc:     linux-mtd@...ts.infradead.org, linux-kernel@...r.kernel.org,
        Kees Cook <keescook@...omium.org>
Subject: Re: [PATCH] mtd: cfi_util: mark expected switch fall-throughs

Hi all,

If no one cares I'll add this to my tree for 5.2.

Thanks
--
Gustavo

On 3/20/19 3:20 PM, Gustavo A. R. Silva wrote:
> Hi all,
> 
> Friendly ping:
> 
> Who can take this?
> 
> Thanks
> --
> Gustavo
> 
> On 2/8/19 12:02 PM, Gustavo A. R. Silva wrote:
>> In preparation to enabling -Wimplicit-fallthrough, mark switch
>> cases where we are expecting to fall through.
>>
>> This patch fixes the following warnings:
>>
>> drivers/mtd/chips/cfi_util.c: In function ‘cfi_build_cmd’:
>> drivers/mtd/chips/cfi_util.c:110:10: warning: this statement may fall through [-Wimplicit-fallthrough=]
>>    onecmd |= (onecmd << (chip_mode * 32));
>>    ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/mtd/chips/cfi_util.c:112:2: note: here
>>   case 4:
>>   ^~~~
>> drivers/mtd/chips/cfi_util.c:113:10: warning: this statement may fall through [-Wimplicit-fallthrough=]
>>    onecmd |= (onecmd << (chip_mode * 16));
>>    ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/mtd/chips/cfi_util.c:114:2: note: here
>>   case 2:
>>   ^~~~
>> drivers/mtd/chips/cfi_util.c: In function ‘cfi_merge_status’:
>> drivers/mtd/chips/cfi_util.c:163:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
>>    res |= (onestat >> (chip_mode * 32));
>>    ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/mtd/chips/cfi_util.c:165:2: note: here
>>   case 4:
>>   ^~~~
>> drivers/mtd/chips/cfi_util.c:166:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
>>    res |= (onestat >> (chip_mode * 16));
>>    ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/mtd/chips/cfi_util.c:167:2: note: here
>>   case 2:
>>   ^~~~
>>
>> Warning level 3 was used: -Wimplicit-fallthrough=3
>>
>> This patch is part of the ongoing efforts to enabling
>> -Wimplicit-fallthrough.
>>
>> Signed-off-by: Gustavo A. R. Silva <gustavo@...eddedor.com>
>> ---
>>  drivers/mtd/chips/cfi_util.c | 6 ++++++
>>  1 file changed, 6 insertions(+)
>>
>> diff --git a/drivers/mtd/chips/cfi_util.c b/drivers/mtd/chips/cfi_util.c
>> index 6f16552cd59f..e3b266ee06af 100644
>> --- a/drivers/mtd/chips/cfi_util.c
>> +++ b/drivers/mtd/chips/cfi_util.c
>> @@ -109,10 +109,13 @@ map_word cfi_build_cmd(u_long cmd, struct map_info *map, struct cfi_private *cfi
>>  	case 8:
>>  		onecmd |= (onecmd << (chip_mode * 32));
>>  #endif
>> +		/* fall through */
>>  	case 4:
>>  		onecmd |= (onecmd << (chip_mode * 16));
>> +		/* fall through */
>>  	case 2:
>>  		onecmd |= (onecmd << (chip_mode * 8));
>> +		/* fall through */
>>  	case 1:
>>  		;
>>  	}
>> @@ -162,10 +165,13 @@ unsigned long cfi_merge_status(map_word val, struct map_info *map,
>>  	case 8:
>>  		res |= (onestat >> (chip_mode * 32));
>>  #endif
>> +		/* fall through */
>>  	case 4:
>>  		res |= (onestat >> (chip_mode * 16));
>> +		/* fall through */
>>  	case 2:
>>  		res |= (onestat >> (chip_mode * 8));
>> +		/* fall through */
>>  	case 1:
>>  		;
>>  	}
>>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ