From: Amey Narkhede <ameynarkhede03@gmail.com>
To: justin@coraid.com
Cc: axboe@kernel.dk, linux-block@vger.kernel.org,
linux-kernel@vger.kernel.org,
Amey Narkhede <ameynarkhede03@gmail.com>
Subject: [PATCH] block: aoe: replace use of __constant_htons to htons
Date: Sun, 20 Dec 2020 22:16:25 +0530 [thread overview]
Message-ID: <20201220164625.94105-1-ameynarkhede03@gmail.com> (raw)
The macro htons expands to __swab16 which has special
case for constants in little endian case. In big
endian case both __constant_htons and htons macros
expand to the same code. So, replace __constant_htons
with htons to get rid of the definition of __constant_htons
completely.
Signed-off-by: Amey Narkhede <ameynarkhede03@gmail.com>
---
drivers/block/aoe/aoecmd.c | 2 +-
drivers/block/aoe/aoenet.c | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c
index 313f0b946fe2..7a5374a57b55 100644
--- a/drivers/block/aoe/aoecmd.c
+++ b/drivers/block/aoe/aoecmd.c
@@ -69,7 +69,7 @@ new_skb(ulong len)
skb_reserve(skb, MAX_HEADER);
skb_reset_mac_header(skb);
skb_reset_network_header(skb);
- skb->protocol = __constant_htons(ETH_P_AOE);
+ skb->protocol = htons(ETH_P_AOE);
skb_checksum_none_assert(skb);
}
return skb;
diff --git a/drivers/block/aoe/aoenet.c b/drivers/block/aoe/aoenet.c
index 63773a90581d..2532e35774e0 100644
--- a/drivers/block/aoe/aoenet.c
+++ b/drivers/block/aoe/aoenet.c
@@ -192,7 +192,7 @@ aoenet_rcv(struct sk_buff *skb, struct net_device *ifp, struct packet_type *pt,
}
static struct packet_type aoe_pt __read_mostly = {
- .type = __constant_htons(ETH_P_AOE),
+ .type = htons(ETH_P_AOE),
.func = aoenet_rcv,
};
@@ -220,4 +220,3 @@ aoenet_exit(void)
skb_queue_purge(&skbtxq);
dev_remove_pack(&aoe_pt);
}
-
--
2.29.2
next reply other threads:[~2020-12-20 16:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-20 16:46 Amey Narkhede [this message]
2020-12-20 19:35 ` [PATCH] block: aoe: replace use of __constant_htons to htons David Laight
[not found] ` <20201220202019.j7x64yahapgilr7u@archlinux>
[not found] ` <c5df63bdc5a94ebdac9505a64f2cece5@AcuMS.aculab.com>
2020-12-21 11:03 ` 'Amey Narkhede'
-- strict thread matches above, loose matches on Subject: below --
2020-12-20 20:56 'Amey Narkhede'
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=20201220164625.94105-1-ameynarkhede03@gmail.com \
--to=ameynarkhede03@gmail.com \
--cc=axboe@kernel.dk \
--cc=justin@coraid.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@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