From: John Garry <john.garry@huawei.com>
To: jejb@linux.vnet.ibm.com, martin.petersen@oracle.com
Cc: hare@suse.com, yanaijie@huawei.com, linuxarm@huawei.com,
linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org,
joe@perches.com, John Garry <john.garry@huawei.com>
Subject: [PATCH v2 2/5] scsi: libsas: Use pr_fmt(fmt)
Date: Thu, 15 Nov 2018 18:20:29 +0800 [thread overview]
Message-ID: <1542277232-135789-3-git-send-email-john.garry@huawei.com> (raw)
In-Reply-To: <1542277232-135789-1-git-send-email-john.garry@huawei.com>
In preparation for dropping the libsas printk wrappers, use pr_fmt(fmt)
declaration to add the framework log prefix - "sas".
Suggested-by: Joe Perches <joe@perches.com>
Signed-off-by: John Garry <john.garry@huawei.com>
---
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(-)
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 <scsi/libsas.h>
#include <scsi/sas_ata.h>
-#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 <linux/kernel.h>
#include <linux/export.h>
#include <scsi/sas.h>
--
1.9.1
next prev parent reply other threads:[~2018-11-15 10:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-15 10:20 [PATCH v2 0/5] libsas: Some logging tidy-up John Garry
2018-11-15 10:20 ` [PATCH v2 1/5] scsi: libsas: Delete sas_dump.{c, h} John Garry
2018-11-15 10:20 ` John Garry [this message]
2018-11-15 10:20 ` [PATCH v2 3/5] scsi: libsas: Drop sas_printk() John Garry
2018-11-15 10:20 ` [PATCH v2 4/5] scsi: libsas: Drop SAS_DPRINTK() and revise logs levels John Garry
2018-11-15 10:20 ` [PATCH v2 5/5] scsi: libsas: Remove pcidev reference John Garry
2018-11-15 12:34 ` [PATCH v2 0/5] libsas: Some logging tidy-up Joe Perches
2018-11-15 19:40 ` Martin K. Petersen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1542277232-135789-3-git-send-email-john.garry@huawei.com \
--to=john.garry@huawei.com \
--cc=hare@suse.com \
--cc=jejb@linux.vnet.ibm.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=martin.petersen@oracle.com \
--cc=yanaijie@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox