From: Michal Suchanek <msuchanek@suse.de>
To: netdev@vger.kernel.org
Cc: Sukadev Bhattiprolu <sukadev@linux.ibm.com>,
Lijun Pan <lijunp213@gmail.com>,
linux-kernel@vger.kernel.org,
Thomas Falcon <tlfalcon@linux.ibm.com>,
Paul Mackerras <paulus@samba.org>,
Dany Madden <drt@linux.ibm.com>, Jakub Kicinski <kuba@kernel.org>,
Michal Suchanek <msuchanek@suse.de>,
linuxppc-dev@lists.ozlabs.org,
"David S. Miller" <davem@davemloft.net>
Subject: [PATCH v2 net-next] ibmvnic: remove default label from to_string switch
Date: Tue, 4 May 2021 07:40:42 +0200 [thread overview]
Message-ID: <20210504054042.29305-1-msuchanek@suse.de> (raw)
In-Reply-To: <20210503.134721.2149322673805635760.davem@davemloft.net>
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 <msuchanek@suse.de>
---
v2: Fix typo in commit message
---
drivers/net/ethernet/ibm/ibmvnic.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index 5788bb956d73..4d439413f6d9 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -846,9 +846,8 @@ static const char *adapter_state_to_string(enum vnic_state state)
return "REMOVING";
case VNIC_REMOVED:
return "REMOVED";
- default:
- return "UNKNOWN";
}
+ return "UNKNOWN";
}
static int ibmvnic_login(struct net_device *netdev)
@@ -1946,9 +1945,8 @@ static const char *reset_reason_to_string(enum ibmvnic_reset_reason reason)
return "TIMEOUT";
case VNIC_RESET_CHANGE_PARAM:
return "CHANGE_PARAM";
- default:
- return "UNKNOWN";
}
+ return "UNKNOWN";
}
/*
--
2.26.2
next prev parent reply other threads:[~2021-05-04 5:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-03 10:23 [PATCH] ibmvnic: remove default label from to_string switch Michal Suchanek
2021-05-03 18:21 ` Lijun Pan
2021-05-03 20:47 ` David Miller
2021-05-04 5:40 ` Michal Suchanek [this message]
2021-05-04 19:19 ` [PATCH v2 net-next resend] " Michal Suchanek
2021-05-04 19:39 ` Lijun Pan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210504054042.29305-1-msuchanek@suse.de \
--to=msuchanek@suse.de \
--cc=davem@davemloft.net \
--cc=drt@linux.ibm.com \
--cc=kuba@kernel.org \
--cc=lijunp213@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=netdev@vger.kernel.org \
--cc=paulus@samba.org \
--cc=sukadev@linux.ibm.com \
--cc=tlfalcon@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).