Skip to contentSkip to conversation

lightnvm: pblk: mark expected switch fall-through

PATCH In review Gustavo A. R. Silva 2 participants 3 messages Jul 3, 2018 – Jul 4, 2018 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lightnvm: pblk: mark expected switch fall-through

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

---
 drivers/lightnvm/pblk-core.c | 1 +
 1 file changed, 1 insertion(+)
drivers/lightnvm/pblk-core.c +1 -0
index ed9cc97..9c93334 100644
@@ -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;
Signature · 1 line
2.7.4
#1 lore raw
Quoted 14 lines · Gustavo A. R. Silva

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

---
  drivers/lightnvm/pblk-core.c | 1 +
  1 file changed, 1 insertion(+)
drivers/lightnvm/pblk-core.c +0 -0
index ed9cc97..9c93334 100644

drivers/lightnvm/pblk-core.c void pblk_free_rqd(struct pblk *pblk, struct nvm_rq *rqd, int type) · line 270

Quoted 7 lines
drivers/lightnvm/pblk-core.c +1 -0
@@ -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.

#2 lore raw
Quoted 9 lines · Matias Bjørling
Quoted 8 lines · Gustavo A. R. Silva

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

---
  drivers/lightnvm/pblk-core.c | 1 +

  1 file changed, 1 insertion(+)
Quoted 15 lines
Quoted 6 lines
drivers/lightnvm/pblk-core.c +0 -0
index ed9cc97..9c93334 100644
@@ -264,6 +264,7 @@ void pblk_free_rqd(struct pblk *pblk, struct nvm_rq *rqd, int type)
       switch (type) {
Quoted 7 lines

      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