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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EA719C46467 for ; Fri, 16 Dec 2022 16:26:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230462AbiLPQ0n (ORCPT ); Fri, 16 Dec 2022 11:26:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230024AbiLPQ0W (ORCPT ); Fri, 16 Dec 2022 11:26:22 -0500 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5856A32BAB; Fri, 16 Dec 2022 08:26:21 -0800 (PST) X-IronPort-AV: E=McAfee;i="6500,9779,10563"; a="320173184" X-IronPort-AV: E=Sophos;i="5.96,249,1665471600"; d="scan'208";a="320173184" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Dec 2022 08:26:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10563"; a="895291130" X-IronPort-AV: E=Sophos;i="5.96,249,1665471600"; d="scan'208";a="895291130" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga006.fm.intel.com with ESMTP; 16 Dec 2022 08:26:16 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1p6DXK-00AvoX-0k; Fri, 16 Dec 2022 18:26:14 +0200 Date: Fri, 16 Dec 2022 18:26:13 +0200 From: Andy Shevchenko To: Hans de Goede Cc: Mark Gross , Pavel Machek , Lee Jones , Linus Walleij , Daniel Scally , Laurent Pinchart , Mauro Carvalho Chehab , Sakari Ailus , platform-driver-x86@vger.kernel.org, linux-leds@vger.kernel.org, linux-gpio@vger.kernel.org, Kate Hsuan , Mark Pearson , Andy Yeh , Yao Hao , linux-media@vger.kernel.org Subject: Re: [PATCH v3 07/11] platform/x86: int3472/discrete: Refactor GPIO to sensor mapping Message-ID: References: <20221216113013.126881-1-hdegoede@redhat.com> <20221216113013.126881-8-hdegoede@redhat.com> <233166c0-eb2d-8b41-68f3-d9613218fc16@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <233166c0-eb2d-8b41-68f3-d9613218fc16@redhat.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org On Fri, Dec 16, 2022 at 05:15:14PM +0100, Hans de Goede wrote: > On 12/16/22 14:57, Andy Shevchenko wrote: > > On Fri, Dec 16, 2022 at 12:30:09PM +0100, Hans de Goede wrote: ... > >> +static void int3472_get_func_and_polarity(u8 type, const char **func, u32 *polarity) > > > > I find a bit strange not making this a function that returns func: > > > > static const char *int3472_get_func_and_polarity(u8 type, u32 *polarity) > > Why make it return func and not polarity ? Because of name "func" and "polarity". And as you read a prototype from left to right it exactly follows that. > Since there are 2 values to return it makes sense to be > consistent and return both by reference. But this is unneeded complication, no? > Also this sort of comments really get into the territory > of bikeshedding which is not helpful IMHO. I find helpful to have a prototype shorter and the switch-case shorter due to return vs break. Of course you can think it's unhelpful, but I have another opinion. All by all you are the maintainer there, your call. -- With Best Regards, Andy Shevchenko