Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3101934yba; Sun, 28 Apr 2019 17:18:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqyuRh6Hf89aPvmZo49ncu5+RVlxtHDzhoLYl5hjt0Vdosy5zAd/5w67PEQ3FcidSyjhd2yz X-Received: by 2002:a17:902:aa96:: with SMTP id d22mr18936944plr.259.1556497096486; Sun, 28 Apr 2019 17:18:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556497096; cv=none; d=google.com; s=arc-20160816; b=jFsuuP8WAedT2Nxi/dO7U9jvXEbot4UmZjeYN2re0ZSjzy88suSsDUb7+Iwb5uaBXH FxPvy3Nc6EDbk9wHLDnBvzU4zkRlReu7ezBmHcKUZHGwqokXgR/u5l0q7U18DHjTKj/Y Febfm+cQb9xiN6Tr9armaKpFOFb9CBevKRTyfWSt2X33/b22e8j/R9rl3XkLQA190hJ3 A6fhw4zzmruVh7G89HMreWFJK4oZKRGKxxZCaVT7ATBmglQdIqdi/VViAUrzUyYPG+wY QuNMg9ULR6kxppH5a83fRa1Zr+lxhBc2U9UyrCuA6gONQAllx4Sgn5FXLjsTEAXsWrRs Z76Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=/mo2whz8EGQmJFIgCEVtpDwUg7kLuHsGg/FDysmKOSQ=; b=XooJXKfW29W+nK1bCf3R/3KrfniMHGIMaq+litqx/2D/rORQXUjBGXcM+qOIwV/t1W oodVuHNLDyrIFTt0FtFnfiilHPYn/gbvAMtI/jom0p3gyxmDPBc1oqk1RdO8ebldAVlB Nt1RUjoDT6Z9JT4cY/au7dTyL0HmZfaPfRCkNMnrUsSlpoK9PwKcwnYp5kWTZWyPCkmR fFpmeVpmQNNpkOC4uE7Mssru/Azpyp0+hqly23qMSfktcmD+2uszl3YlHlu+FOXQTYI7 Ek8eYHhzRFh2y2MNov4389rVfB15zgfpJY0EDqduePhGyj7byPET7HJXYRzMqUNTCn5b FkyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1zvrhoZQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p16si17515953plq.315.2019.04.28.17.18.00; Sun, 28 Apr 2019 17:18:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1zvrhoZQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726786AbfD2ARL (ORCPT + 99 others); Sun, 28 Apr 2019 20:17:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:53288 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726223AbfD2ARL (ORCPT ); Sun, 28 Apr 2019 20:17:11 -0400 Received: from localhost (unknown [69.71.4.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5E7F620656; Mon, 29 Apr 2019 00:17:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556497029; bh=oG6Yu4j/Dt+FoonJfviNsLx4jjegkGBiqnZn0AdmUTE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=1zvrhoZQieoigcwC87QQNYfTCrNcvfzgWSdrwQfu2RuYfbLjxt/oyZEf6++27LBz6 Me+gqjRshaO/NydGhU3lmYWw2N7PuE97zeOudmiKZReE23OQ607uvPJDtW1XW0scgB zUKqhXT5fTekSE5F71QHTMYV7/Gp/YIx3L+RLn20= Date: Sun, 28 Apr 2019 19:17:08 -0500 From: Bjorn Helgaas To: fred@fredlawl.com Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, mika.westerberg@linux.intel.com, lukas@wunner.de, andriy.shevchenko@linux.intel.com, keith.busch@intel.com, mr.nuke.me@gmail.com, liudongdong3@huawei.com, thesven73@gmail.com Subject: Re: [PATCH 4/4] PCI/portdrv: Add dev_fmt() to port drivers Message-ID: <20190429001708.GM14616@google.com> References: <20190427191304.32502-1-fred@fredlawl.com> <20190427191304.32502-5-fred@fredlawl.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190427191304.32502-5-fred@fredlawl.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Apr 27, 2019 at 02:13:04PM -0500, fred@fredlawl.com wrote: > From: Frederick Lawler > > Add dev_fmt() to port drivers. > > Signed-off-by: Frederick Lawler > --- > drivers/pci/hotplug/pciehp_core.c | 3 +++ > drivers/pci/hotplug/pciehp_ctrl.c | 2 ++ > drivers/pci/hotplug/pciehp_hpc.c | 3 +++ > drivers/pci/hotplug/pciehp_pci.c | 2 ++ > drivers/pci/pcie/aer.c | 3 +++ > drivers/pci/pcie/aer_inject.c | 2 ++ > drivers/pci/pcie/bw_notification.c | 2 ++ > drivers/pci/pcie/dpc.c | 2 ++ > drivers/pci/pcie/pme.c | 2 ++ > 9 files changed, 21 insertions(+) > > diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c > index 430a47556813..b07d713fd4bd 100644 > --- a/drivers/pci/hotplug/pciehp_core.c > +++ b/drivers/pci/hotplug/pciehp_core.c > @@ -17,6 +17,9 @@ > * Dely Sy " > */ > > +#define pr_fmt(fmt) "pciehp: " fmt > +#define dev_fmt(fmt) pr_fmt(fmt) This should be in the same patch that converts from using the pcie_device to the pci_dev. That way the "pciehp" that came from the pcie_device is atomically replaced with the "pciehp" from pr_fmt()/dev_fmt(). If you do it in separate patches, there's an intermediate stage where there's no prefix at all, and we want to avoid that. BTW, in most cases you can simply do this, which is slightly simpler: #define dev_fmt pr_fmt > #include > #include > #include > diff --git a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c > index 345c02b1e8d7..969a9c72f65d 100644 > --- a/drivers/pci/hotplug/pciehp_ctrl.c > +++ b/drivers/pci/hotplug/pciehp_ctrl.c > @@ -13,6 +13,8 @@ > * > */ > > +#define dev_fmt(fmt) "pciehp: " fmt > + > #include > #include > #include > diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c > index 28a132a0d9db..f2a3da105f5b 100644 > --- a/drivers/pci/hotplug/pciehp_hpc.c > +++ b/drivers/pci/hotplug/pciehp_hpc.c > @@ -12,6 +12,9 @@ > * Send feedback to , > */ > > +#define pr_fmt(fmt) "pciehp: " fmt > +#define dev_fmt(fmt) pr_fmt(fmt) > + > #include > #include > #include > diff --git a/drivers/pci/hotplug/pciehp_pci.c b/drivers/pci/hotplug/pciehp_pci.c > index 55967ce567f6..04ccd535aca7 100644 > --- a/drivers/pci/hotplug/pciehp_pci.c > +++ b/drivers/pci/hotplug/pciehp_pci.c > @@ -13,6 +13,8 @@ > * > */ > > +#define dev_fmt(fmt) "pciehp: " fmt > + > #include > #include > #include > diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c > index 224d878a28b4..6fd67285423d 100644 > --- a/drivers/pci/pcie/aer.c > +++ b/drivers/pci/pcie/aer.c > @@ -12,6 +12,9 @@ > * Andrew Patterson > */ > > +#define pr_fmt(fmt) "AER: " fmt > +#define dev_fmt(fmt) pr_fmt(fmt) > + > #include > #include > #include > diff --git a/drivers/pci/pcie/aer_inject.c b/drivers/pci/pcie/aer_inject.c > index 610b617ae600..d4f6d49acd0c 100644 > --- a/drivers/pci/pcie/aer_inject.c > +++ b/drivers/pci/pcie/aer_inject.c > @@ -12,6 +12,8 @@ > * Huang Ying > */ > > +#define dev_fmt(fmt) "AER: " fmt > + > #include > #include > #include > diff --git a/drivers/pci/pcie/bw_notification.c b/drivers/pci/pcie/bw_notification.c > index d2eae3b7cc0f..a4bb90562cd5 100644 > --- a/drivers/pci/pcie/bw_notification.c > +++ b/drivers/pci/pcie/bw_notification.c > @@ -14,6 +14,8 @@ > * and warns when links become degraded in operation. > */ > > +#define dev_fmt(fmt) "BWN: " fmt > + > #include "../pci.h" > #include "portdrv.h" > > diff --git a/drivers/pci/pcie/dpc.c b/drivers/pci/pcie/dpc.c > index 72659286191b..b3c10cdc508a 100644 > --- a/drivers/pci/pcie/dpc.c > +++ b/drivers/pci/pcie/dpc.c > @@ -6,6 +6,8 @@ > * Copyright (C) 2016 Intel Corp. > */ > > +#define dev_fmt(fmt) "DPC: " fmt > + > #include > #include > #include > diff --git a/drivers/pci/pcie/pme.c b/drivers/pci/pcie/pme.c > index 54d593d10396..d6698423a6d6 100644 > --- a/drivers/pci/pcie/pme.c > +++ b/drivers/pci/pcie/pme.c > @@ -7,6 +7,8 @@ > * Copyright (C) 2009 Rafael J. Wysocki , Novell Inc. > */ > > +#define dev_fmt(fmt) "PME: " fmt > + > #include > #include > #include > -- > 2.17.1 >