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 8DE59C433EF for ; Thu, 14 Oct 2021 00:31:25 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 C761B6109F for ; Thu, 14 Oct 2021 00:31:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C761B6109F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4HV9Lg3Ts9z3cMn for ; Thu, 14 Oct 2021 11:31:23 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=softfail (domain owner discourages use of this host) smtp.mailfrom=gmail.com (client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=andy.shevchenko@gmail.com; receiver=) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4HTtYH0QpWz2yHq for ; Thu, 14 Oct 2021 00:24:33 +1100 (AEDT) X-IronPort-AV: E=McAfee;i="6200,9189,10135"; a="290914500" X-IronPort-AV: E=Sophos;i="5.85,371,1624345200"; d="scan'208";a="290914500" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Oct 2021 06:23:29 -0700 X-IronPort-AV: E=Sophos;i="5.85,371,1624345200"; d="scan'208";a="626341116" Received: from smile.fi.intel.com (HELO smile) ([10.237.72.159]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Oct 2021 06:23:15 -0700 Received: from andy by smile with local (Exim 4.95) (envelope-from ) id 1maeDt-000LPO-Od; Wed, 13 Oct 2021 16:23:09 +0300 Date: Wed, 13 Oct 2021 16:23:09 +0300 From: Andy Shevchenko To: Bjorn Helgaas Subject: Re: [PATCH v6 00/11] PCI: Drop duplicated tracking of a pci_dev's bound driver Message-ID: References: <20211013113356.GA1891412@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20211013113356.GA1891412@bhelgaas> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Mailman-Approved-At: Thu, 14 Oct 2021 11:29:19 +1100 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Giovanni Cabiddu , Mark Rutland , Sathya Prakash , Alexander Shishkin , Alexander Duyck , "maintainer:X86 ARCHITECTURE \(32-BIT AND 64-BIT\)" , qat-linux@intel.com, oss-drivers@corigine.com, Oliver O'Halloran , "H. Peter Anvin" , Jiri Olsa , Thomas Gleixner , Marco Chiappero , Stefano Stabellini , Herbert Xu , linux-scsi , =?utf-8?B?UmFmYcWCIE1pxYJlY2tp?= , Jesse Brandeburg , Peter Zijlstra , Ingo Molnar , linux-pci , "open list:TI WILINK WIRELES..." , Jakub Kicinski , Yisen Zhuang , Suganath Prabu Subramani , Fiona Trahe , Andrew Donnellan , Arnd Bergmann , Konrad Rzeszutek Wilk , Ido Schimmel , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , Simon Horman , "open list:LINUX FOR POWERPC PA SEMI PWRFICIENT" , Arnaldo Carvalho de Melo , Jack Xu , Borislav Petkov , Michael Buesch , Jiri Pirko , Bjorn Helgaas , Namhyung Kim , Boris Ostrovsky , Juergen Gross , Salil Mehta , Sreekanth Reddy , xen-devel@lists.xenproject.org, Vadym Kochan , MPT-FusionLinux.pdl@broadcom.com, Greg Kroah-Hartman , USB , Wojciech Ziemba , Linux Kernel Mailing List , Mathias Nyman , Zhou Wang , linux-crypto , Sascha Hauer , netdev , Frederic Barrat , Paul Mackerras , Tomaszx Kowalik , Taras Chornyi , "David S. Miller" , linux-perf-users@vger.kernel.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Wed, Oct 13, 2021 at 06:33:56AM -0500, Bjorn Helgaas wrote: > On Wed, Oct 13, 2021 at 12:26:42PM +0300, Andy Shevchenko wrote: > > On Wed, Oct 13, 2021 at 2:33 AM Bjorn Helgaas wrote: > > > On Mon, Oct 04, 2021 at 02:59:24PM +0200, Uwe Kleine-König wrote: ... > > It's a bit unusual. Other to_*_dev() are not NULL-aware IIRC. > > It is a little unusual. I only found three of 77 that are NULL-aware: > > to_moxtet_driver() > to_siox_driver() > to_spi_driver() > > It seems worthwhile to me because it makes the patch and the resulting > code significantly cleaner. I'm not objecting the change, just a remark. ... > > > + for (id = drv ? drv->id_table : NULL; id && id->vendor; id++) > > > + if (id->vendor == vendor && id->device == device) > > > > > + break; > > > > return true; > > > > > return id && id->vendor; > > > > return false; > > Good cleanup for a follow-up patch, but doesn't seem directly related > to the objective here. True. Maybe you can bake one while not forgotten? ... > > > + return drv && drv->resume ? > > > + drv->resume(pci_dev) : pci_pm_reenable_device(pci_dev); > > > > One line? > > I don't think I touched that line. Then why they are both in + section? ... > > > + struct pci_driver *drv = to_pci_driver(dev->dev.driver); > > > const struct pci_error_handlers *err_handler = > > > - dev->dev.driver ? to_pci_driver(dev->dev.driver)->err_handler : NULL; > > > + drv ? drv->err_handler : NULL; > > > > Isn't dev->driver == to_pci_driver(dev->dev.driver)? > > Yes, I think so, but not sure what you're getting at here, can you > elaborate? Getting pointer from another pointer seems waste of resources, why we can't simply struct pci_driver *drv = dev->driver; ? ... > > Stray change? Or is it in a separate patch in your tree? > > Could be skipped. The string now fits on one line so I combined it to > make it more greppable. This is inconsistency in your changes, in one case you are objecting of doing something close to the changed lines, in the other you are doing unrelated change. -- With Best Regards, Andy Shevchenko