From nobody Tue May 7 10:00:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1630915255; cv=none; d=zohomail.com; s=zohoarc; b=bgaBm6Q5BOWR+wECtaAyPfiZqZaVldGHOB/YckO0oMSHBBSeRNRZE4fi7ANmfOD/6XWkJEYnLjgdgRwPrL1dhl+Fdskz+g6ouO0IHP3hO8J+VBAqqHUNTdoshm2nQlu/XrjqFwVtdaq9X8ec9CnoFhL0RMTc4UCdk31gVA9GEGE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630915255; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=2Xf56OLSp+hppzWvWhEGSXjWhxDg/ErT9f349mtnYmE=; b=Rua5rSJbz+DLiHVNmHC0j3ZUJB2mc/UUi/59r+TB0JhzxHd6ZuAP3Mtf/PJ1jZBDJNEKb2UqrjRRXDFgzZBu3T+qjh+jcUbDKBt3OT2OjquBYfvAJgo8NTph/7IVjzz7zRZ84aFh37K75ffa0+KE/POL4+jFRte8DiChtjl6w4s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1630915254810655.4638462146916; Mon, 6 Sep 2021 01:00:54 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.179413.325696 (Exim 4.92) (envelope-from ) id 1mN9YV-0006Sj-Pv; Mon, 06 Sep 2021 08:00:39 +0000 Received: by outflank-mailman (output) from mailman id 179413.325696; Mon, 06 Sep 2021 08:00:39 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mN9YV-0006Sc-MJ; Mon, 06 Sep 2021 08:00:39 +0000 Received: by outflank-mailman (input) for mailman id 179413; Mon, 06 Sep 2021 07:55:25 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mN9TR-0003rK-3Z for xen-devel@lists.xenproject.org; Mon, 06 Sep 2021 07:55:25 +0000 Received: from mail-pj1-x102b.google.com (unknown [2607:f8b0:4864:20::102b]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 038a7c4b-e7d3-4c03-98ac-9450a760c7b3; Mon, 06 Sep 2021 07:55:24 +0000 (UTC) Received: by mail-pj1-x102b.google.com with SMTP id mj9-20020a17090b368900b001965618d019so3770772pjb.4 for ; Mon, 06 Sep 2021 00:55:24 -0700 (PDT) Received: from localhost.localdomain ([111.207.172.18]) by smtp.gmail.com with ESMTPSA id u10sm6789616pfn.147.2021.09.06.00.55.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Sep 2021 00:55:22 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 038a7c4b-e7d3-4c03-98ac-9450a760c7b3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=2Xf56OLSp+hppzWvWhEGSXjWhxDg/ErT9f349mtnYmE=; b=Tj/b5umNNUQO9OTj3KVUsNndVD9R/+79WMav7vc/xEFnF8t6aarL8lMZq2aqHDGjCK ccCjcuxmO+xSG+V1DpEK/wSnmGUtxvRS7In/KdYAdecRoFxbTVPjHkMJhX1og+8YJtaC OLziIHDZfUChb6k7TVrMezl5ZwtSGzqPzoYTQg4s2nYvNQyXISHO0HeOxBs6f8ad4BLt zQIqvCluOoylVSb2kc/zCJtLB4aF9PnF1gOhDpZ+nCqm2OsEIGsvyInV7GyNTUgoO+X1 h1701OZ+VbZSUDUHA7PgUN50uYWh65fuh9owuw2BMzW/e2BF0BOAevtd8BEoSCpMPMaW f9mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=2Xf56OLSp+hppzWvWhEGSXjWhxDg/ErT9f349mtnYmE=; b=q+YEqNrje2pq+4BM0nsVB3W8OnKZux099mFCHWIrVmglO7mDvJNJBolSn8dVIMy0ME 41RdbsdOpCW77n0/MQH9Um5qXCQ+gyghn/FxnMVV9EK/mdknDq8DW6jEiIHRtZdauEq4 y3ws8SDyENJnCIGI79SLtLLZD19lf8//M+NJej8Er7/9jL7QrPxCyRJK6xrPuHJ94tC1 2tO7bnWofFQkWb7eMtgW9UXsWfg47SIIJNC1J1t1gc2UAsku37LIz9y/YyHSQO9gO46E BG1pq+SdZOmykjjeCcaKPL2TO8UYuPZG/ue6W/gxBqi01bbiDFk6kouBFJIKB3yQzmO5 JZSw== X-Gm-Message-State: AOAM530Z9oTg09pKxbVCiaL3s1GZzqEAL1OmpIRyWBj9Vp/ZuX6rPJOZ P8HZgRyIf/GL0RaxGze3jPg= X-Google-Smtp-Source: ABdhPJxd0pw9THgbbgqH1OA2JXyGSDCt9tbjRnSLlddXY9HZasP9LDEct/XwtdvVy+oXt3MppnsVUg== X-Received: by 2002:a17:902:a503:b029:12b:2429:385e with SMTP id s3-20020a170902a503b029012b2429385emr9853168plq.64.1630914923382; Mon, 06 Sep 2021 00:55:23 -0700 (PDT) From: zhaoxiao To: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, x86@kernel.org Cc: hpa@zytor.com, xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, boris.ostrovsky@oracle.com, jgross@suse.com, sstabellini@kernel.org, zhaoxiao Subject: [PATCH] x86: xen: platform-pci-unplug: use pr_err() and pr_warn() instead of raw printk() Date: Mon, 6 Sep 2021 15:55:16 +0800 Message-Id: <20210906075516.15066-1-long870912@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1630915257210100001 Content-Type: text/plain; charset="utf-8" Since we have the nice helpers pr_err() and pr_warn(), use them instead of raw printk(). Signed-off-by: zhaoxiao --- arch/x86/xen/platform-pci-unplug.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/arch/x86/xen/platform-pci-unplug.c b/arch/x86/xen/platform-pci= -unplug.c index 96d7f7d39cb9..6586eaf59c00 100644 --- a/arch/x86/xen/platform-pci-unplug.c +++ b/arch/x86/xen/platform-pci-unplug.c @@ -19,6 +19,8 @@ #define XEN_PLATFORM_ERR_PROTOCOL -2 #define XEN_PLATFORM_ERR_BLACKLIST -3 =20 +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + /* store the value of xen_emul_unplug after the unplug is done */ static int xen_platform_pci_unplug; static int xen_emul_unplug; @@ -30,13 +32,13 @@ static int check_platform_magic(void) =20 magic =3D inw(XEN_IOPORT_MAGIC); if (magic !=3D XEN_IOPORT_MAGIC_VAL) { - printk(KERN_ERR "Xen Platform PCI: unrecognised magic value\n"); + pr_err("Xen Platform PCI: unrecognised magic value\n"); return XEN_PLATFORM_ERR_MAGIC; } =20 protocol =3D inb(XEN_IOPORT_PROTOVER); =20 - printk(KERN_DEBUG "Xen Platform PCI: I/O protocol version %d\n", + pr_debug("Xen Platform PCI: I/O protocol version %d\n", protocol); =20 switch (protocol) { @@ -44,12 +46,12 @@ static int check_platform_magic(void) outw(XEN_IOPORT_LINUX_PRODNUM, XEN_IOPORT_PRODNUM); outl(XEN_IOPORT_LINUX_DRVVER, XEN_IOPORT_DRVVER); if (inw(XEN_IOPORT_MAGIC) !=3D XEN_IOPORT_MAGIC_VAL) { - printk(KERN_ERR "Xen Platform: blacklisted by host\n"); + pr_err("Xen Platform: blacklisted by host\n"); return XEN_PLATFORM_ERR_BLACKLIST; } break; default: - printk(KERN_WARNING "Xen Platform PCI: unknown I/O protocol version\n"); + pr_warn("Xen Platform PCI: unknown I/O protocol version\n"); return XEN_PLATFORM_ERR_PROTOCOL; } =20 @@ -155,12 +157,12 @@ void xen_unplug_emulated_devices(void) * been compiled for this kernel (modules or built-in are both OK). */ if (!xen_emul_unplug) { if (xen_must_unplug_nics()) { - printk(KERN_INFO "Netfront and the Xen platform PCI driver have " + pr_info("Netfront and the Xen platform PCI driver have " "been compiled for this kernel: unplug emulated NICs.\n"); xen_emul_unplug |=3D XEN_UNPLUG_ALL_NICS; } if (xen_must_unplug_disks()) { - printk(KERN_INFO "Blkfront and the Xen platform PCI driver have " + pr_info("Blkfront and the Xen platform PCI driver have " "been compiled for this kernel: unplug emulated disks.\n" "You might have to change the root device\n" "from /dev/hd[a-d] to /dev/xvd[a-d]\n" @@ -200,7 +202,7 @@ static int __init parse_xen_emul_unplug(char *arg) else if (!strncmp(p, "never", l)) xen_emul_unplug |=3D XEN_UNPLUG_NEVER; else - printk(KERN_WARNING "unrecognised option '%s' " + pr_warn("unrecognised option '%s' " "in parameter 'xen_emul_unplug'\n", p); } return 0; --=20 2.20.1