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.2 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED, USER_AGENT_MUTT autolearn=ham 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 ED7F6C43381 for ; Tue, 26 Mar 2019 13:19:14 +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 BD68E20856 for ; Tue, 26 Mar 2019 13:19:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="EFfK+HrB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BD68E20856 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.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=Dz1dYu8vuoSylYyL3RApSOBUyQW9kvg30XuqdiGvdHI=; b=EFfK+HrBSMxtaX XJqQmo4I22zXBzcf+vx51QlHnb0tFknEmqK7Fus81lWEpnoNRhjIQEazIQa0ykUrLa6PA31Ov9n38 qVruAIoEQXFf7tg/aKl5AvY8B3GlJ+8gSAffW1X67/1Lv5A+dIfi3tpoESp4WCY1LwnPUCALiOzOj dKfD70v1u+pg2D83F1Nx72CWRT57BRBqZdn+Hnz+dKGnaga9g3dUlLnBybXW88Z4Bo7x6qyzCcEGa a36CO5vRC6nxv1mRY0XxHSS+kiCw8E1F4mDUv74Ee3O6VSMGg87Fe/QCY38TWcgbb2TVA4fpj/Gx0 CPHvRELTgf8G1SWHlCew==; 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 1h8lyr-0005Pw-Kz; Tue, 26 Mar 2019 13:19:05 +0000 Received: from mga17.intel.com ([192.55.52.151]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h8lyo-0005PQ-UM for linux-arm-kernel@lists.infradead.org; Tue, 26 Mar 2019 13:19:04 +0000 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Mar 2019 06:19:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,271,1549958400"; d="scan'208";a="145350476" Received: from smile.fi.intel.com (HELO smile) ([10.237.72.86]) by orsmga002.jf.intel.com with ESMTP; 26 Mar 2019 06:18:56 -0700 Received: from andy by smile with local (Exim 4.92) (envelope-from ) id 1h8lyg-0003Gt-Sm; Tue, 26 Mar 2019 15:18:54 +0200 Date: Tue, 26 Mar 2019 15:18:54 +0200 From: Andy Shevchenko To: Lukas Wunner Subject: Re: [PATCH v12 01/11] bitops: Introduce the for_each_set_clump8 macro Message-ID: <20190326131854.GA9224@smile.fi.intel.com> References: <20190326102843.GA10264@icarus> <20190326100743.GA10005@icarus> <20190326130319.cwn5zl4e222zh6ak@wunner.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190326130319.cwn5zl4e222zh6ak@wunner.de> 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_061902_992302_26C5A35C X-CRM114-Status: GOOD ( 11.01 ) 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, William Breathitt Gray , 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 02:03:19PM +0100, Lukas Wunner wrote: > On Tue, Mar 26, 2019 at 07:08:18PM +0900, William Breathitt Gray wrote: > > On Tue, Mar 26, 2019 at 10:43:45AM +0100, Lukas Wunner wrote: > > In this case, bitmap_get_value8 could be simplified to something like > > this: > > > > index = BIT_WORD(start); > > offset = start % BITS_PER_LONG; > > return (bitmap[index] >> offset) & 0xFF; > > Hm, shouldn't that be "offset = round_down(start, 8)" ? No, the index points to the word, the offset points to the offset inside word. > (I prefer the multi-line version FWIW.) +1 here. > > Would it be better to define bitmap_get_value8 as a macro then? > > Or a static inline. Please, no macro. It disadvantages in terms of type checking. -- 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