From patchwork Mon Oct 17 15:57:24 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: 3594 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1538551wrs; Mon, 17 Oct 2022 09:30:50 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7q0gEM0pMEZtE9hoEPCaKahesrdz/A2O7o+sy13dEYDZmFzTrjRP6d6XAAM/qZI45Tjt+p X-Received: by 2002:a17:907:7e9e:b0:78d:f3b0:fc78 with SMTP id qb30-20020a1709077e9e00b0078df3b0fc78mr9364844ejc.478.1666024250496; Mon, 17 Oct 2022 09:30:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666024250; cv=none; d=google.com; s=arc-20160816; b=bSNJAwC3Je0lrcTZDDE9Rh0RlARc7mnaAYlOTN9eOhp2fC+a/N3Q6anJxmlSEDL7JE UYygWL9jzzii5lWWBw2KniyVevgYkEzlMT1IGOJIpxJfS3mqGQv2KEy3bHCYj9moB5Uq RzUYP0TMsPpyK0OSi6jCA1fBLxgCGEz7cJu9kEZ9QjyjpHHirxtidIXppxPGNBpJVhR0 Uj/6uxBTBESzkw9IaYNgazfphq3AX8I5oJ66unTJ6V0sJh2m3BHQW9gyWBkr6BWg+fei KkVa8NliCai4s7JoNmCYUheaHCb3803+mlR/rOCD/TaHoF/GzIDd944O84OWIM+wYpGn X6kw== 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=jOXBxWv56SJun0yjjcGSNHAf2n681TxT0QcAMHnBg/8=; b=aFGOR3/EIaOGcjHmZx0d9tF79n+SwAz1xUp0dq2yvuZaFLdzpdER/DxAzFMiB+e5q9 VcfDI2vnlx6XlePHZOXpvIiM4fuD1TCH5eqMw+uXim0FtuZR3R1PmzZ4OikeNA0Upz2v yi1AV3mpqJQpmN1vr/KAs05O3QscK8a0aR+fet0AU/eHDpT6bWh5lJh+cu6JLmx4nmLb uvFkyvmLl3SqbbCysBFyatEjakfHDtXogyRsAGKeIA84/KwHL8pwB8+qqCwBi6aGgDs1 fY40pDOZdnE+Xy11TVomfCabNOsX9c78QnyOLx3/Nl5V2kwcKsGmYZQ1CyPB5dslyRyA Zo+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=FLIQ+Jv6; 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 fk24-20020a056402399800b0045cafc51fbfsi9582122edb.525.2022.10.17.09.30.25; Mon, 17 Oct 2022 09:30:50 -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=FLIQ+Jv6; 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 S229943AbiJQQ1O (ORCPT + 99 others); Mon, 17 Oct 2022 12:27:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229747AbiJQQ1M (ORCPT ); Mon, 17 Oct 2022 12:27:12 -0400 Received: from msg-2.mailo.com (msg-2.mailo.com [213.182.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4576A6D573 for ; Mon, 17 Oct 2022 09:27:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1666024017; bh=FMafp2VnUlBIYWBO1+8OqeP18GRVh8GYQ+34OLtL540=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:In-Reply-To; b=FLIQ+Jv6K7l0/i4v25rGrUZ9zGngATvllqhyQhSClQDtpJJsw0sV2CjnMQMlq6YOp 2k+0tIa3d6bgPbABZZ6C9BultkI1nXk/6hgACfxDZKeJ4OEB4Tl7iRjjapL+c9Ornx IDycAzzCL84NL0yhzQXL4A+wCls8y96SsfuC9DFU= Received: by b-1.in.mailobj.net [192.168.90.11] with ESMTP via [213.182.55.206] Mon, 17 Oct 2022 18:26:57 +0200 (CEST) X-EA-Auth: h+mTrog4EchL0r0jdzSVGtG2gfqaUS4O4sNE206hQ/HAsFT2NIUnkecd+IJC5kr8cr+UZJNwQci+Pd8hELparF1C/zeasDCn Date: Mon, 17 Oct 2022 21:27:24 +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 1/4] staging: r8188eu: use Linux kernel variable naming convention Message-ID: <5226d30242be78ab1ee32bfdd87239ca82569642.1666021212.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?1746953044679666347?= X-GMAIL-MSGID: =?utf-8?q?1746953044679666347?= Follow the Linux Kernel coding style variable naming convention instead of using camelCase style. Issue reported by checkpatch script for these variables: tagLen, tagType, networkAddr, ipAddr, macAddr Signed-off-by: Deepak R Varma --- Changes in v1: 1. Improve patch description per feedback from julia.lawall@inria.fr 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 15:59:06 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: 3597 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1539907wrs; Mon, 17 Oct 2022 09:33:56 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7gxDGEyGLsV+saDu2OQ3cOIPxxCFZ8rWVh8SFfkPpWRKMB470OPFTbmwSx+a8gJcizvHLR X-Received: by 2002:a17:90b:1b47:b0:20d:cdf2:c02e with SMTP id nv7-20020a17090b1b4700b0020dcdf2c02emr12557965pjb.233.1666024436551; Mon, 17 Oct 2022 09:33:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666024436; cv=none; d=google.com; s=arc-20160816; b=G17vZHLu1LtQh2jsedgJSZB1MBoumuMA0KzH60kHc8oNZBrc8MAZ/aW6BAloO49xWn bRXqAfBQcD0xtABBTPYy5GTEb6Td6NYjAoUaV9hwlQogdHOcB8oByRSeQbwzSJsJ2SfI yNCMZdF01YI8xc3+gGkGeDcmHw208ZEPI+9vB9B/yEYjzpM0z/RD2zUjwtippbuCf6xj mCdU/bvIsMGutP3BTpNEXmb1p97aDz12a1z2xJ9FppnomgjEXf3JYPLjlTxgSq/r0Pe0 wzgALXzYZzp0TiI5kMJMKjcTodPK2tgamlYQVm30IFkAG/Z7PpBJQGTzNV88dRdQ0Y4K IUew== 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=8TmGS15tDuBp81jBacmNyXZpIjvecbedRs2DsUkDMyM=; b=wGDv6MYN9AZdl/xfGuu/btSUeo5ZXLwQYCek7YrTYHquL1YTtzC4M6tRtleyl3qkQz GvMzVk0dhDIJutx9epH6V51a+VJECjkMyUnQlFsJaQZM9GiB72kcXVuOnJZN2BYo+/Ss +W5fB/qC3ofp5Pl4xdGZNMDQTv9pr9bkEaRQhSeR2NMMiQv+tCXipQVUbhd4NsN2ie19 s6PmhBYM0cb99aYoTmq7viV1dezxETyR7RbnSIsuzndD6ibE2v8Wx+0KntpXf5AYbe6r 3pqKr+DLN/uL42EvlrqZh3uS3dAEYhYnXnpcylbY1ZJjGViAyKUWR0zLOaFY+NryqDPz mRZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=MtZwnz9O; 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 y31-20020a056a00181f00b00562a1693523si12502604pfa.20.2022.10.17.09.33.43; Mon, 17 Oct 2022 09:33:56 -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=MtZwnz9O; 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 S229673AbiJQQ24 (ORCPT + 99 others); Mon, 17 Oct 2022 12:28:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229747AbiJQQ2y (ORCPT ); Mon, 17 Oct 2022 12:28:54 -0400 Received: from msg-2.mailo.com (msg-2.mailo.com [213.182.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA1EF6EF29 for ; Mon, 17 Oct 2022 09:28:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1666024120; bh=QfjybwoxOuA8i9Q0zqRIu7a6CZS8N+C1Jz7hm5aM5II=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:In-Reply-To; b=MtZwnz9Oqzh0Nl5gD3BKivB8gyTCYZAg82dY6ouZEuVUE8eGAismFYzgANBhbLHzz pf2T7/3MMsVko3Zdbbmewj6+95iFI3ZZoyUP2syxVRAax/fq8wOOQzMBOD9sX1fThC kr5xmeWZT92A7pMAZyWK2Z/c9TrrYW7DNlpZScmo= Received: by b-3.in.mailobj.net [192.168.90.13] with ESMTP via [213.182.55.206] Mon, 17 Oct 2022 18:28:40 +0200 (CEST) X-EA-Auth: KENaI594nP0uTNiflLgkiiBWvfB5TWZJGLFdmlgJguIsJVOeAV6lv1JUFm9TthsRwtJKj2x7X9z4ZR2twbV+YnfNtjW//BZC Date: Mon, 17 Oct 2022 21:29:06 +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 2/4] staging: r8188eu: reformat long computation lines Message-ID: <5c3c0ef7c90ab2eec73067e1dd88f337932363e3.1666021212.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?1746953239606588180?= X-GMAIL-MSGID: =?utf-8?q?1746953239606588180?= Reformat long running computation instructions to improve code readability. Address checkpatch script complaints like: CHECK: line length of 171 exceeds 100 columns Signed-off-by: Deepak R Varma --- Changes in v1: 1. Further improve the formatting per feedback from gregkh@linuxfoundation.org drivers/staging/r8188eu/core/rtw_br_ext.c | 17 ++++++++++------- 1 file changed, 10 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..8b1c9fdf6ed2 100644 --- a/drivers/staging/r8188eu/core/rtw_br_ext.c +++ b/drivers/staging/r8188eu/core/rtw_br_ext.c @@ -211,8 +211,9 @@ 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 +225,18 @@ 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 16:00:18 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: 3596 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1539659wrs; Mon, 17 Oct 2022 09:33:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7p8Xt1ACARUAyS3tskl0N0rudTr5RtenN4UBfVrZPWc+ZRc1OT4S0Qkk8lHgZ/Sa6pUUnd X-Received: by 2002:a17:906:4795:b0:787:434f:d754 with SMTP id cw21-20020a170906479500b00787434fd754mr9734190ejc.268.1666024406005; Mon, 17 Oct 2022 09:33:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666024405; cv=none; d=google.com; s=arc-20160816; b=QhHSyt0s7ImE1MxVPcNcJ8OqvlrKandzCJqFtl/QyEpysC8aFs2mJKlEJLE5uwR1We 0a01FjdMBJnnAXddzqn+E+d6QGGDGoVvxH0pnuW0ndT9gFqW6l3BW1zwmJxIhPMOv2qQ /FfGYMjHhDR4EwJvOIAk7AeH1w9sF9h8N7tDVJjyO/lujdrmNL1NuAedRTNM66+sUGwu Z6UhpMxWp2DXH1PUTXJ4kChSM9qIpWDrpU6a2+MDCCl3igNUQBX4aFtk44diGnSNVNzu 9uQVqJ5PXLu/+VQjUELnP1mmrU1vNzi4GHeNmO0isYwYyAaL8cH8qkFdSaEKr6O8Ws7H 9AAg== 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=qtNDIKZVX7h3y2xN17tCzKNIbXdnRf7L1+OzTTKy9DY=; b=JK4hiRNvQ3seZHawB9pthHl/fxjSRySKqawnAlC+5HykDrC56y9xEmxQK9jGVCmDcw kJdEzVZEYVjS6ynemKrskEJettC47D4mIZTwdJVkbCmTUruzF4uGeCUlqPjAbrwQUppL 9GKXaTaeZslD1dWxQ8QJfQD3M3mDpo7Xh5oTLfDeoyZlcCSD7HJlU+FaecZI41rxvFWw ehOEgaAPnL4+ZnDwiU4Cd/8hGWp1C3sDjQ90rPHeZC6v5nduOkG7XRAtemA3QhKrf0GK 9/BOOpoyquAyLKJlaosnZhi1uwggErEATw7jG9zTGtHPj/k+5+pAauzlcoJJGA+IyDrh rThQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b="X3GBj/hs"; 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 qk30-20020a1709077f9e00b0077a19529760si9663253ejc.65.2022.10.17.09.32.59; Mon, 17 Oct 2022 09:33:25 -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="X3GBj/hs"; 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 S230023AbiJQQaP (ORCPT + 99 others); Mon, 17 Oct 2022 12:30:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230055AbiJQQaL (ORCPT ); Mon, 17 Oct 2022 12:30:11 -0400 Received: from msg-4.mailo.com (msg-4.mailo.com [213.182.54.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98E5F2A407 for ; Mon, 17 Oct 2022 09:30:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1666024192; bh=fganXA/Ib74G11n9cn4dTun4KYkeNaJm90T7a6DzvNM=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:In-Reply-To; b=X3GBj/hsJoB5GrLxm6Q6RVSbtFWYQLofETxY8xZc55VjXJAQjZ6zKopNe3boxq9Bw GO6G68gyx9ncBv2GfhkLgBRzPxB+IDgGVvlApPbdyGjvC1ZEBb88VB/sIfKzqpom5h O1nCPDaHlVEx7JV/QVBcijmh+8cX6HG9V2REU4a0= Received: by b-5.in.mailobj.net [192.168.90.15] with ESMTP via [213.182.55.206] Mon, 17 Oct 2022 18:29:51 +0200 (CEST) X-EA-Auth: YWyD0nVSL0P3+zGMZFq0atI3dki1uT2baqE//vLDdgL2ZSqEGNhsT4WpiLpZP9dmU5qdMr8CKLjjH122aYGJpVO+QctXlddP Date: Mon, 17 Oct 2022 21:30:18 +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 3/4] staging: r8188eu: remove {} for single statement blocks Message-ID: <0e18149144533a749e30d97b0051cff384016cf1.1666021212.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?1746953207276559939?= X-GMAIL-MSGID: =?utf-8?q?1746953207276559939?= As per the Linux kernel coding-style guidelines, there is no need to use {} for single statement blocks. Issue flagged by checkpatch script. Signed-off-by: Deepak R Varma --- Changes in v1: 1. Improve patch description language to make it simpler. Feedback received from julia.lawall@inria.fr 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 8b1c9fdf6ed2..14797c2d6d76 100644 --- a/drivers/staging/r8188eu/core/rtw_br_ext.c +++ b/drivers/staging/r8188eu/core/rtw_br_ext.c @@ -652,9 +652,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 16:02:17 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: 3598 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1543754wrs; Mon, 17 Oct 2022 09:43:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7KfD1M5XgseYtHQnHFDDGZtpUXErElLldor1ojSHkDm7J4Ge9k8BW7WECwQ79Ns/cTfD9C X-Received: by 2002:a17:902:e88a:b0:183:9ecb:ff85 with SMTP id w10-20020a170902e88a00b001839ecbff85mr12775095plg.169.1666025012319; Mon, 17 Oct 2022 09:43:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666025012; cv=none; d=google.com; s=arc-20160816; b=JXkbOGuaAu6DOsU6WI3gVsloWRHYXx1gVh6kjV26yOqSxbqrpcgE8jeFFnX0FPe4RB qheVA6KQ7pp+Ic9EyT3QJfASgoDecjH7eZhvbbCYiYgOOiS2q+JFQLTwSlf7ZxMym16d Kq+hyJOsM/AhNQaN2ihcfMi1xBYB7AkK/bEgupMkalB5VdRZZsESwRoC0CYZ6lQrXigx Cb4VaEkO1Gwp8DcB1OA5D6HfdFVKqibKXaetvEY1Pei1AtXyAgshzNGKekzBIGKlhHaw yvRvgUN3EQAPcd3+xVqapSOqFpVMiLVuRphx39kPiL8ZAuTJLEu5MLgZcsMKsUH3EnVd Fafw== 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 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.17; Mon, 17 Oct 2022 09:43:32 -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-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?1746953843577224051?= X-GMAIL-MSGID: =?utf-8?q?1746953843577224051?= 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(-) -- 2.30.2 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);