From patchwork Thu Nov 15 10:20:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 151222 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp6809030ljp; Thu, 15 Nov 2018 02:19:47 -0800 (PST) X-Google-Smtp-Source: AJdET5dk0MeCXQ0crFBYOdsd9PxIQFurbk6zU+GMlIpIsfRAZ8ldK5CWnYT/FcAO+yjE/REIDXdN X-Received: by 2002:a17:902:9698:: with SMTP id n24-v6mr5818890plp.9.1542277187796; Thu, 15 Nov 2018 02:19:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542277187; cv=none; d=google.com; s=arc-20160816; b=h6hGqFzghe0CyMERcHvycik0PPiZ5woQHy/U6zbGsIVBvO/6zPNFkdJs+/4CWXhpnw ZIL6wY8y3rF1nv+jIWvL3IempuNEM9Y0Y3waOrTSTiEIk8pURVdUQz763fpYRbpW+SJY yMopHBejTHOep/tG0PnzhPqC9m8iFR5iS/84B6pE2jzGOv1rVFMzQPHjY0aKg3Su3jKr p4cm1hvUzGIH+3TyY5atibjD77QOqOUydydkscAdSVjuSUbdDe+wrIlgzTHkubmFLRhI QODCbUGn2s4UdzPYURKBRG3KAy+z7eYbCZUVeFR7rMHiswOza3/T3sI8uKx8hvV6q1Z5 iB4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=/DmMGq/Lh6Fl9M98kAt5/EVXgYd/iA+AHrQFgy8vkYs=; b=CDlezfrbJZB+WEvhg7QSM6B9rjtBaYR/MJCKgxGCGB9tkqYiHK/StGAuQsmsbM0YUB KEOavRw57HrwI170ZN3XVq7M5Dj0TeLxnCVWeiZfXXtQX7l9vQSBhzjF0qmSZLHKj+oP i2Fpm9utcuwMnKy9JPfhDEUPIUDd+sVpbsmJrGbJo09HnlEm3sOIUknHsltPkLBFQAxl AzAvfLRkAl/q00SkXt94VcjwVi96JY0EtXgLiO/9icpHR+Q6jaaMj+8nmwaHIcr/IYMV 9jpR7oI5xyuwf2jcRXvzBHt9/5HwaTxbYGXDOgJVNYLwdQTFVT7uhdJUWQUIMmioo1Gn CMLA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a195si6993329pfd.143.2018.11.15.02.19.47; Thu, 15 Nov 2018 02:19:47 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388231AbeKOU05 (ORCPT + 32 others); Thu, 15 Nov 2018 15:26:57 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:14665 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728801AbeKOU0e (ORCPT ); Thu, 15 Nov 2018 15:26:34 -0500 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 4D2DE73D9FC37; Thu, 15 Nov 2018 18:19:14 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.408.0; Thu, 15 Nov 2018 18:19:08 +0800 From: John Garry To: , CC: , , , , , , John Garry Subject: [PATCH v2 2/5] scsi: libsas: Use pr_fmt(fmt) Date: Thu, 15 Nov 2018 18:20:29 +0800 Message-ID: <1542277232-135789-3-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1542277232-135789-1-git-send-email-john.garry@huawei.com> References: <1542277232-135789-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In preparation for dropping the libsas printk wrappers, use pr_fmt(fmt) declaration to add the framework log prefix - "sas". Suggested-by: Joe Perches Signed-off-by: John Garry --- drivers/scsi/libsas/sas_ata.c | 2 +- drivers/scsi/libsas/sas_internal.h | 13 +++++++++++-- drivers/scsi/libsas/sas_task.c | 3 +++ 3 files changed, 15 insertions(+), 3 deletions(-) -- 1.9.1 diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c index 4f6cdf5..9f3521f 100644 --- a/drivers/scsi/libsas/sas_ata.c +++ b/drivers/scsi/libsas/sas_ata.c @@ -375,7 +375,7 @@ static int sas_ata_printk(const char *level, const struct domain_device *ddev, vaf.fmt = fmt; vaf.va = &args; - r = printk("%ssas: ata%u: %s: %pV", + r = printk("%s" SAS_FMT "ata%u: %s: %pV", level, ap->print_id, dev_name(dev), &vaf); va_end(args); diff --git a/drivers/scsi/libsas/sas_internal.h b/drivers/scsi/libsas/sas_internal.h index 50e12d6..94ebf41 100644 --- a/drivers/scsi/libsas/sas_internal.h +++ b/drivers/scsi/libsas/sas_internal.h @@ -32,9 +32,18 @@ #include #include -#define sas_printk(fmt, ...) printk(KERN_NOTICE "sas: " fmt, ## __VA_ARGS__) +#ifdef pr_fmt +#undef pr_fmt +#endif + +#define SAS_FMT "sas: " + +#define pr_fmt(fmt) SAS_FMT fmt + +#define sas_printk(fmt, ...) printk(KERN_NOTICE fmt, ## __VA_ARGS__) + +#define SAS_DPRINTK(fmt, ...) printk(KERN_DEBUG fmt, ## __VA_ARGS__) -#define SAS_DPRINTK(fmt, ...) printk(KERN_DEBUG "sas: " fmt, ## __VA_ARGS__) #define TO_SAS_TASK(_scsi_cmd) ((void *)(_scsi_cmd)->host_scribble) #define ASSIGN_SAS_TASK(_sc, _t) do { (_sc)->host_scribble = (void *) _t; } while (0) diff --git a/drivers/scsi/libsas/sas_task.c b/drivers/scsi/libsas/sas_task.c index a78e5bd..d305c8f 100644 --- a/drivers/scsi/libsas/sas_task.c +++ b/drivers/scsi/libsas/sas_task.c @@ -1,3 +1,6 @@ + +#include "sas_internal.h" + #include #include #include