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 4/5] net: dsa: tag_mtk: Fix warnings for __be16
Date: Sun,  5 Jul 2020 21:30:07 +0200	[thread overview]
Message-ID: <20200705193008.889623-5-andrew@lunn.ch> (raw)
In-Reply-To: <20200705193008.889623-1-andrew@lunn.ch>

net/dsa/tag_mtk.c:84:13: warning: incorrect type in assignment (different base types)
net/dsa/tag_mtk.c:84:13:    expected restricted __be16 [usertype] hdr
net/dsa/tag_mtk.c:84:13:    got int
net/dsa/tag_mtk.c:94:17: warning: restricted __be16 degrades to integer

The result of a ntohs() is not __be16, but u16.

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

diff --git a/net/dsa/tag_mtk.c b/net/dsa/tag_mtk.c
index d6619edd53e5..f602fc758d68 100644
--- a/net/dsa/tag_mtk.c
+++ b/net/dsa/tag_mtk.c
@@ -67,8 +67,9 @@ static struct sk_buff *mtk_tag_xmit(struct sk_buff *skb,
 static struct sk_buff *mtk_tag_rcv(struct sk_buff *skb, struct net_device *dev,
 				   struct packet_type *pt)
 {
+	u16 hdr;
 	int port;
-	__be16 *phdr, hdr;
+	__be16 *phdr;
 	unsigned char *dest = eth_hdr(skb)->h_dest;
 	bool is_multicast_skb = is_multicast_ether_addr(dest) &&
 				!is_broadcast_ether_addr(dest);
-- 
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 ` Andrew Lunn [this message]
2020-07-05 20:41   ` [PATCH net-next 4/5] net: dsa: tag_mtk: Fix warnings for __be16 Florian Fainelli
2020-07-05 19:30 ` [PATCH net-next 5/5] net: dsa: tag_qca.c: Fix warning for __be16 vs u16 Andrew Lunn
2020-07-05 20:43   ` 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-5-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).