Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

IB/hfi1: Remove unnecessary fall-through markings

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/

Link: https://lore.kernel.org/r/20200709235250.GA26678@embeddedor
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>

authored by

Gustavo A. R. Silva and committed by
Jason Gunthorpe
535ee8cd acca72e2

+14 -13
+14 -13
drivers/infiniband/hw/hfi1/chip.c
··· 7317 7317 case 1: return OPA_LINK_WIDTH_1X; 7318 7318 case 2: return OPA_LINK_WIDTH_2X; 7319 7319 case 3: return OPA_LINK_WIDTH_3X; 7320 + case 4: return OPA_LINK_WIDTH_4X; 7320 7321 default: 7321 7322 dd_dev_info(dd, "%s: invalid width %d, using 4\n", 7322 7323 __func__, width); 7323 - /* fall through */ 7324 - case 4: return OPA_LINK_WIDTH_4X; 7324 + return OPA_LINK_WIDTH_4X; 7325 7325 } 7326 7326 } 7327 7327 ··· 7376 7376 case 0: 7377 7377 dd->pport[0].link_speed_active = OPA_LINK_SPEED_12_5G; 7378 7378 break; 7379 + case 1: 7380 + dd->pport[0].link_speed_active = OPA_LINK_SPEED_25G; 7381 + break; 7379 7382 default: 7380 7383 dd_dev_err(dd, 7381 7384 "%s: unexpected max rate %d, using 25Gb\n", 7382 7385 __func__, (int)max_rate); 7383 - /* fall through */ 7384 - case 1: 7385 7386 dd->pport[0].link_speed_active = OPA_LINK_SPEED_25G; 7386 7387 break; 7387 7388 } ··· 12879 12878 static u32 chip_to_opa_lstate(struct hfi1_devdata *dd, u32 chip_lstate) 12880 12879 { 12881 12880 switch (chip_lstate) { 12882 - default: 12883 - dd_dev_err(dd, 12884 - "Unknown logical state 0x%x, reporting IB_PORT_DOWN\n", 12885 - chip_lstate); 12886 - /* fall through */ 12887 12881 case LSTATE_DOWN: 12888 12882 return IB_PORT_DOWN; 12889 12883 case LSTATE_INIT: ··· 12887 12891 return IB_PORT_ARMED; 12888 12892 case LSTATE_ACTIVE: 12889 12893 return IB_PORT_ACTIVE; 12894 + default: 12895 + dd_dev_err(dd, 12896 + "Unknown logical state 0x%x, reporting IB_PORT_DOWN\n", 12897 + chip_lstate); 12898 + return IB_PORT_DOWN; 12890 12899 } 12891 12900 } 12892 12901 ··· 12899 12898 { 12900 12899 /* look at the HFI meta-states only */ 12901 12900 switch (chip_pstate & 0xf0) { 12902 - default: 12903 - dd_dev_err(dd, "Unexpected chip physical state of 0x%x\n", 12904 - chip_pstate); 12905 - /* fall through */ 12906 12901 case PLS_DISABLED: 12907 12902 return IB_PORTPHYSSTATE_DISABLED; 12908 12903 case PLS_OFFLINE: ··· 12911 12914 return IB_PORTPHYSSTATE_LINKUP; 12912 12915 case PLS_PHYTEST: 12913 12916 return IB_PORTPHYSSTATE_PHY_TEST; 12917 + default: 12918 + dd_dev_err(dd, "Unexpected chip physical state of 0x%x\n", 12919 + chip_pstate); 12920 + return IB_PORTPHYSSTATE_DISABLED; 12914 12921 } 12915 12922 } 12916 12923