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=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no 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 E55A6ECE58D for ; Wed, 9 Oct 2019 21:19:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B6C0721A4A for ; Wed, 9 Oct 2019 21:19:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570655942; bh=J/UoD8TI8r2PBv1hXoDAUnvePVV2cHTJo4SSSOlvQS8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-ID:From; b=DHm1WXDX6T+SlP+Wt/MEdqhwOWq7AUr3WNuhrlZT41zuASWlZXO9V5nKcOMvIBNIy o7ID/bUX8/cyyl6KZfPyraigeW69dARoOHdTiblh9kqPyT6F1ZGcf2UaPF7JbGaarG wFK/Zcnomkq/+QlHWdg2ElMfYrBQPbH8MbnPZar8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731792AbfJIVS7 (ORCPT ); Wed, 9 Oct 2019 17:18:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:42472 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729535AbfJIVS6 (ORCPT ); Wed, 9 Oct 2019 17:18:58 -0400 Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2C7C420B7C; Wed, 9 Oct 2019 21:18:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570655936; bh=J/UoD8TI8r2PBv1hXoDAUnvePVV2cHTJo4SSSOlvQS8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=CJOqXT1XwlBfVttI7DYPGvW2Jevkihy44Tves3loSgg+2No5LLHJwR5E2VQLHHex7 ayk23kjS13Kei0/AcZ6eZn/SKW03QpiTYpeZtE1NPQ4lSiYLuWei96qaa2o4pq9AD7 vzOEBBXiawhBVDCShGgzDBq1ExUBLHM5C8PDVpts= Date: Wed, 9 Oct 2019 14:18:55 -0700 From: Andrew Morton To: William Breathitt Gray Cc: linus.walleij@linaro.org, bgolaszewski@baylibre.com, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, andriy.shevchenko@linux.intel.com, linux@rasmusvillemoes.dk, yamada.masahiro@socionext.com, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, geert@linux-m68k.org, preid@electromag.com.au, lukas@wunner.de, Andy Shevchenko , Arnd Bergmann Subject: Re: [PATCH v18 01/14] bitops: Introduce the for_each_set_clump8 macro Message-Id: <20191009141855.310f1fa8bde58df0df27b8f0@linux-foundation.org> In-Reply-To: <893c3b4f03266c9496137cc98ac2b1bd27f92c73.1570641097.git.vilhelm.gray@gmail.com> References: <893c3b4f03266c9496137cc98ac2b1bd27f92c73.1570641097.git.vilhelm.gray@gmail.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 9 Oct 2019 13:14:37 -0400 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. > > ... > > +#define for_each_set_clump8(start, clump, bits, size) \ > + for ((start) = find_first_clump8(&(clump), (bits), (size)); \ > + (start) < (size); \ > + (start) = find_next_clump8(&(clump), (bits), (size), (start) + 8)) > + It wouldn't hurt to give this some documentation. In kerneldoc form, I guess.