From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Shevchenko Subject: Re: [PATCH v10 00/10] Introduce the for_each_set_clump8 macro Date: Sun, 24 Mar 2019 14:08:29 +0200 Message-ID: References: <20190322191202.GC9224@smile.fi.intel.com> <20190324040704.GA8285@icarus> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: In-Reply-To: <20190324040704.GA8285@icarus> Sender: linux-kernel-owner@vger.kernel.org To: William Breathitt Gray Cc: Andy Shevchenko , Geert Uytterhoeven , Phil Reid , Linus Walleij , Andrew Morton , "open list:GPIO SUBSYSTEM" , Linux-Arch , Linux Kernel Mailing List , Rasmus Villemoes , Masahiro Yamada , Bartosz Golaszewski , linux-arm Mailing List List-Id: linux-gpio@vger.kernel.org On Sun, Mar 24, 2019 at 6:12 AM William Breathitt Gray wrote: > > On Fri, Mar 22, 2019 at 09:12:02PM +0200, Andy Shevchenko wrote: > > On Thu, Mar 14, 2019 at 09:29:32PM +0900, William Breathitt Gray wrote: > > > Changes in v10: > > > - Fix off-by-one error in bitmap initialization in the > > > test_for_each_set_clump8 function > > > - Fix typos in clump_exp array definition in test_bitmap.c ("0x28" > > > should have been "0x38") > > > - Utilize for_each_set_clump8 macro in intel_soc_dts_iosf.c > > > > One more, can you look at gen_74x164_set_multiple() ? It seems a candidate as > > well, if I'm not mistaken. > > We can utilize the for_each_set_clump8 macro in the > gen_74x164_set_multiple function, but I skipped over it earlier since I > noticed it used the BITS_PER_BYTE define rather than a hardcoded 8. If > it always loops 8 bits at a time, then we can use the > for_each_set_clump8 macro; Yes, see below. > otherwise we would need the more generic > for_each_set_clump macro to handle the non-8-bit looping cases. > Will BITS_PER_BYTE always be defined as 8 bits? It's not correct question, the right one "is the hardware always in 8-bit chunks". And datasheet is crystal clear about this. This very old and famous IC has 8-bit from the 70-s (IIRC the epoch of the design). So, it is always in 8-bit chunks. -- With Best Regards, Andy Shevchenko 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.7 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 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 400F0C43381 for ; Sun, 24 Mar 2019 12:08:55 +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 0D2CA222D1 for ; Sun, 24 Mar 2019 12:08:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="nTf5GZyU"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dt9t/cVZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0D2CA222D1 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:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LOCFahy8566zu8gOCbj6bcVCRcYzc6cGZCzmrGJpMGk=; b=nTf5GZyUDhw7LX 9qheQPHU2VlDwm2dm00Tu2dBqHlpB/JgjVYDaIa2F5rjQ+L78pm51JYzaHNFe7GGO8dajE8Dhz6+J HQ5b201vUViGmoA6aDqJ8m7R9PB+igzFSATNLpooZhpQalwD36xq/eFkpLC7SRG5jdLFXrQXFFNPJ VHFhxiMaHBCC61Pe5rwnXvBjjoM2o377n1h+kllmYqqPOTddnTsXzRTnizIDotbxGo7ygYY9rLtfr QvpJaIUZwLoZ6VAXQ/ev+tdIJRdryt+B3XNnQ2FDIKEUHtWXUxOAuewbIxWDe7daBAv3RfWRzcNop TeyVwU1NkrdJ8xdg3vdw==; 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 1h81vh-0002Pu-1y; Sun, 24 Mar 2019 12:08:45 +0000 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h81vd-0002PX-Dr for linux-arm-kernel@lists.infradead.org; Sun, 24 Mar 2019 12:08:43 +0000 Received: by mail-pg1-x542.google.com with SMTP id r124so4537793pgr.3 for ; Sun, 24 Mar 2019 05:08:41 -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=VHMQh4Fxw7DuEssbrRlPu0oxFwy4l1mv21FNEgGkcOw=; b=dt9t/cVZq7y/Ccz8c+ICIfRtP7bCCAmeqzihhAyFEsdi33gJuQQUMoOpYJH/UHg76r MAhFHApB9okRHR4ueCbVi8tVlh71c5Vmvtd8EgckSQpl4t+t5mtz+Kka6S/vtZrZyjqD hOZphzhukHDJAZHqFxgjEyIH1XGMgM3hDrxI1ePsD8dT+ivd4xB88+oDAZipIGf35H5+ yMZhi3aKnFU4blxYG+s//jOyCkOqhnqm2HgIY5jWMoPwSAkrYN8r6r307hD/vsVqtmBJ 8Wppn1SsuYNXEaOPu7P5RUV2L/AfdpleOZOPvbmCVSR6yTLzL6yMfybK/EC7wO5C8ym0 bvmA== 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=VHMQh4Fxw7DuEssbrRlPu0oxFwy4l1mv21FNEgGkcOw=; b=RizMjm5K3GZwHpVC+dckP0VcCxQYv9/1OWioxgIx5lxvhuKoYdS9DosiPwcd0iYt1y 0Wwcafqlfhx66+hZk6VO/I1rCagUYSSRVwk51J5FitSGtwOpHbdgjXJK3MWra3tfRpuk 1kZjn5jJi8Aisr/KMXdQoPCIIppTamWTEY4Ks73N5uhf/DANaAylyfGBQyHNZQoSyknL z1sCYl/vRINyPHYs1O+/kKCJ5tnh6bO3pDTJzeDjvrpC4osx09OWgO4CxldL24kFmB2A PTlz3YzWkT8faIIXe3RJoQhQbnmx4jwYqwcF7/dyYYR3RW2GeDUuimEfW7nR6RIPJJY1 AIGQ== X-Gm-Message-State: APjAAAWotT8KceX35EGLeYuTodSrJHyNjbMqt+/He59wonB250kzJQHC iFb23jsp9Vcr6UIlhDB0cvMj7SNf7pRhDzTF6F0= X-Google-Smtp-Source: APXvYqyuQDCk1jx6qUNks7YiOISA42oNvsCNiNJhxQ/1cxTc2p4Wa6hl0O9ZPA+3Ly0k6RUhveHKoBPdFb4tx8uTsoM= X-Received: by 2002:a17:902:8349:: with SMTP id z9mr57954pln.144.1553429320607; Sun, 24 Mar 2019 05:08:40 -0700 (PDT) MIME-Version: 1.0 References: <20190322191202.GC9224@smile.fi.intel.com> <20190324040704.GA8285@icarus> In-Reply-To: <20190324040704.GA8285@icarus> From: Andy Shevchenko Date: Sun, 24 Mar 2019 14:08:29 +0200 Message-ID: Subject: Re: [PATCH v10 00/10] Introduce the for_each_set_clump8 macro To: William Breathitt Gray X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190324_050841_468419_8FB91C8A X-CRM114-Status: GOOD ( 15.78 ) 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 , Phil Reid , Geert Uytterhoeven , Masahiro Yamada , Linus Walleij , Rasmus Villemoes , Linux Kernel Mailing List , "open list:GPIO SUBSYSTEM" , Bartosz Golaszewski , Andrew Morton , Andy Shevchenko , linux-arm Mailing List 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 Sun, Mar 24, 2019 at 6:12 AM William Breathitt Gray wrote: > > On Fri, Mar 22, 2019 at 09:12:02PM +0200, Andy Shevchenko wrote: > > On Thu, Mar 14, 2019 at 09:29:32PM +0900, William Breathitt Gray wrote: > > > Changes in v10: > > > - Fix off-by-one error in bitmap initialization in the > > > test_for_each_set_clump8 function > > > - Fix typos in clump_exp array definition in test_bitmap.c ("0x28" > > > should have been "0x38") > > > - Utilize for_each_set_clump8 macro in intel_soc_dts_iosf.c > > > > One more, can you look at gen_74x164_set_multiple() ? It seems a candidate as > > well, if I'm not mistaken. > > We can utilize the for_each_set_clump8 macro in the > gen_74x164_set_multiple function, but I skipped over it earlier since I > noticed it used the BITS_PER_BYTE define rather than a hardcoded 8. If > it always loops 8 bits at a time, then we can use the > for_each_set_clump8 macro; Yes, see below. > otherwise we would need the more generic > for_each_set_clump macro to handle the non-8-bit looping cases. > Will BITS_PER_BYTE always be defined as 8 bits? It's not correct question, the right one "is the hardware always in 8-bit chunks". And datasheet is crystal clear about this. This very old and famous IC has 8-bit from the 70-s (IIRC the epoch of the design). So, it is always in 8-bit chunks. -- 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