summaryrefslogtreecommitdiffstats
path: root/drivers/s390/net/qeth_core_main.c
diff options
context:
space:
mode:
authorHans Wippel2017-04-07 09:15:36 +0200
committerDavid S. Miller2017-04-07 14:52:51 +0200
commit6bee4e26a39c51ffe698072ded1f5ab2062e4225 (patch)
treeafa529d2a93f414199c386cbf7e95ee5b6a84aff /drivers/s390/net/qeth_core_main.c
parents390/qeth: Remove unused code (diff)
downloadkernel-qcow2-linux-6bee4e26a39c51ffe698072ded1f5ab2062e4225.tar.gz
kernel-qcow2-linux-6bee4e26a39c51ffe698072ded1f5ab2062e4225.tar.xz
kernel-qcow2-linux-6bee4e26a39c51ffe698072ded1f5ab2062e4225.zip
s390/qeth: improve endianness handling
Avoid endianness warnings reported by sparse by (1) using endianness conversions for assigning and using network packet fields, and (2) removing unnecessary endianness conversions from qeth_l3_rebuild_skb. No functional changes. Signed-off-by: Hans Wippel <hwippel@linux.vnet.ibm.com> Signed-off-by: Ursula Braun <ubraun@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/s390/net/qeth_core_main.c')
-rw-r--r--drivers/s390/net/qeth_core_main.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index 95f9cc189a3a..6b22b05a6953 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -1201,7 +1201,7 @@ static void qeth_notify_skbs(struct qeth_qdio_out_q *q,
while (skb) {
QETH_CARD_TEXT_(q->card, 5, "skbn%d", notification);
QETH_CARD_TEXT_(q->card, 5, "%lx", (long) skb);
- if (skb->protocol == ETH_P_AF_IUCV) {
+ if (be16_to_cpu(skb->protocol) == ETH_P_AF_IUCV) {
if (skb->sk) {
struct iucv_sock *iucv = iucv_sk(skb->sk);
iucv->sk_txnotify(skb, notification);
@@ -1232,7 +1232,8 @@ static void qeth_release_skbs(struct qeth_qdio_out_buffer *buf)
while (skb) {
QETH_CARD_TEXT(buf->q->card, 5, "skbr");
QETH_CARD_TEXT_(buf->q->card, 5, "%lx", (long) skb);
- if (notify_general_error && skb->protocol == ETH_P_AF_IUCV) {
+ if (notify_general_error &&
+ be16_to_cpu(skb->protocol) == ETH_P_AF_IUCV) {
if (skb->sk) {
iucv = iucv_sk(skb->sk);
iucv->sk_txnotify(skb, TX_NOTIFY_GENERALERROR);
@@ -3796,9 +3797,9 @@ int qeth_get_priority_queue(struct qeth_card *card, struct sk_buff *skb,
return qeth_cut_iqd_prio(card, ~skb->priority >> 1 & 3);
case QETH_PRIO_Q_ING_VLAN:
tci = &((struct ethhdr *)skb->data)->h_proto;
- if (*tci == ETH_P_8021Q)
- return qeth_cut_iqd_prio(card, ~*(tci + 1) >>
- (VLAN_PRIO_SHIFT + 1) & 3);
+ if (be16_to_cpu(*tci) == ETH_P_8021Q)
+ return qeth_cut_iqd_prio(card,
+ ~be16_to_cpu(*(tci + 1)) >> (VLAN_PRIO_SHIFT + 1) & 3);
break;
default:
break;