From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3187C4360F for ; Tue, 26 Mar 2019 11:43:13 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7669B2075D for ; Tue, 26 Mar 2019 11:43:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="X9I852y1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7669B2075D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=TNJVbILjTFv6/p9l2fviQidsNR7MdP/Cr4KkrbqXY10=; b=X9I852y1peV7cu 5hPkoMTHNI5U3NTRl6dIp6mEJT5hSfDQHEV/vQ3gIHi2obv7smttsMyjt639fTyH8w4Uz6jR0/afa xqw0TSk9fFfjhBstvL3q4AFlAsUqSnKLTTHo6XwTLqM4QlP26qO81AY7U2sGdYdJV/PwpvKACzmiJ SgiIKvyx0HCC89BzynQNn0d4RhVUMbY89vXLXS4ODZ4FgywfKPFu+JKKsmgL498SPdpe5JBxe8smf /o1lo+AI06FBpfqdSQNh+NEmBpd+cJyZ6S8sDm2MLBu9SkVbNRvKAShJ+dsvbfOnmdz7w1e/L0+38 VS2IdMFVcbkde0OuUjHQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h8kTx-0006ma-CB; Tue, 26 Mar 2019 11:43:05 +0000 Received: from mga01.intel.com ([192.55.52.88]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h8kTr-0006lV-VY for linux-arm-kernel@lists.infradead.org; Tue, 26 Mar 2019 11:43:03 +0000 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Mar 2019 04:42:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,271,1549958400"; d="scan'208";a="155297237" Received: from smile.fi.intel.com (HELO smile) ([10.237.72.86]) by fmsmga002.fm.intel.com with ESMTP; 26 Mar 2019 04:42:53 -0700 Received: from andy by smile with local (Exim 4.92) (envelope-from ) id 1h8kTk-0002Cj-79; Tue, 26 Mar 2019 13:42:52 +0200 Date: Tue, 26 Mar 2019 13:42:52 +0200 From: Andy Shevchenko To: William Breathitt Gray Subject: Re: [PATCH v12 01/11] bitops: Introduce the for_each_set_clump8 macro Message-ID: <20190326114252.GX9224@smile.fi.intel.com> References: <9afc30a574ce3e6a86b51dd522146a1d2156dedd.1553494625.git.vilhelm.gray@gmail.com> <20190325131236.GW9224@smile.fi.intel.com> <20190326025459.GA3356@icarus> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190326025459.GA3356@icarus> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190326_044300_028677_073F0E74 X-CRM114-Status: GOOD ( 21.91 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, Arnd Bergmann , linux-gpio@vger.kernel.org, yamada.masahiro@socionext.com, linus.walleij@linaro.org, linux-pm@vger.kernel.org, linux@rasmusvillemoes.dk, linux-kernel@vger.kernel.org, bgolaszewski@baylibre.com, geert@linux-m68k.org, akpm@linux-foundation.org, preid@electromag.com.au, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Mar 26, 2019 at 11:54:59AM +0900, William Breathitt Gray wrote: > On Mon, Mar 25, 2019 at 03:12:36PM +0200, Andy Shevchenko wrote: > > On Mon, Mar 25, 2019 at 03:22:23PM +0900, William Breathitt Gray wrote: > > > This macro iterates for each 8-bit group of bits (clump) with set bits, > > > within a bitmap memory region. For each iteration, "start" is set to the > > > bit offset of the found clump, while the respective clump value is > > > stored to the location pointed by "clump". Additionally, the > > > bitmap_get_value8 and bitmap_set_value8 functions are introduced to > > > respectively get and set an 8-bit value in a bitmap memory region. > > > > > > This seems to miss Randy's (IIRC) comment about too many const specifiers. > > I disagree with removing the const qualifiers; I believe they are useful > and do not significantly impact the clarity of the code (in fact, I'd > argue the opposite). Had you checked the assembly? I'm talking about const for values on the stack. I think if you put less const there compiler can keep something in the registers instead of using direct constants or accessing stack. I might be mistaken, so, I can't argue without evidence of either. > The const qualifiers make it clear these values are > constant, allowing readers at a glace to know these values never change > within this function. Although I believe GCC is smart enough in this > case to deduce implicitly that these are constant values, generally > speaking const qualifiers do make it easier for compilers to optimize > sections of code (OoO execution, algorithm simplification, etc.), so I > believe it's useful in a technical sense as well. Again, what the difference do you see in assembly if any? > I added the const qualifier to these variables because they really are > constant, and I believe there is merit in making it explicit in the > code. If the primary reason for removing the const qualifiers is for > aesthetics, then I must dissent with that decision. The point is, if there is no difference, I would prefer one which will be better to read, otherwise check the assembly. > However, it is difficult to read the definitions that wrap around to a > second line. These definitions are long enough that even removing the > const qualifiers would not help prevent the wrapping, so perhaps it > would make to let these stay on a single line. Do you think it would > help to ignore the 80-character maximum line width coding style rule for > these cases here? 80-characters rule can be slightly bended depending on the context. Here, I think, we might continue discussing the matter after having an evidence how const qualifiers affect the code. -- With Best Regards, Andy Shevchenko _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel