Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp623830rwi; Wed, 19 Oct 2022 00:15:51 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4BtqQqoqeXIDM3MUtN77bhsADT8bBYjqidxXpnaknw6iqh/Mrny1FbZyqNkXrSKezzqJAI X-Received: by 2002:a17:902:968f:b0:180:a7ff:78ba with SMTP id n15-20020a170902968f00b00180a7ff78bamr7228446plp.87.1666163751363; Wed, 19 Oct 2022 00:15:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666163751; cv=none; d=google.com; s=arc-20160816; b=0oT3goc84ZymwFglRGQ1A65s0Ao19+dbhET3T+EJocMHW49BPuyV5/RAq8QYISqvcM 4gAhPaNKzfmL6WQjdNqBwtPg4/nZjmovMCQ76n9+7rW6Dh1GJlGdgpP1aOH4PdsbAL7i 4SsoEO3PlV/kawjczNOsOjKEe3srlFmXWBN6EZ2N5NnwSugXAlNJC1/Hkkb6FPgQVLMj S41ajCaD3Valh0WGoJZB1UpbBKB01+Flx0tSTfPnQPFhMM/ZoGGG8013xcVna9Akgk4z lKxEjKD7/me6fmVWnoiaDmXdTgJzxjJSLpll3dzNicCG73CVNtunXdo6yECwZUEcsxX7 RgkA== 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=b2JFfiuNz273JgibqL7QFS9r7Wor4nZhKMKAj6qUoaU=; b=pdQN3FgoL4y7HOJO+HhIfEYsK8wqdu6FjAvYXyX5erJuh2HrFSl5Y91+iJKp8GAQfz ImiAorMSpl3bT4OLw3W7xUDJ64BPY6rSNLJ/BWqbnroRwx8UGqRbWq0GYHZcamlAMlOJ 45GmzVfWKzrS8M7X+VEWRZpEcaHiLQGoC/heGiU+QtBqYqnaCbCbhGWVrCSpiz9GAiCW qQ0l4rqttmYWa0UjMkwBQlrA7JzGrjEIhKFD/ftIZb4rx9fN51YP9qMrGhHtd3fOA9jw PhBKJwwCLRUWPmtHBELqy6wV9L/MmASM0NtBjZmmggSQwf9RNPXbzlByVNRpTqDaMpoD ly6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=ZEKzQtQi; 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 c12-20020a170903234c00b0017f792fe3edsi19239663plh.266.2022.10.19.00.15.25; Wed, 19 Oct 2022 00:15:51 -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=ZEKzQtQi; 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 S230048AbiJSGSy (ORCPT + 99 others); Wed, 19 Oct 2022 02:18:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229974AbiJSGSs (ORCPT ); Wed, 19 Oct 2022 02:18:48 -0400 Received: from msg-4.mailo.com (msg-4.mailo.com [213.182.54.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E845160692 for ; Tue, 18 Oct 2022 23:18:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1666160304; bh=YbLPat8J0sv9JZGjSblbFVJ+rO4BjaubVhSl47kEYgk=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:In-Reply-To; b=ZEKzQtQijlP0oqAXCjJ4PPzc1BfNripd13Q65ScDUb7d/bf7uwI20X4I1tuCKyASI B4bPrCM9mjEk8ift2nLI185LoJuPYAKyx95uPBiKGtXyI2V6+Ou2dmnCxRPd4QgBuS ApJJ9xdRuUQvj5g4xGu2rGbxGRlR/JD14VyBfTXg= Received: by b-3.in.mailobj.net [192.168.90.13] with ESMTP via [213.182.55.206] Wed, 19 Oct 2022 08:18:24 +0200 (CEST) X-EA-Auth: Wnt76GkYE7oBjEfWKFffasmEQoQXsxWb+aPQJaAnykgGblPqMt8dR2Frqz6dB9sUZWD/OFkR90CbXqk0KqTfncnpigrgbUE9 Date: Wed, 19 Oct 2022 11:47:04 +0530 From: Deepak R Varma To: Joe Perches 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" Subject: Re: [PATCH 2/4] staging: r8188eu: reformat long computation lines Message-ID: References: <2dd27eff9aab5ffe31e61086c0584982794507cf.1666011479.git.drv@mailo.com> 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 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? ./drv