staging: wlan-ng: Fix third argument going over 80 characters

Create a new 'status' variable to store the value of a long argument
that goes over 80 characters. The status variable is also used for
an if check. Replacing that long statement in both places makes the
code much easier to read.

Note: the status variable is assigned after a needed byte order
conversion for usbin->rxfrm.desc.status, which uses a reference.

Issue reported by checkpatch.

Suggested-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: John B. Wyatt IV <jbwyatt4@gmail.com>
Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
Link: https://lore.kernel.org/r/20200321225808.2494564-1-jbwyatt4@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
John B. Wyatt IV 2020-03-21 15:58:08 -07:00 коммит произвёл Greg Kroah-Hartman
Родитель 1c31a1302c
Коммит 759411a0e0
1 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -3254,13 +3254,16 @@ static void hfa384x_usbin_rx(struct wlandevice *wlandev, struct sk_buff *skb)
struct p80211_rxmeta *rxmeta; struct p80211_rxmeta *rxmeta;
u16 data_len; u16 data_len;
u16 fc; u16 fc;
u16 status;
/* Byte order convert once up front. */ /* Byte order convert once up front. */
le16_to_cpus(&usbin->rxfrm.desc.status); le16_to_cpus(&usbin->rxfrm.desc.status);
le32_to_cpus(&usbin->rxfrm.desc.time); le32_to_cpus(&usbin->rxfrm.desc.time);
/* Now handle frame based on port# */ /* Now handle frame based on port# */
switch (HFA384x_RXSTATUS_MACPORT_GET(usbin->rxfrm.desc.status)) { status = HFA384x_RXSTATUS_MACPORT_GET(usbin->rxfrm.desc.status);
switch (status) {
case 0: case 0:
fc = le16_to_cpu(usbin->rxfrm.desc.frame_control); fc = le16_to_cpu(usbin->rxfrm.desc.frame_control);
@ -3319,7 +3322,7 @@ static void hfa384x_usbin_rx(struct wlandevice *wlandev, struct sk_buff *skb)
default: default:
netdev_warn(hw->wlandev->netdev, netdev_warn(hw->wlandev->netdev,
"Received frame on unsupported port=%d\n", "Received frame on unsupported port=%d\n",
HFA384x_RXSTATUS_MACPORT_GET(usbin->rxfrm.desc.status)); status);
break; break;
} }
} }