Skip to contentSkip to conversation

block: Use pr_info() instead of printk(KERN_INFO ...)

PATCH Applied Bart Van Assche 3 participants 3 messages Dec 13, 2023 – Dec 14, 2023 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block: Use pr_info() instead of printk(KERN_INFO ...)

Switch to the modern style of printing kernel messages. Use %u instead of %d to print unsigned integers.

---
 block/blk-settings.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
block/blk-settings.c +4 -8
index 0046b447268f..09e3a4d5e4d2 100644
@@ -127,8 +127,7 @@ void blk_queue_max_hw_sectors(struct request_queue *q, unsigned int max_hw_secto
 
 	if ((max_hw_sectors << 9) < PAGE_SIZE) {
 		max_hw_sectors = 1 << (PAGE_SHIFT - 9);
-		printk(KERN_INFO "%s: set to minimum %d\n",
-		       __func__, max_hw_sectors);
+		pr_info("%s: set to minimum %u\n", __func__, max_hw_sectors);
 	}
 
 	max_hw_sectors = round_down(max_hw_sectors,
@@ -248,8 +247,7 @@ void blk_queue_max_segments(struct request_queue *q, unsigned short max_segments
 {
 	if (!max_segments) {
 		max_segments = 1;
-		printk(KERN_INFO "%s: set to minimum %d\n",
-		       __func__, max_segments);
+		pr_info("%s: set to minimum %u\n", __func__, max_segments);
 	}
 
 	q->limits.max_segments = max_segments;
@@ -285,8 +283,7 @@ void blk_queue_max_segment_size(struct request_queue *q, unsigned int max_size)
 {
 	if (max_size < PAGE_SIZE) {
 		max_size = PAGE_SIZE;
-		printk(KERN_INFO "%s: set to minimum %d\n",
-		       __func__, max_size);
+		pr_info("%s: set to minimum %u\n", __func__, max_size);
 	}
 
 	/* see blk_queue_virt_boundary() for the explanation */
@@ -740,8 +737,7 @@ void blk_queue_segment_boundary(struct request_queue *q, unsigned long mask)
 {
 	if (mask < PAGE_SIZE - 1) {
 		mask = PAGE_SIZE - 1;
-		printk(KERN_INFO "%s: set to minimum %lx\n",
-		       __func__, mask);
+		pr_info("%s: set to minimum %lx\n", __func__, mask);
 	}
 
 	q->limits.seg_boundary_mask = mask;
Reviewed-by on v1 1/1
#1 lore raw
Quoted 2 lines · Bart Van Assche

Switch to the modern style of printing kernel messages. Use %u instead of %d to print unsigned integers.

Looks good.

maintainer Applied
#2 lore raw
In reply to Bart Van Assche
Quoted 4 lines · Bart Van Assche

Switch to the modern style of printing kernel messages. Use %u instead of %d to print unsigned integers.

Applied, thanks!

[1/1] block: Use pr_info() instead of printk(KERN_INFO ...)

      commit: f19d1e3b17acc8173cd83b189f4c9506889b1c49

Best regards,

Signature · 1 line
Jens Axboe