netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: David Miller <davem@davemloft.net>
Cc: netdev <netdev@vger.kernel.org>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Andrew Lunn <andrew@lunn.ch>
Subject: [PATCH net-next 5/5] net: dsa: tag_qca.c: Fix warning for __be16 vs u16
Date: Sun,  5 Jul 2020 21:30:08 +0200	[thread overview]
Message-ID: <20200705193008.889623-6-andrew@lunn.ch> (raw)
In-Reply-To: <20200705193008.889623-1-andrew@lunn.ch>

net/dsa/tag_qca.c:48:15: warning: incorrect type in assignment (different base types)
net/dsa/tag_qca.c:48:15:    expected unsigned short [usertype]
net/dsa/tag_qca.c:48:15:    got restricted __be16 [usertype]
net/dsa/tag_qca.c:68:13: warning: incorrect type in assignment (different base types)
net/dsa/tag_qca.c:68:13:    expected restricted __be16 [usertype] hdr
net/dsa/tag_qca.c:68:13:    got int
net/dsa/tag_qca.c:71:16: warning: restricted __be16 degrades to integer
net/dsa/tag_qca.c:81:17: warning: restricted __be16 degrades to integer

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
 net/dsa/tag_qca.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/net/dsa/tag_qca.c b/net/dsa/tag_qca.c
index 70db7c909f74..7066f5e697d7 100644
--- a/net/dsa/tag_qca.c
+++ b/net/dsa/tag_qca.c
@@ -31,7 +31,8 @@
 static struct sk_buff *qca_tag_xmit(struct sk_buff *skb, struct net_device *dev)
 {
 	struct dsa_port *dp = dsa_slave_to_port(dev);
-	u16 *phdr, hdr;
+	__be16 *phdr;
+	u16 hdr;
 
 	if (skb_cow_head(skb, QCA_HDR_LEN) < 0)
 		return NULL;
@@ -39,7 +40,7 @@ static struct sk_buff *qca_tag_xmit(struct sk_buff *skb, struct net_device *dev)
 	skb_push(skb, QCA_HDR_LEN);
 
 	memmove(skb->data, skb->data + QCA_HDR_LEN, 2 * ETH_ALEN);
-	phdr = (u16 *)(skb->data + 2 * ETH_ALEN);
+	phdr = (__be16 *)(skb->data + 2 * ETH_ALEN);
 
 	/* Set the version field, and set destination port information */
 	hdr = QCA_HDR_VERSION << QCA_HDR_XMIT_VERSION_S |
@@ -54,8 +55,9 @@ static struct sk_buff *qca_tag_rcv(struct sk_buff *skb, struct net_device *dev,
 				   struct packet_type *pt)
 {
 	u8 ver;
+	u16  hdr;
 	int port;
-	__be16 *phdr, hdr;
+	__be16 *phdr;
 
 	if (unlikely(!pskb_may_pull(skb, QCA_HDR_LEN)))
 		return NULL;
-- 
2.27.0.rc2


  parent reply	other threads:[~2020-07-05 19:30 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-05 19:30 [PATCH net-next 0/5] net: dsa: Fix C=1 W=1 warnings Andrew Lunn
2020-07-05 19:30 ` [PATCH net-next 1/5] net: dsa: Add __precpu property to prevent warnings Andrew Lunn
2020-07-05 20:40   ` Florian Fainelli
2020-07-05 19:30 ` [PATCH net-next 2/5] net: dsa: tag_ksz: Fix __be16 warnings Andrew Lunn
2020-07-05 20:41   ` Florian Fainelli
2020-07-05 19:30 ` [PATCH net-next 3/5] net: dsa: tag_lan9303: " Andrew Lunn
2020-07-05 20:44   ` Florian Fainelli
2020-07-05 19:30 ` [PATCH net-next 4/5] net: dsa: tag_mtk: Fix warnings for __be16 Andrew Lunn
2020-07-05 20:41   ` Florian Fainelli
2020-07-05 19:30 ` Andrew Lunn [this message]
2020-07-05 20:43   ` [PATCH net-next 5/5] net: dsa: tag_qca.c: Fix warning for __be16 vs u16 Florian Fainelli
2020-07-05 22:32 ` [PATCH net-next 0/5] net: dsa: Fix C=1 W=1 warnings David Miller

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=20200705193008.889623-6-andrew@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=netdev@vger.kernel.org \
    /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).