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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EC845C433F5 for ; Mon, 8 Nov 2021 09:26:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C9BB06125F for ; Mon, 8 Nov 2021 09:26:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238388AbhKHJ3P (ORCPT ); Mon, 8 Nov 2021 04:29:15 -0500 Received: from mga14.intel.com ([192.55.52.115]:51294 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238401AbhKHJ3K (ORCPT ); Mon, 8 Nov 2021 04:29:10 -0500 X-IronPort-AV: E=McAfee;i="6200,9189,10161"; a="232442046" X-IronPort-AV: E=Sophos;i="5.87,218,1631602800"; d="scan'208";a="232442046" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Nov 2021 01:26:23 -0800 X-IronPort-AV: E=Sophos;i="5.87,218,1631602800"; d="scan'208";a="499814430" Received: from smile.fi.intel.com ([10.237.72.184]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Nov 2021 01:26:18 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.95) (envelope-from ) id 1mk0ui-004cSx-N0; Mon, 08 Nov 2021 11:26:04 +0200 Date: Mon, 8 Nov 2021 11:26:04 +0200 From: Andy Shevchenko To: Joe Perches Cc: Bartosz Golaszewski , Jianqun Xu , Linus Walleij , Sai Krishna Potthuri , Andrew Morton , "linux-gpio@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-rockchip@lists.infradead.org" , Bamvor Jian Zhang , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Heiko Stuebner , Patrice Chotard , Michal Simek , Andy Shevchenko Subject: Re: [PATCH v1 14/19] pinctrl: st: Use temporary variable for struct device Message-ID: References: <20211105124242.27288-1-andriy.shevchenko@linux.intel.com> <20211105124242.27288-14-andriy.shevchenko@linux.intel.com> <4b3f1ee1179dd6d4b010cb110b38d26e7d91c19f.camel@perches.com> <103d7321a2d18e44fb8c01483b1197766aff645a.camel@perches.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <103d7321a2d18e44fb8c01483b1197766aff645a.camel@perches.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Nov 06, 2021 at 01:28:17AM -0700, Joe Perches wrote: > On Sat, 2021-11-06 at 10:07 +0200, Andy Shevchenko wrote: > > On Saturday, November 6, 2021, Joe Perches wrote: > > > On Fri, 2021-11-05 at 14:42 +0200, Andy Shevchenko wrote: ... > > > > - new_map = devm_kcalloc(pctldev->dev, > > > > - map_num, sizeof(*new_map), GFP_KERNEL); > > > > + new_map = devm_kcalloc(dev, map_num, sizeof(*new_map), GFP_KERNEL); > > > > > > Are pctldev->dev and dev the same pointer? > > > > Seems so. > > OK. > > > https://elixir.bootlin.com/linux/latest/source/drivers/pinctrl/core.c#L2015 > > > > > It seems they are not. > > > > Can you elaborate, please? > From code shape, you assign dev to info->dev rather than pctldev->dev Yes. And they are the same. TBH these three drivers seem to be written by copy'n'paste method where the first one, whichever it was, is simply messy and buggy. The extra redundant parameter (often struct platform_device) is passed to zillions of functions when at the same time info structure already has pointer to struct device is the easiest one to notice. And I believe so on, so on... > I also believe this single 19 patch series would be better as > multiple patch series. I'm fine with either, but I would like to hear from Linus about what he wishes as the maintainer. You know that we don't add code without users? So that's why my motive to send it in full. > IMO: the strarray variants introduction and use should be a separate > patchset from the rest. It will add unnecessary churn. Yeah, I have planned to send just that, but then it took more and more cleanups and I have to stop at some point, the code there is bad (historically or by other reasons, dunno). -- With Best Regards, Andy Shevchenko