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=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 0E168C388F7 for ; Mon, 9 Nov 2020 14:27:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D35EF206E3 for ; Mon, 9 Nov 2020 14:27:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730384AbgKIO1x (ORCPT ); Mon, 9 Nov 2020 09:27:53 -0500 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:57847 "EHLO relay7-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730035AbgKIO1w (ORCPT ); Mon, 9 Nov 2020 09:27:52 -0500 X-Originating-IP: 86.194.74.19 Received: from localhost (lfbn-lyo-1-997-19.w86-194.abo.wanadoo.fr [86.194.74.19]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 30E3420016; Mon, 9 Nov 2020 14:27:49 +0000 (UTC) Date: Mon, 9 Nov 2020 15:27:48 +0100 From: Alexandre Belloni To: Andy Shevchenko Cc: Lars Povlsen , Linus Walleij , Microchip Linux Driver Support , devicetree , "open list:GPIO SUBSYSTEM" , linux-arm Mailing List , Linux Kernel Mailing List Subject: Re: [PATCH v7 2/3] pinctrl: pinctrl-microchip-sgpio: Add pinctrl driver for Microsemi Serial GPIO Message-ID: <20201109142748.GI1257108@piout.net> References: <20201029134027.232951-1-lars.povlsen@microchip.com> <20201029134027.232951-3-lars.povlsen@microchip.com> <874klyg2dg.fsf@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On 09/11/2020 16:00:16+0200, Andy Shevchenko wrote: > On Mon, Nov 9, 2020 at 2:07 PM Lars Povlsen wrote: > > > On Thu, Oct 29, 2020 at 3:40 PM Lars Povlsen wrote: > > ... > > > >> +#define __shf(x) (__builtin_ffs(x) - 1) > > >> +#define __BF_PREP(bf, x) (bf & ((x) << __shf(bf))) > > >> +#define __BF_GET(bf, x) (((x & bf) >> __shf(bf))) > > > > > > Isn't it home grown reimplementation of bitfield.h? > > > > This was answered in the aforementioned mail. > > Perhaps it makes sense to add functions like field_get(), field_prep() > to that header? IIRC it has been explicitly excluded from bitfield.h to ensure developers will think about the introduced overhead. -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com