Re: [PATCH] ibmvnic: remove default label from to_string switch

2021-05-03 Thread David Miller
From: Lijun Pan Date: Mon, 3 May 2021 13:21:00 -0500 > On Mon, May 3, 2021 at 5:54 AM Michal Suchanek wrote: >> >> This way the compiler warns when a new value is added to the enum but >> not the string transation like: > > s/transation/translation/ > > This trick works. > Since the original c

Re: [PATCH] ibmvnic: remove default label from to_string switch

2021-05-03 Thread Lijun Pan
On Mon, May 3, 2021 at 5:54 AM Michal Suchanek wrote: > > This way the compiler warns when a new value is added to the enum but > not the string transation like: s/transation/translation/ This trick works. Since the original code does not generate gcc warnings/errors, should this patch be sent t

[PATCH] ibmvnic: remove default label from to_string switch

2021-05-03 Thread Michal Suchanek
This way the compiler warns when a new value is added to the enum but not the string transation like: drivers/net/ethernet/ibm/ibmvnic.c: In function 'adapter_state_to_string': drivers/net/ethernet/ibm/ibmvnic.c:832:2: warning: enumeration value 'VNIC_FOOBAR' not handled in switch [-Wswitch] sw