From nobody Tue Apr 7 15:56:27 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 212F9C433FE for ; Mon, 17 Oct 2022 16:32:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230071AbiJQQcG (ORCPT ); Mon, 17 Oct 2022 12:32:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229716AbiJQQcD (ORCPT ); Mon, 17 Oct 2022 12:32:03 -0400 Received: from msg-1.mailo.com (msg-1.mailo.com [213.182.54.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B99A46E2EA for ; Mon, 17 Oct 2022 09:32:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1666024309; bh=5Yb+4ARq0ilueDytZ8Aus4VvXa+Y2d6ob8lG8tdYn6Q=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:In-Reply-To; b=DBiNru1rwGsndvb1zvVhRATyquIvXFopsqiwtzvZ3xq3wBzL/EQuu+quMmYDl6b+p 9Oo9Sk1CCh3jJ8Qdq+qLRTkeY2AuLGamWayCbUaSdaleTcCSx4OHQPanBjUirLgOhZ VduQ7mu3U4wEjikmPc1Cg1WY9EQ1K9uYzOsdGHDc= Received: by b-5.in.mailobj.net [192.168.90.15] with ESMTP via [213.182.55.206] Mon, 17 Oct 2022 18:31:49 +0200 (CEST) X-EA-Auth: meiLiH2MjlqbGeP19xG3i5vTjOcBFdWpEMpA6VJRjK1RxUQRQ+qOTmbj7ivi43w+fWgY/6qsxOaQrsReyV7DzTCWa8jKfopK Date: Mon, 17 Oct 2022 21:32:17 +0530 From: Deepak R Varma To: outreachy@lists.linux.dev, Larry.Finger@lwfinger.net, phil@philpotter.co.uk, paskripkin@gmail.com, gregkh@linuxfoundation.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Cc: kumarpraveen@linux.microsoft.com, saurabh.truth@gmail.com Subject: [PATCH v1 4/4] staging: r8188eu: use htons macro instead of __constant_htons Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 --- 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/r8= 188eu/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 =3D *((__be16 *)(skb->data + 2 * ETH_ALEN)); - if (protocol =3D=3D __constant_htons(ETH_P_IP)) { /* IP */ + if (protocol =3D=3D htons(ETH_P_IP)) { /* IP */ struct iphdr *iph =3D (struct iphdr *)(skb->data + ETH_HLEN); if (iph->protocol =3D=3D IPPROTO_UDP) { /* UDP */ struct udphdr *udph =3D (struct udphdr *)((size_t)iph + (iph->ihl << 2= )); - if ((udph->source =3D=3D __constant_htons(CLIENT_PORT)) && - (udph->dest =3D=3D __constant_htons(SERVER_PORT))) { /* DHCP requ= est */ + if ((udph->source =3D=3D htons(CLIENT_PORT)) && + (udph->dest =3D=3D htons(SERVER_PORT))) { /* DHCP request */ struct dhcpMessage *dhcph =3D (struct dhcpMessage *)((size_t)udph + sizeof(struct udphdr)); u32 cookie =3D be32_to_cpu((__be32)dhcph->cookie); -- 2.30.2