All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] block: Mark expected switch fall-throughs
@ 2019-01-23  6:45 Gustavo A. R. Silva
  2019-01-24  4:54 ` Chaitanya Kulkarni
  2019-01-29  9:42 ` [Drbd-dev] " Roland Kammerer
  0 siblings, 2 replies; 5+ messages in thread
From: Gustavo A. R. Silva @ 2019-01-23  6:45 UTC (permalink / raw)
  To: Philipp Reisner, Lars Ellenberg, Jens Axboe, Joshua Morris,
	Philip Kelleher
  Cc: drbd-dev, linux-block, linux-kernel, Gustavo A. R. Silva

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

This patch fixes the following warnings:

drivers/block/drbd/drbd_int.h:1774:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/block/drbd/drbd_int.h:1774:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/block/drbd/drbd_int.h:1774:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/block/drbd/drbd_int.h:1774:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/block/drbd/drbd_int.h:1774:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/block/drbd/drbd_receiver.c:3093:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/block/drbd/drbd_receiver.c:3120:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/block/drbd/drbd_req.c:856:6: warning: this statement may fall through [-Wimplicit-fallthrough=]

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@embeddedor.com>
---
 drivers/block/drbd/drbd_int.h      | 2 +-
 drivers/block/drbd/drbd_receiver.c | 4 ++--
 drivers/block/drbd/drbd_req.c      | 2 +-
 drivers/block/rsxx/core.c          | 1 +
 4 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h
index 000a2f4c0e92..f070f7200fc0 100644
--- a/drivers/block/drbd/drbd_int.h
+++ b/drivers/block/drbd/drbd_int.h
@@ -1778,7 +1778,7 @@ static inline void __drbd_chk_io_error_(struct drbd_device *device,
 				_drbd_set_state(_NS(device, disk, D_INCONSISTENT), CS_HARD, NULL);
 			break;
 		}
-		/* NOTE fall through for DRBD_META_IO_ERROR or DRBD_FORCE_DETACH */
+		/* fall through - for DRBD_META_IO_ERROR or DRBD_FORCE_DETACH */
 	case EP_DETACH:
 	case EP_CALL_HELPER:
 		/* Remember whether we saw a READ or WRITE error.
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
index c7ad88d91a09..74350663443f 100644
--- a/drivers/block/drbd/drbd_receiver.c
+++ b/drivers/block/drbd/drbd_receiver.c
@@ -3094,7 +3094,7 @@ static int drbd_asb_recover_0p(struct drbd_peer_device *peer_device) __must_hold
 			rv =  1;
 			break;
 		}
-		/* Else fall through to one of the other strategies... */
+		/* Else fall through - to one of the other strategies... */
 	case ASB_DISCARD_OLDER_PRI:
 		if (self == 0 && peer == 1) {
 			rv = 1;
@@ -3119,7 +3119,7 @@ static int drbd_asb_recover_0p(struct drbd_peer_device *peer_device) __must_hold
 		}
 		if (after_sb_0p == ASB_DISCARD_ZERO_CHG)
 			break;
-		/* else: fall through */
+		/* else, fall through */
 	case ASB_DISCARD_LEAST_CHG:
 		if	(ch_self < ch_peer)
 			rv = -1;
diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c
index 643a04af213b..3809c7e6be8c 100644
--- a/drivers/block/drbd/drbd_req.c
+++ b/drivers/block/drbd/drbd_req.c
@@ -866,7 +866,7 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
 			} /* else: FIXME can this happen? */
 			break;
 		}
-		/* else, fall through to BARRIER_ACKED */
+		/* else, fall through - to BARRIER_ACKED */
 
 	case BARRIER_ACKED:
 		/* barrier ack for READ requests does not make sense */
diff --git a/drivers/block/rsxx/core.c b/drivers/block/rsxx/core.c
index 0cf4509d575c..898d522e8338 100644
--- a/drivers/block/rsxx/core.c
+++ b/drivers/block/rsxx/core.c
@@ -439,6 +439,7 @@ static void card_state_change(struct rsxx_cardinfo *card,
 		 * Fall through so the DMA devices can be attached and
 		 * the user can attempt to pull off their data.
 		 */
+		/* fall through */
 	case CARD_STATE_GOOD:
 		st = rsxx_get_card_size8(card, &card->size8);
 		if (st)
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] block: Mark expected switch fall-throughs
  2019-01-23  6:45 [PATCH] block: Mark expected switch fall-throughs Gustavo A. R. Silva
@ 2019-01-24  4:54 ` Chaitanya Kulkarni
  2019-01-29  9:42 ` [Drbd-dev] " Roland Kammerer
  1 sibling, 0 replies; 5+ messages in thread
From: Chaitanya Kulkarni @ 2019-01-24  4:54 UTC (permalink / raw)
  To: Gustavo A. R. Silva, Philipp Reisner, Lars Ellenberg, Jens Axboe,
	Joshua Morris, Philip Kelleher
  Cc: drbd-dev, linux-block, linux-kernel


Looks good.

Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>




From: linux-block-owner@vger.kernel.org <linux-block-owner@vger.kernel.org> on behalf of Gustavo A. R. Silva <gustavo@embeddedor.com>
Sent: Tuesday, January 22, 2019 10:45 PM
To: Philipp Reisner; Lars Ellenberg; Jens Axboe; Joshua Morris; Philip Kelleher
Cc: drbd-dev@lists.linbit.com; linux-block@vger.kernel.org; linux-kernel@vger.kernel.org; Gustavo A. R. Silva
Subject: [PATCH] block: Mark expected switch fall-throughs
  
 
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

This patch fixes the following warnings:

drivers/block/drbd/drbd_int.h:1774:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/block/drbd/drbd_int.h:1774:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/block/drbd/drbd_int.h:1774:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/block/drbd/drbd_int.h:1774:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/block/drbd/drbd_int.h:1774:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/block/drbd/drbd_receiver.c:3093:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/block/drbd/drbd_receiver.c:3120:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/block/drbd/drbd_req.c:856:6: warning: this statement may fall through [-Wimplicit-fallthrough=]

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@embeddedor.com>
---
 drivers/block/drbd/drbd_int.h      | 2 +-
 drivers/block/drbd/drbd_receiver.c | 4 ++--
 drivers/block/drbd/drbd_req.c      | 2 +-
 drivers/block/rsxx/core.c          | 1 +
 4 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h
index 000a2f4c0e92..f070f7200fc0 100644
--- a/drivers/block/drbd/drbd_int.h
+++ b/drivers/block/drbd/drbd_int.h
@@ -1778,7 +1778,7 @@ static inline void __drbd_chk_io_error_(struct drbd_device *device,
                                 _drbd_set_state(_NS(device, disk, D_INCONSISTENT), CS_HARD, NULL);
                         break;
                 }
-               /* NOTE fall through for DRBD_META_IO_ERROR or DRBD_FORCE_DETACH */
+               /* fall through - for DRBD_META_IO_ERROR or DRBD_FORCE_DETACH */
         case EP_DETACH:
         case EP_CALL_HELPER:
                 /* Remember whether we saw a READ or WRITE error.
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
index c7ad88d91a09..74350663443f 100644
--- a/drivers/block/drbd/drbd_receiver.c
+++ b/drivers/block/drbd/drbd_receiver.c
@@ -3094,7 +3094,7 @@ static int drbd_asb_recover_0p(struct drbd_peer_device *peer_device) __must_hold
                         rv =  1;
                         break;
                 }
-               /* Else fall through to one of the other strategies... */
+               /* Else fall through - to one of the other strategies... */
         case ASB_DISCARD_OLDER_PRI:
                 if (self == 0 && peer == 1) {
                         rv = 1;
@@ -3119,7 +3119,7 @@ static int drbd_asb_recover_0p(struct drbd_peer_device *peer_device) __must_hold
                 }
                 if (after_sb_0p == ASB_DISCARD_ZERO_CHG)
                         break;
-               /* else: fall through */
+               /* else, fall through */
         case ASB_DISCARD_LEAST_CHG:
                 if      (ch_self < ch_peer)
                         rv = -1;
diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c
index 643a04af213b..3809c7e6be8c 100644
--- a/drivers/block/drbd/drbd_req.c
+++ b/drivers/block/drbd/drbd_req.c
@@ -866,7 +866,7 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
                         } /* else: FIXME can this happen? */
                         break;
                 }
-               /* else, fall through to BARRIER_ACKED */
+               /* else, fall through - to BARRIER_ACKED */
 
         case BARRIER_ACKED:
                 /* barrier ack for READ requests does not make sense */
diff --git a/drivers/block/rsxx/core.c b/drivers/block/rsxx/core.c
index 0cf4509d575c..898d522e8338 100644
--- a/drivers/block/rsxx/core.c
+++ b/drivers/block/rsxx/core.c
@@ -439,6 +439,7 @@ static void card_state_change(struct rsxx_cardinfo *card,
                  * Fall through so the DMA devices can be attached and
                  * the user can attempt to pull off their data.
                  */
+               /* fall through */
         case CARD_STATE_GOOD:
                 st = rsxx_get_card_size8(card, &card->size8);
                 if (st)
-- 
2.20.1

    

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Drbd-dev] [PATCH] block: Mark expected switch fall-throughs
  2019-01-23  6:45 [PATCH] block: Mark expected switch fall-throughs Gustavo A. R. Silva
  2019-01-24  4:54 ` Chaitanya Kulkarni
@ 2019-01-29  9:42 ` Roland Kammerer
  2019-02-26 19:31   ` Gustavo A. R. Silva
  1 sibling, 1 reply; 5+ messages in thread
From: Roland Kammerer @ 2019-01-29  9:42 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Philipp Reisner, Lars Ellenberg, Jens Axboe, Joshua Morris,
	Philip Kelleher, linux-block, linux-kernel, drbd-dev

On Wed, Jan 23, 2019 at 12:45:01AM -0600, Gustavo A. R. Silva wrote:
> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
> where we are expecting to fall through.
> 
> 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@embeddedor.com>
> ---
>  drivers/block/drbd/drbd_int.h      | 2 +-
>  drivers/block/drbd/drbd_receiver.c | 4 ++--
>  drivers/block/drbd/drbd_req.c      | 2 +-
>  drivers/block/rsxx/core.c          | 1 +
>  4 files changed, 5 insertions(+), 4 deletions(-)
> 

Hi Gustavo,

as also discussed with Lars in person, obviously OK for the DRBD part.

Acked-by: Roland Kammerer <roland.kammerer@linbit.com>

Best, rck

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Drbd-dev] [PATCH] block: Mark expected switch fall-throughs
  2019-01-29  9:42 ` [Drbd-dev] " Roland Kammerer
@ 2019-02-26 19:31   ` Gustavo A. R. Silva
  2019-03-18 20:53     ` Gustavo A. R. Silva
  0 siblings, 1 reply; 5+ messages in thread
From: Gustavo A. R. Silva @ 2019-02-26 19:31 UTC (permalink / raw)
  To: Roland Kammerer
  Cc: Philipp Reisner, Lars Ellenberg, Jens Axboe, Joshua Morris,
	Philip Kelleher, linux-block, linux-kernel, drbd-dev, Kees Cook



On 1/29/19 3:42 AM, Roland Kammerer wrote:
> On Wed, Jan 23, 2019 at 12:45:01AM -0600, Gustavo A. R. Silva wrote:
>> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
>> where we are expecting to fall through.
>>
>> 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@embeddedor.com>
>> ---
>>  drivers/block/drbd/drbd_int.h      | 2 +-
>>  drivers/block/drbd/drbd_receiver.c | 4 ++--
>>  drivers/block/drbd/drbd_req.c      | 2 +-
>>  drivers/block/rsxx/core.c          | 1 +
>>  4 files changed, 5 insertions(+), 4 deletions(-)
>>
> 
> Hi Gustavo,
> 
> as also discussed with Lars in person, obviously OK for the DRBD part.
> 
> Acked-by: Roland Kammerer <roland.kammerer@linbit.com>
> 

Thank you, Roland.

Friendly ping:

Who can take this, please?

Thanks
--
Gustavo

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Drbd-dev] [PATCH] block: Mark expected switch fall-throughs
  2019-02-26 19:31   ` Gustavo A. R. Silva
@ 2019-03-18 20:53     ` Gustavo A. R. Silva
  0 siblings, 0 replies; 5+ messages in thread
From: Gustavo A. R. Silva @ 2019-03-18 20:53 UTC (permalink / raw)
  To: Roland Kammerer
  Cc: Philipp Reisner, Lars Ellenberg, Jens Axboe, Joshua Morris,
	Philip Kelleher, linux-block, linux-kernel, drbd-dev, Kees Cook

Hi,

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

Thanks
--
Gustavo

On 2/26/19 1:31 PM, Gustavo A. R. Silva wrote:
> 
> 
> On 1/29/19 3:42 AM, Roland Kammerer wrote:
>> On Wed, Jan 23, 2019 at 12:45:01AM -0600, Gustavo A. R. Silva wrote:
>>> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
>>> where we are expecting to fall through.
>>>
>>> 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@embeddedor.com>
>>> ---
>>>  drivers/block/drbd/drbd_int.h      | 2 +-
>>>  drivers/block/drbd/drbd_receiver.c | 4 ++--
>>>  drivers/block/drbd/drbd_req.c      | 2 +-
>>>  drivers/block/rsxx/core.c          | 1 +
>>>  4 files changed, 5 insertions(+), 4 deletions(-)
>>>
>>
>> Hi Gustavo,
>>
>> as also discussed with Lars in person, obviously OK for the DRBD part.
>>
>> Acked-by: Roland Kammerer <roland.kammerer@linbit.com>
>>
> 
> Thank you, Roland.
> 
> Friendly ping:
> 
> Who can take this, please?
> 
> Thanks
> --
> Gustavo
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-03-18 21:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-23  6:45 [PATCH] block: Mark expected switch fall-throughs Gustavo A. R. Silva
2019-01-24  4:54 ` Chaitanya Kulkarni
2019-01-29  9:42 ` [Drbd-dev] " Roland Kammerer
2019-02-26 19:31   ` Gustavo A. R. Silva
2019-03-18 20:53     ` Gustavo A. R. Silva

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.