Skip to content

Commit

Permalink
net: wwan: core: init port type string array using enum values
Browse files Browse the repository at this point in the history
This array is indexed by port type. Make it self-descriptive by using
the port type enum values as indices in the array initializer.

Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
Reviewed-by: Loic Poulain <loic.poulain@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Sergey Ryazanov authored and David S. Miller committed Jun 8, 2021
1 parent b64d76b commit 64cc80c
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions drivers/net/wwan/wwan_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,12 @@ static void wwan_remove_dev(struct wwan_device *wwandev)

/* ------- WWAN port management ------- */

/* Keep aligned with wwan_port_type enum */
static const char * const wwan_port_type_str[] = {
"AT",
"MBIM",
"QMI",
"QCDM",
"FIREHOSE"
static const char * const wwan_port_type_str[WWAN_PORT_MAX + 1] = {
[WWAN_PORT_AT] = "AT",
[WWAN_PORT_MBIM] = "MBIM",
[WWAN_PORT_QMI] = "QMI",
[WWAN_PORT_QCDM] = "QCDM",
[WWAN_PORT_FIREHOSE] = "FIREHOSE",
};

static ssize_t type_show(struct device *dev, struct device_attribute *attr,
Expand Down

0 comments on commit 64cc80c

Please sign in to comment.