linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] block: remove never-modified global variable
@ 2015-05-18 23:08 Brian Norris
  2015-05-19  7:19 ` Boaz Harrosh
  0 siblings, 1 reply; 7+ messages in thread
From: Brian Norris @ 2015-05-18 23:08 UTC (permalink / raw)
  To: Jens Axboe; +Cc: Brian Norris, linux-kernel, Christoph Hellwig, Boaz Harrosh

AFAICT, 'warn_no_part' never takes (and never has? at least, not in the
git history) taken a value besides 1. It also has a disgruntled warning
comment next to it, suggesting it shouldn't be there at all.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Boaz Harrosh <boaz@plexistor.com>
Cc: Jens Axboe <axboe@fb.com>
---
Only compile tested for now, as it's trivial. Just an RFC, since I don't really
understand the context of why this (or the comment) is here in the first place.
I just ran across this in code reading.

 block/partitions/amiga.c | 10 ++++------
 block/partitions/check.c |  7 ++-----
 block/partitions/check.h |  2 --
 3 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/block/partitions/amiga.c b/block/partitions/amiga.c
index 2b13533d60a2..9dbf1cec7152 100644
--- a/block/partitions/amiga.c
+++ b/block/partitions/amiga.c
@@ -41,9 +41,8 @@ int amiga_partition(struct parsed_partitions *state)
 			goto rdb_done;
 		data = read_part_sector(state, blk, &sect);
 		if (!data) {
-			if (warn_no_part)
-				pr_err("Dev %s: unable to read RDB block %d\n",
-				       bdevname(state->bdev, b), blk);
+			pr_err("Dev %s: unable to read RDB block %d\n",
+			       bdevname(state->bdev, b), blk);
 			res = -1;
 			goto rdb_done;
 		}
@@ -84,9 +83,8 @@ int amiga_partition(struct parsed_partitions *state)
 		blk *= blksize;	/* Read in terms partition table understands */
 		data = read_part_sector(state, blk, &sect);
 		if (!data) {
-			if (warn_no_part)
-				pr_err("Dev %s: unable to read partition block %d\n",
-				       bdevname(state->bdev, b), blk);
+			pr_err("Dev %s: unable to read partition block %d\n",
+			       bdevname(state->bdev, b), blk);
 			res = -1;
 			goto rdb_done;
 		}
diff --git a/block/partitions/check.c b/block/partitions/check.c
index 16118d11dbfc..513c601b7874 100644
--- a/block/partitions/check.c
+++ b/block/partitions/check.c
@@ -36,8 +36,6 @@
 #include "sysv68.h"
 #include "cmdline.h"
 
-int warn_no_part = 1; /*This is ugly: should make genhd removable media aware*/
-
 static int (*check_part[])(struct parsed_partitions *) = {
 	/*
 	 * Probe partition formats with tables at disk address 0
@@ -185,9 +183,8 @@ check_partition(struct gendisk *hd, struct block_device *bdev)
 	/* The partition is unrecognized. So report I/O errors if there were any */
 		res = err;
 	if (res) {
-		if (warn_no_part)
-			strlcat(state->pp_buf,
-				" unable to read partition table\n", PAGE_SIZE);
+		strlcat(state->pp_buf,
+			" unable to read partition table\n", PAGE_SIZE);
 		printk(KERN_INFO "%s", state->pp_buf);
 	}
 
diff --git a/block/partitions/check.h b/block/partitions/check.h
index eade17ea910b..e09fac216adc 100644
--- a/block/partitions/check.h
+++ b/block/partitions/check.h
@@ -50,5 +50,3 @@ put_partition(struct parsed_partitions *p, int n, sector_t from, sector_t size)
 	}
 }
 
-extern int warn_no_part;
-
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-05-21  0:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-18 23:08 [RFC] block: remove never-modified global variable Brian Norris
2015-05-19  7:19 ` Boaz Harrosh
2015-05-19  7:34   ` Boaz Harrosh
2015-05-19 17:55     ` Brian Norris
2015-05-19 17:58       ` Brian Norris
2015-05-20 11:18         ` Boaz Harrosh
2015-05-21  0:32           ` [PATCH v2] " Brian Norris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).