Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp593748rwi; Tue, 18 Oct 2022 23:42:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6vNRoH0FoyK78ZZe6/cW2wZdwjhlldZsUhS/CzrNWgExn3FEha18IzQTrQY5GKGW5qiLjW X-Received: by 2002:a17:906:d555:b0:78d:ce55:23af with SMTP id cr21-20020a170906d55500b0078dce5523afmr5222890ejc.524.1666161759804; Tue, 18 Oct 2022 23:42:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666161759; cv=none; d=google.com; s=arc-20160816; b=t0eXjeLmvYtO2c4Ezq/hMsHktFdbACxbDVXJM1D32uGfGmLXVq1EuT8svfmmg+SSg/ yoQ0ywwlsdNCXWsiUYTon2SbI2/Pwe6orS2mGyhHgKB+Bt3u0QM8mvLkPUW03K1r8eFG Upxvc/Hxx3Ojxo23gZC6fmrf+uTcOA6BeXd4yzsXGL1Zk5XhFMKgsPcOVbAAcN2upn4S ipOXYmg98blFBDT4OebD0kFsEkQjFEoJCUq8kejjcaFOxWLKPv7r1L0/cLf/PS4fk983 5No3nwsn/fxNI4iF7fqeGUCRTuAh+EuUZvPsHk5BQoz93C0C9UU56OHPg2OmvBfc3qvA Zd+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id; bh=AiBU3J4qAlNnarGyO1ahXFzwye3NtEUAt2Q5QjBT6ck=; b=Lkp5W65GjsRK60j1SmD0+iugZzxEU7bzHoQpVDgh24UwEezxdWBzCL7wGJhm5xWi5s tr8QDHiuMM98hL4DqYpDKWVQcpcL4jsqMahDdAA9zvwxFrZUEgcDxvfcSQylwWRcUeFK sZdJkSyZeHDIEFFOsr8dB91NQ8+nJkiJtKOzusT6ESi4T1/jxl2bF6mVHeifSLIUQo/X EtRj7Yc9g/UYHselDVyENYr9OyooQIhjViQMvnakOWBV6x3oBw2nHcSaCOGU/c6H2pwl L0XO6amCBT260ftFHoNazchqEio9I/cCKSPZn/CTSkRZeVjihg0/dULBdiR7nlh2y/NE +Cjg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v6-20020a1709061dc600b0078e1a6fbe15si12085731ejh.690.2022.10.18.23.42.14; Tue, 18 Oct 2022 23:42:39 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229803AbiJSGic convert rfc822-to-8bit (ORCPT + 99 others); Wed, 19 Oct 2022 02:38:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229525AbiJSGib (ORCPT ); Wed, 19 Oct 2022 02:38:31 -0400 Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C86D6BD4A for ; Tue, 18 Oct 2022 23:38:30 -0700 (PDT) Received: from omf02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 0B1B4C08CB; Wed, 19 Oct 2022 06:38:28 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf02.hostedemail.com (Postfix) with ESMTPA id 470438000D; Wed, 19 Oct 2022 06:38:24 +0000 (UTC) Message-ID: <3ce9206fc3b756e72ee4dcfbbad6cefae5fedada.camel@perches.com> Subject: Re: [PATCH 2/4] staging: r8188eu: reformat long computation lines From: Joe Perches To: Deepak R Varma Cc: David Laight , 'Greg KH' , "outreachy@lists.linux.dev" , "Larry.Finger@lwfinger.net" , "phil@philpotter.co.uk" , "paskripkin@gmail.com" , "linux-staging@lists.linux.dev" , "linux-kernel@vger.kernel.org" , "kumarpraveen@linux.microsoft.com" , "saurabh.truth@gmail.com" Date: Tue, 18 Oct 2022 23:38:22 -0700 In-Reply-To: References: <2dd27eff9aab5ffe31e61086c0584982794507cf.1666011479.git.drv@mailo.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8BIT User-Agent: Evolution 3.44.4 (3.44.4-2.fc36) MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_NONE,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Stat-Signature: qrp556xabu4rcgk3uzc5qu1f6emj8yp5 X-Rspamd-Server: rspamout06 X-Rspamd-Queue-Id: 470438000D X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX1/g0+7RQbC87mJXozGXiKxUhZ8kAexcSYs= X-HE-Tag: 1666161504-437654 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 On Wed, 2022-10-19 at 11:47 +0530, Deepak R Varma wrote: > On Tue, Oct 18, 2022 at 10:43:07PM -0700, Joe Perches wrote: > > On Tue, 2022-10-18 at 18:12 +0530, Deepak R Varma wrote: > > > On Tue, Oct 18, 2022 at 11:21:26AM +0000, David Laight wrote: > > > > From: Greg KH > > > > > Sent: 17 October 2022 15:10 > > > > > > > > > > On Mon, Oct 17, 2022 at 06:52:50PM +0530, Deepak R Varma wrote: > > > > > > 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 > > [] > > > > > > diff --git 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] ^ > > > > > > > > > > Why not go out to [4] here and then you are one line shorter? > > > > > > > > and/or use a shorter variable name.... > > > Hi David, > > > I have already re-submitted the patch set with 4 in line arrangement. Do you > > > still suggest using shorter variable names? > > > > Assuming this code is not performance sensitive, I suggest not just > > molifying checkpatch but perhaps improving the code by adding a helper > > function something like: > > > > u8 xor_array_u8(u8 *x, size_t len) > > { > > size_t i; > > u8 xor = x[0]; > > > > for (i = 1; i < len; i++) > > xor ^= x[i]; > > > > return xor; > > } > > > > so for instance this could be: > > > > x = xor_array_u8(&network_addr[1], 10); > > > > Hi Joe, > Great suggestion. Thank you. > Is there a way to confirm that this improvement won't impact performance? Will I > need any specific hardware / device to run tests? I suggest reading the code to see if the uses are in some fast path.