From: Brian Norris <computersforpeace@gmail.com>
To: Jens Axboe <axboe@fb.com>
Cc: <linux-kernel@vger.kernel.org>, Boaz Harrosh <boaz@plexistor.com>,
Brian Norris <computersforpeace@gmail.com>,
Christoph Hellwig <hch@infradead.org>
Subject: [PATCH v2] block: remove never-modified global variable
Date: Wed, 20 May 2015 17:32:29 -0700 [thread overview]
Message-ID: <1432168349-30472-1-git-send-email-computersforpeace@gmail.com> (raw)
In-Reply-To: <555C6D70.2080000@plexistor.com>
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.
While removing the 'warn_no_part' check, let's combine a pair of string
cat/print into a single print, and reduce the err/res logic to something
simpler.
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Reviewed-by: Boaz Harrosh <boaz@plexistor.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Jens Axboe <axboe@fb.com>
---
v2:
- combine the cat/print lines
- simplify the err/res logic
block/partitions/amiga.c | 10 ++++------
block/partitions/check.c | 13 +++----------
block/partitions/check.h | 2 --
3 files changed, 7 insertions(+), 18 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, §);
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, §);
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..2f83651692ef 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
@@ -183,15 +181,10 @@ check_partition(struct gendisk *hd, struct block_device *bdev)
err = -ENOSPC;
if (err)
/* 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);
- printk(KERN_INFO "%s", state->pp_buf);
- }
+ printk(KERN_INFO "%s unable to read partition table\n",
+ state->pp_buf);
free_page((unsigned long)state->pp_buf);
free_partitions(state);
- return ERR_PTR(res);
+ return ERR_PTR(err);
}
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
prev parent reply other threads:[~2015-05-21 0:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Brian Norris [this message]
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=1432168349-30472-1-git-send-email-computersforpeace@gmail.com \
--to=computersforpeace@gmail.com \
--cc=axboe@fb.com \
--cc=boaz@plexistor.com \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.