null_blk: format pr_* logs with pr_fmt
authorAndré Almeida <andrealmeid@collabora.com>
Mon, 16 Sep 2019 14:07:59 +0000 (11:07 -0300)
committerJens Axboe <axboe@kernel.dk>
Mon, 16 Sep 2019 14:38:29 +0000 (08:38 -0600)
Instead of writing "null_blk: " at the beginning of each
pr_err/info/warn log message, format messages using pr_fmt() macro.

Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: André Almeida <andrealmeid@collabora.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/null_blk.h
drivers/block/null_blk_main.c
drivers/block/null_blk_zoned.c

index 6fa3c07af63aee70d9577f011070e194edd43500..a235c45e22a70c7bb046bb1d897b74adba595727 100644 (file)
@@ -2,6 +2,9 @@
 #ifndef __BLK_NULL_BLK_H
 #define __BLK_NULL_BLK_H
 
+#undef pr_fmt
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/blkdev.h>
 #include <linux/slab.h>
 #include <linux/blk-mq.h>
@@ -96,7 +99,7 @@ blk_status_t null_handle_zoned(struct nullb_cmd *cmd,
 #else
 static inline int null_zone_init(struct nullb_device *dev)
 {
-       pr_err("null_blk: CONFIG_BLK_DEV_ZONED not enabled\n");
+       pr_err("CONFIG_BLK_DEV_ZONED not enabled\n");
        return -EINVAL;
 }
 static inline void null_zone_exit(struct nullb_device *dev) {}
index 4caa18afa3a227b3d2c94ab0b2fc2983b69a30e0..0e7da5015ccd5f8a7d6314d24eb8bfd52b15d4c9 100644 (file)
@@ -1315,7 +1315,7 @@ static bool should_requeue_request(struct request *rq)
 
 static enum blk_eh_timer_return null_timeout_rq(struct request *rq, bool res)
 {
-       pr_info("null_blk: rq %p timed out\n", rq);
+       pr_info("rq %p timed out\n", rq);
        blk_mq_complete_request(rq);
        return BLK_EH_DONE;
 }
@@ -1748,28 +1748,28 @@ static int __init null_init(void)
        struct nullb_device *dev;
 
        if (g_bs > PAGE_SIZE) {
-               pr_warn("null_blk: invalid block size\n");
-               pr_warn("null_blk: defaults block size to %lu\n", PAGE_SIZE);
+               pr_warn("invalid block size\n");
+               pr_warn("defaults block size to %lu\n", PAGE_SIZE);
                g_bs = PAGE_SIZE;
        }
 
        if (!is_power_of_2(g_zone_size)) {
-               pr_err("null_blk: zone_size must be power-of-two\n");
+               pr_err("zone_size must be power-of-two\n");
                return -EINVAL;
        }
 
        if (g_home_node != NUMA_NO_NODE && g_home_node >= nr_online_nodes) {
-               pr_err("null_blk: invalid home_node value\n");
+               pr_err("invalid home_node value\n");
                g_home_node = NUMA_NO_NODE;
        }
 
        if (g_queue_mode == NULL_Q_RQ) {
-               pr_err("null_blk: legacy IO path no longer available\n");
+               pr_err("legacy IO path no longer available\n");
                return -EINVAL;
        }
        if (g_queue_mode == NULL_Q_MQ && g_use_per_node_hctx) {
                if (g_submit_queues != nr_online_nodes) {
-                       pr_warn("null_blk: submit_queues param is set to %u.\n",
+                       pr_warn("submit_queues param is set to %u.\n",
                                                        nr_online_nodes);
                        g_submit_queues = nr_online_nodes;
                }
@@ -1812,7 +1812,7 @@ static int __init null_init(void)
                }
        }
 
-       pr_info("null_blk: module loaded\n");
+       pr_info("module loaded\n");
        return 0;
 
 err_dev:
index c07a05315e25d3f95c302add3a4a9f359a97ddd3..eabc116832a7ea47f22d4634926b521ce7206002 100644 (file)
@@ -17,7 +17,7 @@ int null_zone_init(struct nullb_device *dev)
        unsigned int i;
 
        if (!is_power_of_2(dev->zone_size)) {
-               pr_err("null_blk: zone_size must be power-of-two\n");
+               pr_err("zone_size must be power-of-two\n");
                return -EINVAL;
        }
 
@@ -31,7 +31,7 @@ int null_zone_init(struct nullb_device *dev)
 
        if (dev->zone_nr_conv >= dev->nr_zones) {
                dev->zone_nr_conv = dev->nr_zones - 1;
-               pr_info("null_blk: changed the number of conventional zones to %u",
+               pr_info("changed the number of conventional zones to %u",
                        dev->zone_nr_conv);
        }