From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1035491AbdD1KGr (ORCPT ); Fri, 28 Apr 2017 06:06:47 -0400 Received: from mail-io0-f177.google.com ([209.85.223.177]:34046 "EHLO mail-io0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S968171AbdD1KGm (ORCPT ); Fri, 28 Apr 2017 06:06:42 -0400 MIME-Version: 1.0 In-Reply-To: References: <1493281194-5200-1-git-send-email-jacopo+renesas@jmondi.org> <1493281194-5200-3-git-send-email-jacopo+renesas@jmondi.org> From: Geert Uytterhoeven Date: Fri, 28 Apr 2017 12:06:39 +0200 X-Google-Sender-Auth: MmlOU22Yac8zsH055PG76nnxIUE Message-ID: Subject: Re: [PATCH v5 02/10] pinctrl: generic: Add macros to unpack properties To: Linus Walleij Cc: Jacopo Mondi , Geert Uytterhoeven , Laurent Pinchart , Chris Brandt , Rob Herring , Mark Rutland , Russell King , Linux-Renesas , "linux-gpio@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 28, 2017 at 10:16 AM, Linus Walleij wrote: > On Thu, Apr 27, 2017 at 10:19 AM, Jacopo Mondi >> +#define PIN_CONF_UNPACK_PARAM(c) ((c) & 0xffUL) >> +#define PIN_CONF_UNPACK_ARGS(c) ((c) >> 8) > > But why. > > I have these two static inlines just below your new macros: > > static inline enum pin_config_param pinconf_to_config_param(unsigned > long config) > { > return (enum pin_config_param) (config & 0xffUL); > } > > static inline u32 pinconf_to_config_argument(unsigned long config) > { > return (u32) ((config >> 8) & 0xffffffUL); > } Cool, need...more...context...in...patches ;-) > Why can't you use this in your code instead of macros? > > We generally prefer static inlines over macros because they are easier > to read. Sure. Thanks for noticing! Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds