* [PATCH v2][next] IB/hfi1: Remove unnecessary fall-through markings
@ 2020-07-09 23:52 Gustavo A. R. Silva
2020-07-12 17:44 ` Leon Romanovsky
2020-07-16 18:41 ` Jason Gunthorpe
0 siblings, 2 replies; 4+ messages in thread
From: Gustavo A. R. Silva @ 2020-07-09 23:52 UTC (permalink / raw)
To: Mike Marciniszyn, Dennis Dalessandro, Doug Ledford,
Jason Gunthorpe, Leon Romanovsky
Cc: linux-rdma, linux-kernel, Gustavo A. R. Silva
Reorganize the code a bit in a more standard way[1] and remove
unnecessary fall-through markings.
[1] https://lore.kernel.org/lkml/20200708054703.GR207186@unreal/
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
---
Changes in v2:
- Remove additional overlooked fall-through markings.
drivers/infiniband/hw/hfi1/chip.c | 27 ++++++++++++++-------------
1 file changed, 14 insertions(+), 13 deletions(-)
diff --git a/drivers/infiniband/hw/hfi1/chip.c b/drivers/infiniband/hw/hfi1/chip.c
index 15f9c635f292..7eaf99538216 100644
--- a/drivers/infiniband/hw/hfi1/chip.c
+++ b/drivers/infiniband/hw/hfi1/chip.c
@@ -7317,11 +7317,11 @@ static u16 link_width_to_bits(struct hfi1_devdata *dd, u16 width)
case 1: return OPA_LINK_WIDTH_1X;
case 2: return OPA_LINK_WIDTH_2X;
case 3: return OPA_LINK_WIDTH_3X;
+ case 4: return OPA_LINK_WIDTH_4X;
default:
dd_dev_info(dd, "%s: invalid width %d, using 4\n",
__func__, width);
- /* fall through */
- case 4: return OPA_LINK_WIDTH_4X;
+ return OPA_LINK_WIDTH_4X;
}
}
@@ -7376,12 +7376,13 @@ static void get_link_widths(struct hfi1_devdata *dd, u16 *tx_width,
case 0:
dd->pport[0].link_speed_active = OPA_LINK_SPEED_12_5G;
break;
+ case 1:
+ dd->pport[0].link_speed_active = OPA_LINK_SPEED_25G;
+ break;
default:
dd_dev_err(dd,
"%s: unexpected max rate %d, using 25Gb\n",
__func__, (int)max_rate);
- /* fall through */
- case 1:
dd->pport[0].link_speed_active = OPA_LINK_SPEED_25G;
break;
}
@@ -12878,11 +12879,6 @@ static int init_cntrs(struct hfi1_devdata *dd)
static u32 chip_to_opa_lstate(struct hfi1_devdata *dd, u32 chip_lstate)
{
switch (chip_lstate) {
- default:
- dd_dev_err(dd,
- "Unknown logical state 0x%x, reporting IB_PORT_DOWN\n",
- chip_lstate);
- /* fall through */
case LSTATE_DOWN:
return IB_PORT_DOWN;
case LSTATE_INIT:
@@ -12891,6 +12887,11 @@ static u32 chip_to_opa_lstate(struct hfi1_devdata *dd, u32 chip_lstate)
return IB_PORT_ARMED;
case LSTATE_ACTIVE:
return IB_PORT_ACTIVE;
+ default:
+ dd_dev_err(dd,
+ "Unknown logical state 0x%x, reporting IB_PORT_DOWN\n",
+ chip_lstate);
+ return IB_PORT_DOWN;
}
}
@@ -12898,10 +12899,6 @@ u32 chip_to_opa_pstate(struct hfi1_devdata *dd, u32 chip_pstate)
{
/* look at the HFI meta-states only */
switch (chip_pstate & 0xf0) {
- default:
- dd_dev_err(dd, "Unexpected chip physical state of 0x%x\n",
- chip_pstate);
- /* fall through */
case PLS_DISABLED:
return IB_PORTPHYSSTATE_DISABLED;
case PLS_OFFLINE:
@@ -12914,6 +12911,10 @@ u32 chip_to_opa_pstate(struct hfi1_devdata *dd, u32 chip_pstate)
return IB_PORTPHYSSTATE_LINKUP;
case PLS_PHYTEST:
return IB_PORTPHYSSTATE_PHY_TEST;
+ default:
+ dd_dev_err(dd, "Unexpected chip physical state of 0x%x\n",
+ chip_pstate);
+ return IB_PORTPHYSSTATE_DISABLED;
}
}
--
2.27.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2][next] IB/hfi1: Remove unnecessary fall-through markings
2020-07-09 23:52 [PATCH v2][next] IB/hfi1: Remove unnecessary fall-through markings Gustavo A. R. Silva
@ 2020-07-12 17:44 ` Leon Romanovsky
2020-07-16 18:41 ` Jason Gunthorpe
1 sibling, 0 replies; 4+ messages in thread
From: Leon Romanovsky @ 2020-07-12 17:44 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: Mike Marciniszyn, Dennis Dalessandro, Doug Ledford,
Jason Gunthorpe, linux-rdma, linux-kernel
On Thu, Jul 09, 2020 at 06:52:50PM -0500, Gustavo A. R. Silva wrote:
> Reorganize the code a bit in a more standard way[1] and remove
> unnecessary fall-through markings.
>
> [1] https://lore.kernel.org/lkml/20200708054703.GR207186@unreal/
>
> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
> ---
> Changes in v2:
> - Remove additional overlooked fall-through markings.
>
> drivers/infiniband/hw/hfi1/chip.c | 27 ++++++++++++++-------------
> 1 file changed, 14 insertions(+), 13 deletions(-)
>
Thanks,
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2][next] IB/hfi1: Remove unnecessary fall-through markings
2020-07-09 23:52 [PATCH v2][next] IB/hfi1: Remove unnecessary fall-through markings Gustavo A. R. Silva
2020-07-12 17:44 ` Leon Romanovsky
@ 2020-07-16 18:41 ` Jason Gunthorpe
2020-07-16 18:53 ` Gustavo A. R. Silva
1 sibling, 1 reply; 4+ messages in thread
From: Jason Gunthorpe @ 2020-07-16 18:41 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: Mike Marciniszyn, Dennis Dalessandro, Doug Ledford,
Leon Romanovsky, linux-rdma, linux-kernel
On Thu, Jul 09, 2020 at 06:52:50PM -0500, Gustavo A. R. Silva wrote:
> Reorganize the code a bit in a more standard way[1] and remove
> unnecessary fall-through markings.
>
> [1] https://lore.kernel.org/lkml/20200708054703.GR207186@unreal/
>
> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
> Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
> ---
> Changes in v2:
> - Remove additional overlooked fall-through markings.
>
> drivers/infiniband/hw/hfi1/chip.c | 27 ++++++++++++++-------------
> 1 file changed, 14 insertions(+), 13 deletions(-)
Applied to for-next, thanks
Jason
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2][next] IB/hfi1: Remove unnecessary fall-through markings
2020-07-16 18:41 ` Jason Gunthorpe
@ 2020-07-16 18:53 ` Gustavo A. R. Silva
0 siblings, 0 replies; 4+ messages in thread
From: Gustavo A. R. Silva @ 2020-07-16 18:53 UTC (permalink / raw)
To: Jason Gunthorpe, Gustavo A. R. Silva
Cc: Mike Marciniszyn, Dennis Dalessandro, Doug Ledford,
Leon Romanovsky, linux-rdma, linux-kernel
On 7/16/20 13:41, Jason Gunthorpe wrote:
> On Thu, Jul 09, 2020 at 06:52:50PM -0500, Gustavo A. R. Silva wrote:
>> Reorganize the code a bit in a more standard way[1] and remove
>> unnecessary fall-through markings.
>>
>> [1] https://lore.kernel.org/lkml/20200708054703.GR207186@unreal/
>>
>> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
>> Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
>> ---
>> Changes in v2:
>> - Remove additional overlooked fall-through markings.
>>
>> drivers/infiniband/hw/hfi1/chip.c | 27 ++++++++++++++-------------
>> 1 file changed, 14 insertions(+), 13 deletions(-)
>
> Applied to for-next, thanks
>
Thanks, Jason.
--
Gustavo
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-07-16 19:08 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-09 23:52 [PATCH v2][next] IB/hfi1: Remove unnecessary fall-through markings Gustavo A. R. Silva
2020-07-12 17:44 ` Leon Romanovsky
2020-07-16 18:41 ` Jason Gunthorpe
2020-07-16 18:53 ` Gustavo A. R. Silva
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).