Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp1792834imc; Tue, 12 Mar 2019 00:15:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqz6xCfb1E9/GcLVoWPNxzyTqEh8y+WG91yIURjK2mkxyyNPS2pEjG3/EDx0O6XmsggyNiZm X-Received: by 2002:a63:1a12:: with SMTP id a18mr13486134pga.200.1552374914754; Tue, 12 Mar 2019 00:15:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552374914; cv=none; d=google.com; s=arc-20160816; b=woO5eDcgOGxjRwC9iFOtb+M1JEiOcPB6KvtmlNrSKHKVif/T0sgct0LP+/gx9c3SwL UlpE1EKh/cYydECx1oI8JugEgTKTcdZfJEUNpkB65TeIunWGhHG4AaCdYoiVJL0UlifU ZD1ejZqk2kDWO2jom79qv5DGzsOnkvXnUaStKqsoBkWoqxQHCn0g54W9LmEmQwbFGWtB nufBBq0td8nAKblL1/hWi8X3awvpzXv7pRR2zVyQcOt8j0ZSLgQzI57FXMvQQCbxum29 q0jAx4N7TO0WFFEnwJPpql+77cbB3heMMdtCdkz1AWS7kzpKqBSKZpl4tNbv2OUsE00Q VwfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=40K4bEwW49mdO0g97HTNb3yDTTIDRWnyercG8bXT2Zg=; b=XXMFMu78hCYoqhMaoUlpYiqqzZYf2kMInAL2D7aFNdzWhu0BuiNKQuN/TUACV4CW0W bOQuF2mPNtI6pBizpMlK90lCdyLjpkKBJfpoYCU7LzLKb2RokUZqoO8KX98uRSNRTptd U/UOudsHo9rkB/+aKScFIiYBRol1DfQknWLsSnAhE+ue3NFLnp6Xe6ln89cFkRqCn+bX 33066whDNYaA57xk5mfFySyWf5GzfY157ruvOE6503gZB9BlQOvB0fAtPjppd8ekW13P geEUxyhH1SXbnWPTpH8ZVFGTKCOBrjlXkM3FfO5dgW4BPHnd70pmgwjwzXNAzH6JjSci tAMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pwpmmOsQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b11si6902075pgk.77.2019.03.12.00.14.58; Tue, 12 Mar 2019 00:15:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pwpmmOsQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727107AbfCLHO1 (ORCPT + 99 others); Tue, 12 Mar 2019 03:14:27 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:34150 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726463AbfCLHO1 (ORCPT ); Tue, 12 Mar 2019 03:14:27 -0400 Received: by mail-pg1-f195.google.com with SMTP id v12so1150641pgq.1; Tue, 12 Mar 2019 00:14:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=40K4bEwW49mdO0g97HTNb3yDTTIDRWnyercG8bXT2Zg=; b=pwpmmOsQpLeKrDxKGoXgW0T6FL4Frp/C4vyN7ZTOmD/xlaw/hYhkQnUsl+a7f0hp5y Rq3eN7rDP2ZCGRTcaz5KBDV6uCLi85uqJu+2tXNSIrIzxNo3kZR3T237m6NfDbHa/PpU xVHDXIA6Fx+/6HYuJbcHCX3TmKHULicITZD53aQo9Bwud9nTug90hNnUOIgtRUdgzEri Og32pvRveIHoRIdABrk6nCeU92eX1ICAONIIAQa3LmV06hkXS/glwuqEgDg59b6jk7N7 MYIgGJoL/cDvq57O+JZZUQmX/yef3zlx39XAmhJmUWqWNhrdr1MDWDncl7EveollSsFa evyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=40K4bEwW49mdO0g97HTNb3yDTTIDRWnyercG8bXT2Zg=; b=RFH9yzNkMg8P1LrkM6OGiIObeFvGwVWVY2ZqrHO1XNzl8naF9prORTnDvZHkJwR4W0 fCmxSuVyqmfJCwqEfEJxgBCn7B68Pg7niSnbLsjgzki4jSx67nIiQm5WH27bjKcf4KVx rLtSwyJXmFtqeK1F1NFwNoTd7C2iDFe3ZOzvCEI5UzXGRUJvWu2EaevPjx/7U6ZRSdC0 zmChPjhtYNd59kodR1J2WqS1JXRXrNErzMgAkBHmkG6O4ZbGs1G9gVPTQ8+fen/IiIfy KbHRDm956e0RJNAvfhbxqIlTlvB2ADVZA+I765Pua6TwvA2Jq1qRJHrRixF0mvRqAwTQ 0MTQ== X-Gm-Message-State: APjAAAXAenCuD0CnNxHDC+QKgxehXA9mrwNX30lhgC2ig4B7EKlsI3w6 Neyv08+X6QBvmxQB9SZ/6uLZQ5mrk6nxpVQWj4k= X-Received: by 2002:a17:902:a40d:: with SMTP id p13mr37116602plq.144.1552374866349; Tue, 12 Mar 2019 00:14:26 -0700 (PDT) MIME-Version: 1.0 References: <12b3a364ac7fc32194fa6f55911dd800aca92a56.1551598603.git.vilhelm.gray@gmail.com> In-Reply-To: From: Andy Shevchenko Date: Tue, 12 Mar 2019 09:14:14 +0200 Message-ID: Subject: Re: [PATCH v9 1/9] bitops: Introduce the for_each_set_clump8 macro To: Masahiro Yamada Cc: William Breathitt Gray , Linus Walleij , Andrew Morton , "open list:GPIO SUBSYSTEM" , linux-arch , Linux Kernel Mailing List , Andy Shevchenko , Rasmus Villemoes , Bartosz Golaszewski , linux-arm-kernel , Arnd Bergmann Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 12, 2019 at 7:04 AM Masahiro Yamada wrote: > On Sun, Mar 3, 2019 at 4:48 PM 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. > > +/** > > + * bitmap_get_value8 - get an 8-bit value within a memory region > > + * @bitmap: address to the bitmap memory region > > + * @size: bitmap size in number of bits > > + * @start: bit offset of the 8-bit value > > + * > > + * Returns the 8-bit value located at the @start bit offset within the @bitmap > > + * memory region. > > + */ > > +unsigned long bitmap_get_value8(const unsigned long *const bitmap, > > + const unsigned int size, > > + const unsigned int start) > > > The comment says this function returns '8-bit value'. > > The return type should be 'u8' instead of 'unsigned long', then. > > Same for other helpers. This is done in a way to be consistent with the rest of bitmap API. None of them returns boolean, for example, for single bit. -- With Best Regards, Andy Shevchenko