From patchwork Mon Oct 17 13:21:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepak R Varma X-Patchwork-Id: 3468 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1459850wrs; Mon, 17 Oct 2022 06:53:53 -0700 (PDT) X-Google-Smtp-Source: AMsMyM51oyLw80TG+JBAaJuDklnCw7xoiwNNfOQU12wcHEt00MRZxRZRSqbNZg6m1Q7TCCT/Rn3T X-Received: by 2002:a05:6402:b5a:b0:458:f4c6:8039 with SMTP id bx26-20020a0564020b5a00b00458f4c68039mr10543742edb.349.1666014833556; Mon, 17 Oct 2022 06:53:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666014833; cv=none; d=google.com; s=arc-20160816; b=q/48hX3sZ5a2VxCexg0gi5Iq2STcWJsg3HF4OlrUjtmD4uLe3I2Q50qNx+H0RUnh3z t89oDhVpK8O8H0uej3CC5U9r+84oMxNENytaY4VcZX0Gg7WmffXnodswhU+TUAi0XWE3 LDkTapThclMXrApLu2yx00sVPnrNYZ0gYtznJ/CbMeCnLo8etAetcTlOFgtD+UBDBKLa MNjzeONdMg8kPYQlu/8dw+4kGhtuAiZTJhuoAHpWqop+7qGgNmIat8BsQhQKwSmM0FPj oDKcaHsqfiEk5F+i6au/4wPbq06ADrQcHNC2bns24T7pn7+7cpm24osJpTvQfFj0dILx p2ew== 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=Tg+C9NRvZE+4AQlak2sV9U/z02e6TUWphHobzxh2xuM=; b=xgEYqDcB2dOzw2UFXhhBoc6ULyRAA9XiRiR7eHMSFDwp5zal3RKha86EjTFEM6WZfa LUdS0s70FwCn1D5wQMcHkthk/BXNDZLjsXolmkvkYwn4eXo24QehoGR+qrKNUPNumsyG UyvDCyQ0BhVhZACqWnnxJ66TlqU1ROtFNPcuyTp1f2YR0VAKvVFlPsODOObzjRTU5ncI y55FKxLiwQ83sMuyymLSTUUzEIaHYXomu6PrFIPpCdKTURar0qWAIMCBuNzxYsTwUvO4 mfEh/oBEfKg0/XIHrGEEf3GlTBmb4wRqz9fvXQDTO9OlHCHTuuW+kAKgxlBL5wNF6TIs NCZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=kv8U8J2E; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qw22-20020a1709066a1600b0078d3a35e181si8996971ejc.871.2022.10.17.06.53.26; Mon, 17 Oct 2022 06:53:53 -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=kv8U8J2E; 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 S230113AbiJQNvp (ORCPT + 99 others); Mon, 17 Oct 2022 09:51:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230090AbiJQNvn (ORCPT ); Mon, 17 Oct 2022 09:51:43 -0400 Received: from msg-4.mailo.com (msg-4.mailo.com [213.182.54.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67F0B1A22D for ; Mon, 17 Oct 2022 06:51:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1666014681; bh=e7y/gdua3ODmWXy8ucHEJ3MMPJKxvCInX0sfWBDTsBU=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:In-Reply-To; b=kv8U8J2EYFeETXUtCVtX9QJO7t5CIrtKcYVOCrpV5girWUBPY+b0bl/WD2gtKJdYQ r2kVoy+f9at0y5WggrJcWt6g2pKZEsztQMnH/iGM9hEtN4Sq0rWEjccDBvBPqAy2mA nBqTUQmTmb0f4w/IEinV20+uRGnA4tU0yQIdX2l8= Received: by b-2.in.mailobj.net [192.168.90.12] with ESMTP via [213.182.55.206] Mon, 17 Oct 2022 15:51:21 +0200 (CEST) X-EA-Auth: 8gBJYp27seKAA26961w94jVTWg9S9IRxIiKmQ/HC1YIX0Zfwe4zMLhba3Wr+Re6bEwg+vO5wx28p8G6UUiL2fBB0u1tKfaiJ Date: Mon, 17 Oct 2022 18:51:47 +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 1/4] staging: r8188eu: use Linux kernel variable naming convention Message-ID: <3088d91e9d279d4515cd086ae969f33a7c061652.1666011479.git.drv@mailo.com> References: MIME-Version: 1.0 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746943170022395592?= X-GMAIL-MSGID: =?utf-8?q?1746943170022395592?= Follow Linux Kernel coding style variable naming convention instead of using camelCase style. Address following checkpatch script complaints: CHECK: Avoid CamelCase: CHECK: Avoid CamelCase: CHECK: Avoid CamelCase: CHECK: Avoid CamelCase: CHECK: Avoid CamelCase: Signed-off-by: Deepak R Varma --- drivers/staging/r8188eu/core/rtw_br_ext.c | 112 +++++++++++----------- 1 file changed, 56 insertions(+), 56 deletions(-) -- 2.30.2 diff --git a/drivers/staging/r8188eu/core/rtw_br_ext.c b/drivers/staging/r8188eu/core/rtw_br_ext.c index 4c5f30792a46..79daf8f269d6 100644 --- a/drivers/staging/r8188eu/core/rtw_br_ext.c +++ b/drivers/staging/r8188eu/core/rtw_br_ext.c @@ -50,17 +50,17 @@ static unsigned char *__nat25_find_pppoe_tag(struct pppoe_hdr *ph, unsigned short type) { unsigned char *cur_ptr, *start_ptr; - unsigned short tagLen, tagType; + unsigned short tag_len, tag_type; start_ptr = (unsigned char *)ph->tag; cur_ptr = (unsigned char *)ph->tag; while ((cur_ptr - start_ptr) < ntohs(ph->length)) { /* prevent un-alignment access */ - tagType = (unsigned short)((cur_ptr[0] << 8) + cur_ptr[1]); - tagLen = (unsigned short)((cur_ptr[2] << 8) + cur_ptr[3]); - if (tagType == type) + tag_type = (unsigned short)((cur_ptr[0] << 8) + cur_ptr[1]); + tag_len = (unsigned short)((cur_ptr[2] << 8) + cur_ptr[3]); + if (tag_type == type) return cur_ptr; - cur_ptr = cur_ptr + TAG_HDR_LEN + tagLen; + cur_ptr = cur_ptr + TAG_HDR_LEN + tag_len; } return NULL; } @@ -111,32 +111,32 @@ static int __nat25_has_expired(struct nat25_network_db_entry *fdb) return 0; } -static void __nat25_generate_ipv4_network_addr(unsigned char *networkAddr, - unsigned int *ipAddr) +static void __nat25_generate_ipv4_network_addr(unsigned char *network_addr, + unsigned int *ip_addr) { - memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN); + memset(network_addr, 0, MAX_NETWORK_ADDR_LEN); - networkAddr[0] = NAT25_IPV4; - memcpy(networkAddr + 7, (unsigned char *)ipAddr, 4); + network_addr[0] = NAT25_IPV4; + memcpy(network_addr + 7, (unsigned char *)ip_addr, 4); } -static void __nat25_generate_pppoe_network_addr(unsigned char *networkAddr, +static void __nat25_generate_pppoe_network_addr(unsigned char *network_addr, unsigned char *ac_mac, __be16 *sid) { - memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN); + memset(network_addr, 0, MAX_NETWORK_ADDR_LEN); - networkAddr[0] = NAT25_PPPOE; - memcpy(networkAddr + 1, (unsigned char *)sid, 2); - memcpy(networkAddr + 3, (unsigned char *)ac_mac, 6); + network_addr[0] = NAT25_PPPOE; + memcpy(network_addr + 1, (unsigned char *)sid, 2); + memcpy(network_addr + 3, (unsigned char *)ac_mac, 6); } -static void __nat25_generate_ipv6_network_addr(unsigned char *networkAddr, - unsigned int *ipAddr) +static void __nat25_generate_ipv6_network_addr(unsigned char *network_addr, + unsigned int *ip_addr) { - memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN); + memset(network_addr, 0, MAX_NETWORK_ADDR_LEN); - networkAddr[0] = NAT25_IPV6; - memcpy(networkAddr + 1, (unsigned char *)ipAddr, 16); + network_addr[0] = NAT25_IPV6; + memcpy(network_addr + 1, (unsigned char *)ip_addr, 16); } static unsigned char *scan_tlv(unsigned char *data, int len, unsigned char tag, unsigned char len8b) @@ -200,40 +200,40 @@ static int update_nd_link_layer_addr(unsigned char *data, int len, unsigned char return 0; } -static int __nat25_network_hash(unsigned char *networkAddr) +static int __nat25_network_hash(unsigned char *network_addr) { - if (networkAddr[0] == NAT25_IPV4) { + if (network_addr[0] == NAT25_IPV4) { unsigned long x; - x = networkAddr[7] ^ networkAddr[8] ^ networkAddr[9] ^ networkAddr[10]; + x = network_addr[7] ^ network_addr[8] ^ network_addr[9] ^ network_addr[10]; return x & (NAT25_HASH_SIZE - 1); - } else if (networkAddr[0] == NAT25_IPX) { + } else if (network_addr[0] == NAT25_IPX) { unsigned long x; - x = networkAddr[1] ^ networkAddr[2] ^ networkAddr[3] ^ networkAddr[4] ^ networkAddr[5] ^ - networkAddr[6] ^ networkAddr[7] ^ networkAddr[8] ^ networkAddr[9] ^ networkAddr[10]; + x = network_addr[1] ^ network_addr[2] ^ network_addr[3] ^ network_addr[4] ^ network_addr[5] ^ + network_addr[6] ^ network_addr[7] ^ network_addr[8] ^ network_addr[9] ^ network_addr[10]; return x & (NAT25_HASH_SIZE - 1); - } else if (networkAddr[0] == NAT25_APPLE) { + } else if (network_addr[0] == NAT25_APPLE) { unsigned long x; - x = networkAddr[1] ^ networkAddr[2] ^ networkAddr[3]; + x = network_addr[1] ^ network_addr[2] ^ network_addr[3]; return x & (NAT25_HASH_SIZE - 1); - } else if (networkAddr[0] == NAT25_PPPOE) { + } else if (network_addr[0] == NAT25_PPPOE) { unsigned long x; - x = networkAddr[0] ^ networkAddr[1] ^ networkAddr[2] ^ networkAddr[3] ^ networkAddr[4] ^ networkAddr[5] ^ networkAddr[6] ^ networkAddr[7] ^ networkAddr[8]; + x = network_addr[0] ^ network_addr[1] ^ network_addr[2] ^ network_addr[3] ^ network_addr[4] ^ network_addr[5] ^ network_addr[6] ^ network_addr[7] ^ network_addr[8]; return x & (NAT25_HASH_SIZE - 1); - } else if (networkAddr[0] == NAT25_IPV6) { + } else if (network_addr[0] == NAT25_IPV6) { unsigned long x; - x = networkAddr[1] ^ networkAddr[2] ^ networkAddr[3] ^ networkAddr[4] ^ networkAddr[5] ^ - networkAddr[6] ^ networkAddr[7] ^ networkAddr[8] ^ networkAddr[9] ^ networkAddr[10] ^ - networkAddr[11] ^ networkAddr[12] ^ networkAddr[13] ^ networkAddr[14] ^ networkAddr[15] ^ - networkAddr[16]; + x = network_addr[1] ^ network_addr[2] ^ network_addr[3] ^ network_addr[4] ^ network_addr[5] ^ + network_addr[6] ^ network_addr[7] ^ network_addr[8] ^ network_addr[9] ^ network_addr[10] ^ + network_addr[11] ^ network_addr[12] ^ network_addr[13] ^ network_addr[14] ^ network_addr[15] ^ + network_addr[16]; return x & (NAT25_HASH_SIZE - 1); } else { @@ -241,7 +241,7 @@ static int __nat25_network_hash(unsigned char *networkAddr) int i; for (i = 0; i < MAX_NETWORK_ADDR_LEN; i++) - x ^= networkAddr[i]; + x ^= network_addr[i]; return x & (NAT25_HASH_SIZE - 1); } @@ -269,17 +269,17 @@ static void __network_hash_unlink(struct nat25_network_db_entry *ent) } static void __nat25_db_network_insert(struct adapter *priv, - unsigned char *macAddr, unsigned char *networkAddr) + unsigned char *mac_addr, unsigned char *network_addr) { struct nat25_network_db_entry *db; int hash; spin_lock_bh(&priv->br_ext_lock); - hash = __nat25_network_hash(networkAddr); + hash = __nat25_network_hash(network_addr); db = priv->nethash[hash]; while (db) { - if (!memcmp(db->networkAddr, networkAddr, MAX_NETWORK_ADDR_LEN)) { - memcpy(db->macAddr, macAddr, ETH_ALEN); + if (!memcmp(db->networkAddr, network_addr, MAX_NETWORK_ADDR_LEN)) { + memcpy(db->macAddr, mac_addr, ETH_ALEN); db->ageing_timer = jiffies; spin_unlock_bh(&priv->br_ext_lock); return; @@ -291,8 +291,8 @@ static void __nat25_db_network_insert(struct adapter *priv, spin_unlock_bh(&priv->br_ext_lock); return; } - memcpy(db->networkAddr, networkAddr, MAX_NETWORK_ADDR_LEN); - memcpy(db->macAddr, macAddr, ETH_ALEN); + memcpy(db->networkAddr, network_addr, MAX_NETWORK_ADDR_LEN); + memcpy(db->macAddr, mac_addr, ETH_ALEN); atomic_set(&db->use_count, 1); db->ageing_timer = jiffies; @@ -366,7 +366,7 @@ void nat25_db_expire(struct adapter *priv) int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method) { unsigned short protocol; - unsigned char networkAddr[MAX_NETWORK_ADDR_LEN]; + unsigned char network_addr[MAX_NETWORK_ADDR_LEN]; unsigned int tmp; if (!skb) @@ -395,9 +395,9 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method) if (iph->saddr == 0) return 0; tmp = be32_to_cpu(iph->saddr); - __nat25_generate_ipv4_network_addr(networkAddr, &tmp); + __nat25_generate_ipv4_network_addr(network_addr, &tmp); /* record source IP address and , source mac address into db */ - __nat25_db_network_insert(priv, skb->data + ETH_ALEN, networkAddr); + __nat25_db_network_insert(priv, skb->data + ETH_ALEN, network_addr); return 0; default: return -1; @@ -421,8 +421,8 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method) memcpy(arp_ptr, GET_MY_HWADDR(priv), ETH_ALEN); arp_ptr += arp->ar_hln; sender = (unsigned int *)arp_ptr; - __nat25_generate_ipv4_network_addr(networkAddr, sender); - __nat25_db_network_insert(priv, skb->data + ETH_ALEN, networkAddr); + __nat25_generate_ipv4_network_addr(network_addr, sender); + __nat25_db_network_insert(priv, skb->data + ETH_ALEN, network_addr); return 0; default: return -1; @@ -495,9 +495,9 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method) return -1; } } else { /* session phase */ - __nat25_generate_pppoe_network_addr(networkAddr, skb->data, &ph->sid); + __nat25_generate_pppoe_network_addr(network_addr, skb->data, &ph->sid); - __nat25_db_network_insert(priv, skb->data + ETH_ALEN, networkAddr); + __nat25_db_network_insert(priv, skb->data + ETH_ALEN, network_addr); if (!priv->ethBrExtInfo.addPPPoETag && priv->pppoe_connection_in_progress && @@ -548,8 +548,8 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method) return -1; case NAT25_INSERT: if (memcmp(&iph->saddr, "\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0", 16)) { - __nat25_generate_ipv6_network_addr(networkAddr, (unsigned int *)&iph->saddr); - __nat25_db_network_insert(priv, skb->data + ETH_ALEN, networkAddr); + __nat25_generate_ipv6_network_addr(network_addr, (unsigned int *)&iph->saddr); + __nat25_db_network_insert(priv, skb->data + ETH_ALEN, network_addr); if (iph->nexthdr == IPPROTO_ICMPV6 && skb->len > (ETH_HLEN + sizeof(*iph) + 4)) { @@ -639,17 +639,17 @@ void dhcp_flag_bcast(struct adapter *priv, struct sk_buff *skb) } } -void *scdb_findEntry(struct adapter *priv, unsigned char *ipAddr) +void *scdb_findEntry(struct adapter *priv, unsigned char *ip_addr) { - unsigned char networkAddr[MAX_NETWORK_ADDR_LEN]; + unsigned char network_addr[MAX_NETWORK_ADDR_LEN]; struct nat25_network_db_entry *db; int hash; - __nat25_generate_ipv4_network_addr(networkAddr, (unsigned int *)ipAddr); - hash = __nat25_network_hash(networkAddr); + __nat25_generate_ipv4_network_addr(network_addr, (unsigned int *)ip_addr); + hash = __nat25_network_hash(network_addr); db = priv->nethash[hash]; while (db) { - if (!memcmp(db->networkAddr, networkAddr, MAX_NETWORK_ADDR_LEN)) { + if (!memcmp(db->networkAddr, network_addr, MAX_NETWORK_ADDR_LEN)) { return (void *)db; } From patchwork Mon Oct 17 13:22:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepak R Varma X-Patchwork-Id: 3470 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1464565wrs; Mon, 17 Oct 2022 07:03:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM718D5fwfuulMIsjotGAwrGyUYhXikS8D5bqpkudhqKfwhW8olQl4hdtvpAmznev0vrjozt X-Received: by 2002:a05:6402:1686:b0:459:4ddf:8f05 with SMTP id a6-20020a056402168600b004594ddf8f05mr10386829edv.375.1666015408162; Mon, 17 Oct 2022 07:03:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666015408; cv=none; d=google.com; s=arc-20160816; b=x+t+zHM8kWrInxZGyckq4cC6NU4UQnq5g/421Mn8RlJseKBhri02SyQ8P+BKSET3et y6idK1Ixi6A7WjHzWWTxvX+4l/Jp47NGT85klu66JUQzKA1Ifa7NXvPVPxu2OxGFPeTK 9xu7EnzwV/kRv3UtyyPKTFvI9fEBmEn2eGvHgi5j04+peMEH29Hdegt6B9xBK2EX3qZH wZ7DwQmcNTccsdSLxpt9P9mlnqRPu5c7TDMEw5ubxkXxsiMOViw29TMye2U3FcJcUSxB A3MwJdlBIaXe1re7kLDGyx/mdfGnbSwBhr4YJxHFG7B9SGK0HPsUyonLAU4AyQ7HgJzK W4kA== 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=BAOxoONT/XwmZInxLm9YMn4HtwE0fHIEH5U+aUHaFdY=; b=DWXhKZq1lC7L5q2gsLNWDCu8xLOh9DEU3VPvPJ7+LTo4KZLGoMfrhK+Puqhc/q4uoa S5hpMWE32qcO+qgJO8a5M0fk9LUxXhc+xEmKHvYXXK+93F9gY7YRlhWnPPbL1vjnp0ra dowfhpVqonfwqYgcUjrSMTCxh7CDwSRdniKcoFhCPyKo/8fvaIi3wElBPwnK2EHJUAok 2uzZuUDnGc1qlaKonusYnkj4r/yojwU5wT61s8qBC4L5JMu0dBZXQo79+neGnFkYWEzD 5j35/24IwD4fYtUxoVrrSeoN7lk5/JJe5wrWvAog9sFOSKZgVOtAfC4phmAEwFdRbX20 LWgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=hvlC17pu; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l16-20020aa7cad0000000b00459c1e64776si8329302edt.412.2022.10.17.07.02.23; Mon, 17 Oct 2022 07:03:28 -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=hvlC17pu; 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 S230119AbiJQNwm (ORCPT + 99 others); Mon, 17 Oct 2022 09:52:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229969AbiJQNwk (ORCPT ); Mon, 17 Oct 2022 09:52:40 -0400 Received: from msg-2.mailo.com (msg-2.mailo.com [213.182.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 980221C125 for ; Mon, 17 Oct 2022 06:52:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1666014744; bh=oYVwPDhXlI3Y4t67S9SXV2J/p4NYzrT/hdmHZXrTn7A=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:In-Reply-To; b=hvlC17puZA5L1lKIYDi5h5K/Byf14bivO7iCwpO0l0IZTgEVy81+YNIn/wtUNEfDw muhD3Iq+bpqBGNd4ZjsfJI/+IUSOXvocujRDbCk78McMlQxMUvErtspeVJ9V2E0z8V eTXKTO6g1DHCmQqXzSymGrntRSV8DFv41PceR4CI= Received: by b-4.in.mailobj.net [192.168.90.14] with ESMTP via [213.182.55.206] Mon, 17 Oct 2022 15:52:24 +0200 (CEST) X-EA-Auth: dh3puqb9svTS10k+Nb9Vk8Bw4QeB0YC0aC3X5FK0Xu9oWOTuOSqm9EvVedcOtwE1VhO6BpMlPSPi9xH1mnk2PS2tXCzE19vJ Date: Mon, 17 Oct 2022 18:52:50 +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 2/4] staging: r8188eu: reformat long computation lines Message-ID: <2dd27eff9aab5ffe31e61086c0584982794507cf.1666011479.git.drv@mailo.com> References: MIME-Version: 1.0 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746943772910472483?= X-GMAIL-MSGID: =?utf-8?q?1746943772910472483?= Reformat long running computation instructions to improve code readability. Address following checkpatch script complaints: CHECK: line length of 171 exceeds 100 columns CHECK: line length of 113 exceeds 100 columns Signed-off-by: Deepak R Varma --- drivers/staging/r8188eu/core/rtw_br_ext.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) -- 2.30.2 diff --git a/drivers/staging/r8188eu/core/rtw_br_ext.c b/drivers/staging/r8188eu/core/rtw_br_ext.c index 79daf8f269d6..427da7e8ba4c 100644 --- a/drivers/staging/r8188eu/core/rtw_br_ext.c +++ b/drivers/staging/r8188eu/core/rtw_br_ext.c @@ -211,8 +211,10 @@ static int __nat25_network_hash(unsigned char *network_addr) } else if (network_addr[0] == NAT25_IPX) { unsigned long x; - x = network_addr[1] ^ network_addr[2] ^ network_addr[3] ^ network_addr[4] ^ network_addr[5] ^ - network_addr[6] ^ network_addr[7] ^ network_addr[8] ^ network_addr[9] ^ network_addr[10]; + x = network_addr[1] ^ network_addr[2] ^ network_addr[3] ^ + network_addr[4] ^ network_addr[5] ^ network_addr[6] ^ + network_addr[7] ^ network_addr[8] ^ network_addr[9] ^ + network_addr[10]; return x & (NAT25_HASH_SIZE - 1); } else if (network_addr[0] == NAT25_APPLE) { @@ -224,16 +226,20 @@ static int __nat25_network_hash(unsigned char *network_addr) } else if (network_addr[0] == NAT25_PPPOE) { unsigned long x; - x = network_addr[0] ^ network_addr[1] ^ network_addr[2] ^ network_addr[3] ^ network_addr[4] ^ network_addr[5] ^ network_addr[6] ^ network_addr[7] ^ network_addr[8]; + x = network_addr[0] ^ network_addr[1] ^ network_addr[2] ^ + network_addr[3] ^ network_addr[4] ^ network_addr[5] ^ + network_addr[6] ^ network_addr[7] ^ network_addr[8]; return x & (NAT25_HASH_SIZE - 1); } else if (network_addr[0] == NAT25_IPV6) { unsigned long x; - x = network_addr[1] ^ network_addr[2] ^ network_addr[3] ^ network_addr[4] ^ network_addr[5] ^ - network_addr[6] ^ network_addr[7] ^ network_addr[8] ^ network_addr[9] ^ network_addr[10] ^ - network_addr[11] ^ network_addr[12] ^ network_addr[13] ^ network_addr[14] ^ network_addr[15] ^ - network_addr[16]; + x = network_addr[1] ^ network_addr[2] ^ network_addr[3] ^ + network_addr[4] ^ network_addr[5] ^ network_addr[6] ^ + network_addr[7] ^ network_addr[8] ^ network_addr[9] ^ + network_addr[10] ^ network_addr[11] ^ network_addr[12] ^ + network_addr[13] ^ network_addr[14] ^ network_addr[15] ^ + network_addr[16]; return x & (NAT25_HASH_SIZE - 1); } else { From patchwork Mon Oct 17 13:23:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepak R Varma X-Patchwork-Id: 3469 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1460776wrs; Mon, 17 Oct 2022 06:56:23 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5oLijiybyKuvOlPb7vsobwA3uCTattpwv6/RNKRF5JqpgXIfqdlB2dHEMKBBfF9gpDQ9aR X-Received: by 2002:a05:6402:2683:b0:45d:3c44:dad4 with SMTP id w3-20020a056402268300b0045d3c44dad4mr10380221edd.124.1666014982870; Mon, 17 Oct 2022 06:56:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666014982; cv=none; d=google.com; s=arc-20160816; b=P81A9cVwQUKV/9urXVKB2dbjlegU161r9U/qujmd0MoFMRW22pNFnSKYnTxh2Qqc/S 9rxZ192maZDl/wCU5/TvZ61335iOOocaKfbjs7wAWqNAWHEw0IELLKi4RoRUbR2uBLsR MJDJusGUqFWX/7ij7cOsbxS8vpwthnTjn8/xH/U4anfM4XMyn3+XCBfwT6EMpnZ0pAmg jNxb4dw/soI4gcp8BahMDYD+7WTxX4HaafYZPB9phDtqEfVLI0vGcEfg3fh7HnsFEHoX 5JQ8MES9h1heA+OYXfQc+a25if+ywF4R4NQyKdbGcm/mnDh9i77J39cidqx2rVKz8ldh 7nQg== 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=vyxGBPbQa0C6c83kXkBAJY9tq5PjRPcVLHMhfrAfkuE=; b=OlcJPOHqfNQXf2kgFaYfAf200i9I8zE55A6VYlSvA36pycPA2f1/DgG+kuGwpxXhtK WTfd0NFaNM+W0SNxGUJXP+cDhvn8qErOnGWbaG3/0Ya9NDT7Ukn5MLE59iz48JE2hDN6 80gYxRnqLS1DubJVyarOZl96kdRBhk39kAICZrc0RJrNmcnzeux7wG+Pgl47RQncKZjw rV/LUXEz1mscPh+1RY9FuJb8kyC7Su9jPqefWCsvN0RGGOSKyBzpWmhb1eTMaWHNb92A MVsbJeZHi5ETicC4C/pTTWBfBznqT4+2CaLdYcCDQ6OwGCkWTHB0Eibu6isExRxaBMbR Bcew== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=V0nd46kD; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q6-20020a17090676c600b0078da414a7cesi7758214ejn.149.2022.10.17.06.55.56; Mon, 17 Oct 2022 06:56:22 -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=V0nd46kD; 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 S230149AbiJQNxZ (ORCPT + 99 others); Mon, 17 Oct 2022 09:53:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230137AbiJQNxT (ORCPT ); Mon, 17 Oct 2022 09:53:19 -0400 Received: from msg-1.mailo.com (msg-1.mailo.com [213.182.54.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5A1F2A272 for ; Mon, 17 Oct 2022 06:53:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1666014783; bh=HybS8E0BeM5WMbvxAEhVcL9Zbg+CAlIyM/FdRQVadmA=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:In-Reply-To; b=V0nd46kDfvvNQW9/BYUiNaqzLisfmayMxJ32LVhGkuWQME6HvaNwszkOY5nGfFnex 2R3rf7efqsVrSIei9H0jq6xG/cyJdtFG/RbBo+tmtLDGPUnJQHHeyD/NM2ktWD5qDs W/e50RHb6p11MoZPOxUvaHPKOGKE2L2ONJsswbfc= Received: by b-3.in.mailobj.net [192.168.90.13] with ESMTP via [213.182.55.206] Mon, 17 Oct 2022 15:53:03 +0200 (CEST) X-EA-Auth: WOVB4/nXVafQco/5wnIstFlXmW1pUWZgMbaqWNF0+qTbWPxDQEIECV7poO8kLqFZnvP2ycwsxNtRR8tRYgDBxGafyGWWdKHT Date: Mon, 17 Oct 2022 18:53:30 +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 3/4] staging: r8188eu: remove {} for single statement blocks Message-ID: <478d652b9f467d47685c1af72a876f34dd92710f.1666011479.git.drv@mailo.com> References: MIME-Version: 1.0 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746943326668366951?= X-GMAIL-MSGID: =?utf-8?q?1746943326668366951?= As per the Linux kernel coding-style guidelines, there is no need to use {} for single statement blocks. Address following checkpatch script complaint: WARNING: braces {} are not necessary for single statement blocks Signed-off-by: Deepak R Varma --- drivers/staging/r8188eu/core/rtw_br_ext.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.30.2 diff --git a/drivers/staging/r8188eu/core/rtw_br_ext.c b/drivers/staging/r8188eu/core/rtw_br_ext.c index 427da7e8ba4c..290affe50d0b 100644 --- a/drivers/staging/r8188eu/core/rtw_br_ext.c +++ b/drivers/staging/r8188eu/core/rtw_br_ext.c @@ -655,9 +655,8 @@ void *scdb_findEntry(struct adapter *priv, unsigned char *ip_addr) hash = __nat25_network_hash(network_addr); db = priv->nethash[hash]; while (db) { - if (!memcmp(db->networkAddr, network_addr, MAX_NETWORK_ADDR_LEN)) { + if (!memcmp(db->networkAddr, network_addr, MAX_NETWORK_ADDR_LEN)) return (void *)db; - } db = db->next_hash; } From patchwork Mon Oct 17 13:24:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepak R Varma X-Patchwork-Id: 3471 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1464650wrs; Mon, 17 Oct 2022 07:03:37 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7JczcyRQlzpR0LQTrrw7NBfU+RUsWBnSc0ZTF6TaPtZe4bBIOhEoPOznaUPM2xyrkOrLT1 X-Received: by 2002:a17:907:2cd9:b0:78d:9e76:be26 with SMTP id hg25-20020a1709072cd900b0078d9e76be26mr8656950ejc.315.1666015417090; Mon, 17 Oct 2022 07:03:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666015417; cv=none; d=google.com; s=arc-20160816; b=MX/SUg/1dYlhXl0USK8DHWLGr6Idm4+4ix5vJOYYmQyvE4rBUG29/GuXhb+QHshi1c LU7q0w72pODS99FBnT7EWd3SLDuP9dZ2VVnzprGtcf9gKeiGv+nZS7du4qptOWOsPEnK lHVRJ/hUP3mlNPuLrPtR9xXcrdR1zsUPvFs4d7HM+f+Pb7wfEJOjIa/IDDEk1GX9hCot DE06yyd0rmyUd6nU3BxQoo62iE99oiv/wZs2nrzD9OppsvtswkSbG9eR/X0P1EbDt9pK VdWHQEET5FkIaYcWpGnbNmufIW2l57+uVwskECAzsayIWbOF10qIpDjK41l9nq46b+Jq sYiQ== 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=z3JqR+FrwRLBd6TK7u6sxYTKEMECr2tbf/8wNirnYMI=; b=Za8tbJgeKEMN4hFxso+/8VEzLUvnqRnqisJDP9OUMw2r2KHj1+XY7X3MPCFJWvM2wO pb3Ee+oGIOFaOrFFex9g27DFrVXzx0zNp+U84UZQW4DxjRNP3pSBVZ7NnwRQTeTB59OO 4/AGKXFIUAjJmWL+P0a1/+EvgNLtDtfLtEW7egeilrpAvFUfDwK7ZtrwaY2hdBOPekww GymAsCZMYY//f3PAINx8rWcBR/nMD/2kqibSCbnsmZX2M71uzot1Z5d4YWpnrR6gA5Ww ccwT8v1S0iOINwV5rirhCWY7bON2Ht/JjC/2nLPWCCCL58zhqP71x2VONTc0nkv917fR Norg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=m12rP1zZ; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ht12-20020a170907608c00b0073da19d0cdasi9304330ejc.973.2022.10.17.07.02.06; Mon, 17 Oct 2022 07:03:37 -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=m12rP1zZ; 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 S229691AbiJQNyE (ORCPT + 99 others); Mon, 17 Oct 2022 09:54:04 -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: 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746943781955556810?= X-GMAIL-MSGID: =?utf-8?q?1746943781955556810?= 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(-) -- 2.30.2 diff --git a/drivers/staging/r8188eu/core/rtw_br_ext.c b/drivers/staging/r8188eu/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 = *((__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);