[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cb4c340251fe80ea9f83c2530f6a624219701c10.1666021212.git.drv@mailo.com>
Date: Mon, 17 Oct 2022 21:32:17 +0530
From: Deepak R Varma <drv@...lo.com>
To: outreachy@...ts.linux.dev, Larry.Finger@...inger.net,
phil@...lpotter.co.uk, paskripkin@...il.com,
gregkh@...uxfoundation.org, linux-staging@...ts.linux.dev,
linux-kernel@...r.kernel.org
Cc: kumarpraveen@...ux.microsoft.com, saurabh.truth@...il.com
Subject: [PATCH v1 4/4] staging: r8188eu: use htons macro instead of
__constant_htons
Macro "htons" is more efficient and clearer. It should be used for
constants instead of the __contast_htons macro. Resolves following
checkpatch script complaint:
WARNING: __constant_htons should be htons
Signed-off-by: Deepak R Varma <drv@...lo.com>
---
Changes in v1:
1. Correct spelling in patch description.
drivers/staging/r8188eu/core/rtw_br_ext.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/r8188eu/core/rtw_br_ext.c b/drivers/staging/r8188eu/core/rtw_br_ext.c
index 14797c2d6d76..718133c991d7 100644
--- a/drivers/staging/r8188eu/core/rtw_br_ext.c
+++ b/drivers/staging/r8188eu/core/rtw_br_ext.c
@@ -609,14 +609,14 @@ void dhcp_flag_bcast(struct adapter *priv, struct sk_buff *skb)
if (!priv->ethBrExtInfo.dhcp_bcst_disable) {
__be16 protocol = *((__be16 *)(skb->data + 2 * ETH_ALEN));
- if (protocol == __constant_htons(ETH_P_IP)) { /* IP */
+ if (protocol == htons(ETH_P_IP)) { /* IP */
struct iphdr *iph = (struct iphdr *)(skb->data + ETH_HLEN);
if (iph->protocol == IPPROTO_UDP) { /* UDP */
struct udphdr *udph = (struct udphdr *)((size_t)iph + (iph->ihl << 2));
- if ((udph->source == __constant_htons(CLIENT_PORT)) &&
- (udph->dest == __constant_htons(SERVER_PORT))) { /* DHCP request */
+ if ((udph->source == htons(CLIENT_PORT)) &&
+ (udph->dest == htons(SERVER_PORT))) { /* DHCP request */
struct dhcpMessage *dhcph =
(struct dhcpMessage *)((size_t)udph + sizeof(struct udphdr));
u32 cookie = be32_to_cpu((__be32)dhcph->cookie);
--
2.30.2
Powered by blists - more mailing lists