Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp4716590rwi; Mon, 17 Oct 2022 09:44:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4hsEs1ODNXsPD8BLGoXkmhXLg5sqJjX5IuaUaoJIb4EvCLrYwcCTNsiA0Kr9ksGu8lBvby X-Received: by 2002:a05:6a00:1a92:b0:565:d5c0:f627 with SMTP id e18-20020a056a001a9200b00565d5c0f627mr13552807pfv.10.1666025041634; Mon, 17 Oct 2022 09:44:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666025041; cv=none; d=google.com; s=arc-20160816; b=06YLBIied1YKZ0iY/xUqlfzNRgc/Lz8zA0fBuBuXSPSQbQ8AGdZyWNh4j/2xBJy5s5 L+L6nOzS4e2C4VccngKvzbikAUSjWlcyoCJhw9gSSDkMtBo36ruCCLdu0J+TuWMQRT7W LAS1FvVZHRihvVFQSmABJhTcJnvpGph0BJ/oWFFkuvvgP3pilKecGmHwTcTjz0Jtsk9+ SIyi9ViGlW5aHAIRIW5PAimkRQv+QJZuFgsM6JB1mIxDFglBbmRJmGWnTbX4pKY8qElu aUFEbCs0Hcyzn+04wgnHLxvth4KOoN+UVQtevBk+DXuWp9OzrcYoT9qiHuS3KUZI/d2r cNog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=junuGgy3UeZkQlcqImJzZ4RcO2IQb6kGfkA1Ok0CXGc=; b=JeRJxJVppdIOvm2KbBAtWe2YvKNxAOhmRknNBwZp4JoT1w9RAJLQk0pu6QLEBlgss/ 55ZZEaWFs0ZLQ53NAEvs9UKaNl0l9s9oLsCqUXYIqEVrhYiDCwDRWU8fhk3E97ETlj6V xIC9e1w0W3l2Zv6xwhkLJz5WEdmJ53nfV8tANBqFZJeKvf6xbyhH+/aNDV/oZqASXSA/ Q5v43GCJb60OLnN8MpEnmFRSBioGXgl5aNkbEszJuMvRshwQ8dcWpU861Wnw/jxQsrlt QUzUKleWCRj8IvoPMt0AE78+xSmh74OYbM2jd7WSEjFECXxPCSq7APoTVoIm7OIY4CMo 3GFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=DBiNru1r; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 184-20020a6215c1000000b00563206b6e94si11274268pfv.223.2022.10.17.09.43.48; Mon, 17 Oct 2022 09:44:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=DBiNru1r; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230041AbiJQQcF (ORCPT + 99 others); Mon, 17 Oct 2022 12:32:05 -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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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/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