2018-07-03 21:22:31

by Gustavo A. R. Silva

[permalink] [raw]
Subject: [PATCH] lightnvm: pblk: mark expected switch fall-through

In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Signed-off-by: Gustavo A. R. Silva <[email protected]>
---
drivers/lightnvm/pblk-core.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/lightnvm/pblk-core.c b/drivers/lightnvm/pblk-core.c
index ed9cc97..9c93334 100644
--- a/drivers/lightnvm/pblk-core.c
+++ b/drivers/lightnvm/pblk-core.c
@@ -264,6 +264,7 @@ void pblk_free_rqd(struct pblk *pblk, struct nvm_rq *rqd, int type)
switch (type) {
case PBLK_WRITE:
kfree(((struct pblk_c_ctx *)nvm_rq_to_pdu(rqd))->lun_bitmap);
+ /* fall through */
case PBLK_WRITE_INT:
pool = &pblk->w_rq_pool;
break;
--
2.7.4



2018-07-04 08:11:46

by Matias Bjørling

[permalink] [raw]
Subject: Re: [PATCH] lightnvm: pblk: mark expected switch fall-through

On 07/03/2018 11:21 PM, Gustavo A. R. Silva wrote:
> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
> where we are expecting to fall through.
>
> Signed-off-by: Gustavo A. R. Silva <[email protected]>
> ---
> drivers/lightnvm/pblk-core.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/lightnvm/pblk-core.c b/drivers/lightnvm/pblk-core.c
> index ed9cc97..9c93334 100644
> --- a/drivers/lightnvm/pblk-core.c
> +++ b/drivers/lightnvm/pblk-core.c
> @@ -264,6 +264,7 @@ void pblk_free_rqd(struct pblk *pblk, struct nvm_rq *rqd, int type)
> switch (type) {
> case PBLK_WRITE:
> kfree(((struct pblk_c_ctx *)nvm_rq_to_pdu(rqd))->lun_bitmap);
> + /* fall through */
> case PBLK_WRITE_INT:
> pool = &pblk->w_rq_pool;
> break;
>

Thanks Gustavo. Applied for 4.19.

2018-07-04 13:03:55

by Gustavo A. R. Silva

[permalink] [raw]
Subject: Re: [PATCH] lightnvm: pblk: mark expected switch fall-through



On 07/04/2018 03:07 AM, Matias Bjørling wrote:
> On 07/03/2018 11:21 PM, Gustavo A. R. Silva wrote:
>> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
>> where we are expecting to fall through.
>>
>> Signed-off-by: Gustavo A. R. Silva <[email protected]>
>> ---
>>   drivers/lightnvm/pblk-core.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/lightnvm/pblk-core.c b/drivers/lightnvm/pblk-core.c
>> index ed9cc97..9c93334 100644
>> --- a/drivers/lightnvm/pblk-core.c
>> +++ b/drivers/lightnvm/pblk-core.c
>> @@ -264,6 +264,7 @@ void pblk_free_rqd(struct pblk *pblk, struct nvm_rq *rqd, int type)
>>       switch (type) {
>>       case PBLK_WRITE:
>>           kfree(((struct pblk_c_ctx *)nvm_rq_to_pdu(rqd))->lun_bitmap);
>> +        /* fall through */
>>       case PBLK_WRITE_INT:
>>           pool = &pblk->w_rq_pool;
>>           break;
>>
>
> Thanks Gustavo. Applied for 4.19.

Thanks, Matias.
--
Gustavo