From: Michal Suchanek <hidden> Date: 2021-05-03 10:24:22
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]
switch (state) {
^~~~~~
drivers/net/ethernet/ibm/ibmvnic.c: In function 'reset_reason_to_string':
drivers/net/ethernet/ibm/ibmvnic.c:1935:2: warning: enumeration value 'VNIC_RESET_FOOBAR' not handled in switch [-Wswitch]
switch (reason) {
^~~~~~
Signed-off-by: Michal Suchanek <redacted>
---
drivers/net/ethernet/ibm/ibmvnic.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
From: Lijun Pan <hidden> Date: 2021-05-03 18:21:19
On Mon, May 3, 2021 at 5:54 AM Michal Suchanek [off-list ref] 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 to net-next as an improvement?
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]
switch (state) {
^~~~~~
drivers/net/ethernet/ibm/ibmvnic.c: In function 'reset_reason_to_string':
drivers/net/ethernet/ibm/ibmvnic.c:1935:2: warning: enumeration value 'VNIC_RESET_FOOBAR' not handled in switch [-Wswitch]
switch (reason) {
^~~~~~
Signed-off-by: Michal Suchanek <redacted>
---
From: David Miller <davem@davemloft.net> Date: 2021-05-03 20:47:27
From: Lijun Pan <redacted>
Date: Mon, 3 May 2021 13:21:00 -0500
On Mon, May 3, 2021 at 5:54 AM Michal Suchanek [off-list ref] wrote:
quoted
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 to net-next as an improvement?
From: Michal Suchanek <hidden> Date: 2021-05-04 05:40:57
This way the compiler warns when a new value is added to the enum but
not to the string translation 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]
switch (state) {
^~~~~~
drivers/net/ethernet/ibm/ibmvnic.c: In function 'reset_reason_to_string':
drivers/net/ethernet/ibm/ibmvnic.c:1935:2: warning: enumeration value 'VNIC_RESET_FOOBAR' not handled in switch [-Wswitch]
switch (reason) {
^~~~~~
Signed-off-by: Michal Suchanek <redacted>
---
v2: Fix typo in commit message
---
drivers/net/ethernet/ibm/ibmvnic.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
From: Michal Suchanek <hidden> Date: 2021-05-04 19:19:39
This way the compiler warns when a new value is added to the enum but
not to the string translation 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]
switch (state) {
^~~~~~
drivers/net/ethernet/ibm/ibmvnic.c: In function 'reset_reason_to_string':
drivers/net/ethernet/ibm/ibmvnic.c:1935:2: warning: enumeration value 'VNIC_RESET_FOOBAR' not handled in switch [-Wswitch]
switch (reason) {
^~~~~~
Signed-off-by: Michal Suchanek <redacted>
Acked-by: Lijun Pan <redacted>
---
v2: Fix typo in commit message
---
drivers/net/ethernet/ibm/ibmvnic.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
From: Lijun Pan <hidden> Date: 2021-05-04 19:39:25
On Tue, May 4, 2021 at 2:19 PM Michal Suchanek [off-list ref] wrote:
This way the compiler warns when a new value is added to the enum but
not to the string translation 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]
switch (state) {
^~~~~~
drivers/net/ethernet/ibm/ibmvnic.c: In function 'reset_reason_to_string':
drivers/net/ethernet/ibm/ibmvnic.c:1935:2: warning: enumeration value 'VNIC_RESET_FOOBAR' not handled in switch [-Wswitch]
switch (reason) {
^~~~~~
Signed-off-by: Michal Suchanek <redacted>
Acked-by: Lijun Pan <redacted>
---
v2: Fix typo in commit message
---
Hi Michal,
Thank you for reposting the patch and including the Ack-by tag. I
think you need to wait till next Tuesday or so when net-next reopens,
then you can repost the patch.
http://vger.kernel.org/~davem/net-next.html.
Thanks,
Lijun