From nobody Thu Apr 9 12:08:22 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 F2566C433FE for ; Mon, 17 Oct 2022 13:54:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229904AbiJQNyF (ORCPT ); Mon, 17 Oct 2022 09:54:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229913AbiJQNyB (ORCPT ); Mon, 17 Oct 2022 09:54:01 -0400 Received: from msg-4.mailo.com (msg-4.mailo.com [213.182.54.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9583437431 for ; Mon, 17 Oct 2022 06:53:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1666014825; bh=yto/l1lyLDHKlg80DQzPoJMZv1MlSDpRPOIfnKmwexM=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:In-Reply-To; b=m12rP1zZOzS6Ghc0a/VVGajyRURzCP/lhvNUvqprvfO6eHRur83EUcI4SsggNX1Lu lcoCtPOMtD3kGlw3tKB0aLrPOWK/dFG3tiJ48p/7uc9oc/3HA8nRnIE9f3RwdmnolD tA0ht+keLWgynPVKt6SohYo0P7KM/iB5gr22Rr+0= Received: by b-3.in.mailobj.net [192.168.90.13] with ESMTP via [213.182.55.206] Mon, 17 Oct 2022 15:53:45 +0200 (CEST) X-EA-Auth: J+Gjj6U9qBUSFbOzvtoxK/8I+/Kqe6dpy1Kyzts/HqVGDvcxnsz5SAW4MqYLaUVhkhDbl1Y4Fke8hF5bvPgWF33YGJCaoTvm Date: Mon, 17 Oct 2022 18:54:11 +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 4/4] staging: r8188eu: use htons macro instead of __constant_htons Message-ID: <595559852924cc1b58778659d2dbca8e263ee9d8.1666011479.git.drv@mailo.com> 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 efficiant 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 --- 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 290affe50d0b..334360de23da 100644 --- a/drivers/staging/r8188eu/core/rtw_br_ext.c +++ b/drivers/staging/r8188eu/core/rtw_br_ext.c @@ -612,14 +612,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