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 35B33C433FE for ; Tue, 28 Sep 2021 20:08:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 17B87611C3 for ; Tue, 28 Sep 2021 20:08:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242563AbhI1UJy (ORCPT ); Tue, 28 Sep 2021 16:09:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:39692 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242120AbhI1UJx (ORCPT ); Tue, 28 Sep 2021 16:09:53 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 13EEA61157; Tue, 28 Sep 2021 20:08:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632859693; bh=2q54bLyOqMkKWDejBRp+5bRZfTrKTSWJcV2n/WM7O5I=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=SJlILrO3fJ9ue8UvYpapX4ojkALIQWP0IhyvgGUEnmc2bU4/eR9Oz1WHf91TFCvXA +AvaFLotNIk6GNVMTzMiHUmE0SECnG/DaFsMeYfbeJ4HnUD4sgFtdp1R5TXABKq/V5 4Gltdrd5KbjraDvTp7Dojw2UaOlvPdW7DYea08nUCxmciYyaMtdgK79OJikk1fI3dS IQxjaLHV0wfoBer0BAfg32is1dAvMuIslQlV94SxW032Uh3Itk0NL7NQX8SiKEicB1 kZRIFonoYbzHfn7L/mtYQNU1K3C/vNR3V9ujP6yh2gmx56PtY428rmLhwG6a55K51M NJoYyJGhopiig== Date: Tue, 28 Sep 2021 15:08:11 -0500 From: Bjorn Helgaas To: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= Cc: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , Oliver O'Halloran , Russell Currey , Benjamin Herrenschmidt , linux-pci@vger.kernel.org, Alexander Duyck , oss-drivers@corigine.com, Paul Mackerras , Herbert Xu , Michael Ellerman , =?utf-8?B?UmFmYcWCIE1pxYJlY2tp?= , Jesse Brandeburg , Ido Schimmel , Jakub Kicinski , Yisen Zhuang , Vadym Kochan , Michael Buesch , Jiri Pirko , Salil Mehta , netdev@vger.kernel.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Taras Chornyi , Zhou Wang , linux-crypto@vger.kernel.org, kernel@pengutronix.de, Simon Horman , linuxppc-dev@lists.ozlabs.org, "David S. Miller" Subject: Re: [PATCH v4 4/8] PCI: replace pci_dev::driver usage that gets the driver name Message-ID: <20210928200811.GA724823@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210928192936.w5umyzivi4hs6q3r@pengutronix.de> Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Tue, Sep 28, 2021 at 09:29:36PM +0200, Uwe Kleine-König wrote: > On Tue, Sep 28, 2021 at 12:17:59PM -0500, Bjorn Helgaas wrote: > > [+to Oliver, Russell for eeh_driver_name() question below] > > > > On Mon, Sep 27, 2021 at 10:43:22PM +0200, Uwe Kleine-König wrote: > > > From: Uwe Kleine-König > > > > > > struct pci_dev::driver holds (apart from a constant offset) the same > > > data as struct pci_dev::dev->driver. With the goal to remove struct > > > pci_dev::driver to get rid of data duplication replace getting the > > > driver name by dev_driver_string() which implicitly makes use of struct > > > pci_dev::dev->driver. > > Also, would you mind using "pci_dev.driver" instead of > > "pci_dev::driver"? AFAIK, the "::" operator is not actually part of > > C, so I think it's more confusing than useful. > > pci_dev.driver doesn't work either in C because pci_dev is a type and > not a variable. Sure, "pci_dev.driver" is not strictly acceptable C unless you have a "struct pci_dev pci_dev", but it's pretty common. 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 9D2EEC433EF for ; Tue, 28 Sep 2021 20:08:58 +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 23AD061157 for ; Tue, 28 Sep 2021 20:08:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 23AD061157 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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 4HJrDm4BW3z2ywB for ; Wed, 29 Sep 2021 06:08:56 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=SJlILrO3; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=198.145.29.99; helo=mail.kernel.org; envelope-from=helgaas@kernel.org; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=SJlILrO3; dkim-atps=neutral Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (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 4HJrD04d7Sz2xr3 for ; Wed, 29 Sep 2021 06:08:16 +1000 (AEST) Received: by mail.kernel.org (Postfix) with ESMTPSA id 13EEA61157; Tue, 28 Sep 2021 20:08:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632859693; bh=2q54bLyOqMkKWDejBRp+5bRZfTrKTSWJcV2n/WM7O5I=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=SJlILrO3fJ9ue8UvYpapX4ojkALIQWP0IhyvgGUEnmc2bU4/eR9Oz1WHf91TFCvXA +AvaFLotNIk6GNVMTzMiHUmE0SECnG/DaFsMeYfbeJ4HnUD4sgFtdp1R5TXABKq/V5 4Gltdrd5KbjraDvTp7Dojw2UaOlvPdW7DYea08nUCxmciYyaMtdgK79OJikk1fI3dS IQxjaLHV0wfoBer0BAfg32is1dAvMuIslQlV94SxW032Uh3Itk0NL7NQX8SiKEicB1 kZRIFonoYbzHfn7L/mtYQNU1K3C/vNR3V9ujP6yh2gmx56PtY428rmLhwG6a55K51M NJoYyJGhopiig== Date: Tue, 28 Sep 2021 15:08:11 -0500 From: Bjorn Helgaas To: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= Subject: Re: [PATCH v4 4/8] PCI: replace pci_dev::driver usage that gets the driver name Message-ID: <20210928200811.GA724823@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210928192936.w5umyzivi4hs6q3r@pengutronix.de> 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: linux-pci@vger.kernel.org, Alexander Duyck , oss-drivers@corigine.com, Oliver O'Halloran , Herbert Xu , Ido Schimmel , =?utf-8?B?UmFmYcWCIE1pxYJlY2tp?= , Jesse Brandeburg , Jakub Kicinski , Yisen Zhuang , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , Vadym Kochan , Michael Buesch , Jiri Pirko , Salil Mehta , netdev@vger.kernel.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Taras Chornyi , Zhou Wang , linux-crypto@vger.kernel.org, kernel@pengutronix.de, Simon Horman , Paul Mackerras , linuxppc-dev@lists.ozlabs.org, "David S. Miller" Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Tue, Sep 28, 2021 at 09:29:36PM +0200, Uwe Kleine-König wrote: > On Tue, Sep 28, 2021 at 12:17:59PM -0500, Bjorn Helgaas wrote: > > [+to Oliver, Russell for eeh_driver_name() question below] > > > > On Mon, Sep 27, 2021 at 10:43:22PM +0200, Uwe Kleine-König wrote: > > > From: Uwe Kleine-König > > > > > > struct pci_dev::driver holds (apart from a constant offset) the same > > > data as struct pci_dev::dev->driver. With the goal to remove struct > > > pci_dev::driver to get rid of data duplication replace getting the > > > driver name by dev_driver_string() which implicitly makes use of struct > > > pci_dev::dev->driver. > > Also, would you mind using "pci_dev.driver" instead of > > "pci_dev::driver"? AFAIK, the "::" operator is not actually part of > > C, so I think it's more confusing than useful. > > pci_dev.driver doesn't work either in C because pci_dev is a type and > not a variable. Sure, "pci_dev.driver" is not strictly acceptable C unless you have a "struct pci_dev pci_dev", but it's pretty common.