* [GIT PULL] floppy
@ 2014-06-18 12:07 Jiri Kosina
2014-06-18 17:30 ` Jens Axboe
2014-06-18 18:44 ` [PATCH] floppy: Neaten message logging Joe Perches
0 siblings, 2 replies; 6+ messages in thread
From: Jiri Kosina @ 2014-06-18 12:07 UTC (permalink / raw)
To: Jens Axboe; +Cc: linux-kernel
Jens,
please pull from
git://git.kernel.org/pub/scm/linux/kernel/git/jikos/linux-block.git for-jens
to receive formatting fix for floppy driver; preferably for 3.16 still.
The branch is based on your for-3.16/drivers.
Thanks!
----------------------------------------------------------------
Jiri Kosina (1):
floppy: format block0 read error message properly
drivers/block/floppy.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [GIT PULL] floppy
2014-06-18 12:07 [GIT PULL] floppy Jiri Kosina
@ 2014-06-18 17:30 ` Jens Axboe
2014-06-18 21:35 ` Jiri Kosina
2014-06-18 18:44 ` [PATCH] floppy: Neaten message logging Joe Perches
1 sibling, 1 reply; 6+ messages in thread
From: Jens Axboe @ 2014-06-18 17:30 UTC (permalink / raw)
To: Jiri Kosina; +Cc: linux-kernel
On 2014-06-18 05:07, Jiri Kosina wrote:
> Jens,
>
> please pull from
>
> git://git.kernel.org/pub/scm/linux/kernel/git/jikos/linux-block.git for-jens
>
> to receive formatting fix for floppy driver; preferably for 3.16 still.
> The branch is based on your for-3.16/drivers.
I'll queue it up for 3.16. Just sent out a pull request, but I'm sure
there will be a later one in this cycle as well.
--
Jens Axboe
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] floppy: Neaten message logging
2014-06-18 12:07 [GIT PULL] floppy Jiri Kosina
2014-06-18 17:30 ` Jens Axboe
@ 2014-06-18 18:44 ` Joe Perches
2014-06-18 21:59 ` Jiri Kosina
1 sibling, 1 reply; 6+ messages in thread
From: Joe Perches @ 2014-06-18 18:44 UTC (permalink / raw)
To: Jiri Kosina; +Cc: Jens Axboe, linux-kernel
Use a more current style to prefix "floppy: " on
all messages.
Convert DPRINT to emit at KERN_DEBUG.
Other miscellaneous logging changes:
o Add missing newline
o Remove embedded "floppy" style prefixes
o Remove trailing periods to standardize style
o Consolidate two logging lines into one
o Convert args... to ... and ##__VA_ARGS__
Signed-off-by: Joe Perches <joe@perches.com>
---
On Wed, 2014-06-18 at 14:07 +0200, Jiri Kosina wrote:
> floppy: format block0 read error message properly
This could also probably use a pr_fmt so that
all the messages are prefixed.
drivers/block/floppy.c | 58 +++++++++++++++++++++++++-------------------------
1 file changed, 29 insertions(+), 29 deletions(-)
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index 56d46ff..168c42d 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -144,22 +144,25 @@
* Better audit of register_blkdev.
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#undef FLOPPY_SILENT_DCL_CLEAR
#define REALLY_SLOW_IO
#define DEBUGT 2
-#define DPRINT(format, args...) \
- pr_info("floppy%d: " format, current_drive, ##args)
+#define DPRINT(format, ...) \
+ printk(KERN_DEBUG KBUILD_MODNAME "%d: " format, \
+ current_drive, ##__VA_ARGS__)
#define DCL_DEBUG /* debug disk change line */
#ifdef DCL_DEBUG
-#define debug_dcl(test, fmt, args...) \
- do { if ((test) & FD_DEBUG) DPRINT(fmt, ##args); } while (0)
+#define debug_dcl(test, fmt, ...) \
+ do { if ((test) & FD_DEBUG) DPRINT(fmt, ##__VA_ARGS__); } while (0)
#else
-#define debug_dcl(test, fmt, args...) \
- do { if (0) DPRINT(fmt, ##args); } while (0)
+#define debug_dcl(test, fmt, ...) \
+ do { if (0) DPRINT(fmt, ##__VA_ARGS__); } while (0)
#endif
/* do print messages for unexpected interrupts */
@@ -1213,7 +1216,7 @@ static void perpendicular_mode(void)
output_byte(perp_mode);
FDCS->perp_mode = perp_mode;
} else if (perp_mode) {
- DPRINT("perpendicular mode not supported by this FDC.\n");
+ DPRINT("perpendicular mode not supported by this FDC\n");
}
} /* perpendicular_mode */
@@ -1686,7 +1689,7 @@ irqreturn_t floppy_interrupt(int irq, void *dev_id)
if (fdc >= N_FDC || FDCS->address == -1) {
/* we don't even know which FDC is the culprit */
pr_info("DOR0=%x\n", fdc_state[0].dor);
- pr_info("floppy interrupt on bizarre fdc %d\n", fdc);
+ pr_info("interrupt on bizarre fdc %d\n", fdc);
pr_info("handler=%pf\n", handler);
is_alive(__func__, "bizarre fdc");
return IRQ_NONE;
@@ -1784,9 +1787,8 @@ static void show_floppy(void)
{
int i;
- pr_info("\n");
- pr_info("floppy driver state\n");
- pr_info("-------------------\n");
+ pr_info("driver state\n");
+ pr_info("------------\n");
pr_info("now=%lu last interrupt=%lu diff=%lu last called handler=%pf\n",
jiffies, interruptjiffies, jiffies - interruptjiffies,
lasthandler);
@@ -1800,7 +1802,7 @@ static void show_floppy(void)
output_log[(i + output_log_pos) % OLOGSIZE].jiffies);
pr_info("last result at %lu\n", resultjiffies);
pr_info("last redo_fd_request at %lu\n", lastredo);
- print_hex_dump(KERN_INFO, "", DUMP_PREFIX_NONE, 16, 1,
+ print_hex_dump(KERN_INFO, KBUILD_MODNAME ": ", DUMP_PREFIX_NONE, 16, 1,
reply_buffer, resultsize, true);
pr_info("status=%x\n", fd_inb(FD_STATUS));
@@ -1821,7 +1823,6 @@ static void show_floppy(void)
pr_info("cont=%p\n", cont);
pr_info("current_req=%p\n", current_req);
pr_info("command_status=%d\n", command_status);
- pr_info("\n");
}
static void floppy_shutdown(struct work_struct *arg)
@@ -1839,7 +1840,7 @@ static void floppy_shutdown(struct work_struct *arg)
/* avoid dma going to a random drive after shutdown */
if (initialized)
- DPRINT("floppy timeout called\n");
+ DPRINT("timeout called\n");
FDCS->reset = 1;
if (cont) {
cont->done(0);
@@ -1919,7 +1920,7 @@ static void floppy_ready(void)
static void floppy_start(void)
{
- reschedule_timeout(current_reqD, "floppy start");
+ reschedule_timeout(current_reqD, "start");
scandrives();
debug_dcl(DP->flags, "setting NEWCHANGE in floppy_start\n");
@@ -2233,7 +2234,7 @@ static void request_done(int uptodate)
reschedule_timeout(MAXTIMEOUT, msg);
if (!req) {
- pr_info("floppy.c: no request in request_done\n");
+ pr_info("no request in request_done\n");
return;
}
@@ -2680,9 +2681,8 @@ static int make_raw_rw_request(void)
raw_cmd->kernel_data = bio_data(current_req->bio);
raw_cmd->length = current_count_sectors << 9;
if (raw_cmd->length == 0) {
- DPRINT("%s: zero dma transfer attempted\n", __func__);
- DPRINT("indirect=%d direct=%d fsector_t=%d\n",
- indirect, direct, fsector_t);
+ DPRINT("%s: zero dma transfer attempted - indirect=%d direct=%d fsector_t=%d\n",
+ __func__, indirect, direct, fsector_t);
return 0;
}
virtualdmabug_workaround();
@@ -3604,7 +3604,7 @@ static void __init config_types(void)
if (!has_drive) {
prepend = "";
has_drive = true;
- pr_info("Floppy drive(s):");
+ pr_info("drive(s):");
} else {
prepend = ",";
}
@@ -3625,7 +3625,7 @@ static void floppy_release(struct gendisk *disk, fmode_t mode)
mutex_lock(&floppy_mutex);
mutex_lock(&open_lock);
if (!UDRS->fd_ref--) {
- DPRINT("floppy_release with fd_ref == 0");
+ DPRINT("floppy_release with fd_ref == 0\n");
UDRS->fd_ref = 0;
}
if (!UDRS->fd_ref)
@@ -3777,7 +3777,7 @@ static void floppy_rb0_cb(struct bio *bio, int err)
int drive = cbdata->drive;
if (err) {
- pr_info("floppy: error %d while reading block 0\n", err);
+ pr_info("error %d while reading block 0\n", err);
set_bit(FD_OPEN_SHOULD_FAIL_BIT, &UDRS->flags);
}
complete(&cbdata->complete);
@@ -3905,7 +3905,7 @@ static char __init get_fdc_version(void)
return FDC_8272A; /* 8272a/765 don't know DUMPREGS */
}
if (r != 10) {
- pr_info("FDC %d init: DUMPREGS: unexpected return of %d bytes.\n",
+ pr_info("FDC %d init: DUMPREGS: unexpected return of %d bytes\n",
fdc, r);
return FDC_UNKNOWN;
}
@@ -3931,14 +3931,14 @@ static char __init get_fdc_version(void)
* LOCK/UNLOCK */
}
if ((r != 1) || (reply_buffer[0] != 0x00)) {
- pr_info("FDC %d init: UNLOCK: unexpected return of %d bytes.\n",
+ pr_info("FDC %d init: UNLOCK: unexpected return of %d bytes\n",
fdc, r);
return FDC_UNKNOWN;
}
output_byte(FD_PARTID);
r = result();
if (r != 1) {
- pr_info("FDC %d init: PARTID: unexpected return of %d bytes.\n",
+ pr_info("FDC %d init: PARTID: unexpected return of %d bytes\n",
fdc, r);
return FDC_UNKNOWN;
}
@@ -3949,7 +3949,7 @@ static char __init get_fdc_version(void)
switch (reply_buffer[0] >> 5) {
case 0x0:
/* Either a 82078-1 or a 82078SL running at 5Volt */
- pr_info("FDC %d is an 82078.\n", fdc);
+ pr_info("FDC %d is an 82078\n", fdc);
return FDC_82078;
case 0x1:
pr_info("FDC %d is a 44pin 82078\n", fdc);
@@ -3961,7 +3961,7 @@ static char __init get_fdc_version(void)
pr_info("FDC %d is a National Semiconductor PC87306\n", fdc);
return FDC_87306;
default:
- pr_info("FDC %d init: 82078 variant with unknown PARTID=%d.\n",
+ pr_info("FDC %d init: 82078 variant with unknown PARTID=%d\n",
fdc, reply_buffer[0] >> 5);
return FDC_82078_UNKN;
}
@@ -4423,7 +4423,7 @@ static int floppy_request_regions(int fdc)
for (p = io_regions; p < ARRAY_END(io_regions); p++) {
if (!request_region(FDCS->address + p->offset,
p->size, "floppy")) {
- DPRINT("Floppy io-port 0x%04lx in use\n",
+ DPRINT("io-port 0x%04lx in use\n",
FDCS->address + p->offset);
floppy_release_allocated_regions(fdc, p);
return -EBUSY;
@@ -4538,7 +4538,7 @@ static void floppy_release_irq_and_dma(void)
#endif
if (delayed_work_pending(&fd_timeout))
- pr_info("floppy timer still active:%s\n", timeout_message);
+ pr_info("timer still active: %s\n", timeout_message);
if (delayed_work_pending(&fd_timer))
pr_info("auxiliary floppy timer still active\n");
if (work_pending(&floppy_work))
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [GIT PULL] floppy
2014-06-18 17:30 ` Jens Axboe
@ 2014-06-18 21:35 ` Jiri Kosina
0 siblings, 0 replies; 6+ messages in thread
From: Jiri Kosina @ 2014-06-18 21:35 UTC (permalink / raw)
To: Jens Axboe; +Cc: linux-kernel
On Wed, 18 Jun 2014, Jens Axboe wrote:
> > please pull from
> >
> > git://git.kernel.org/pub/scm/linux/kernel/git/jikos/linux-block.git
> > for-jens
> >
> > to receive formatting fix for floppy driver; preferably for 3.16 still.
> > The branch is based on your for-3.16/drivers.
>
> I'll queue it up for 3.16. Just sent out a pull request, but I'm sure there
> will be a later one in this cycle as well.
Ah, now I see I just raced with your pull request. I can resend it again
in a couple of days if you wish.
And, if it ends up in 3.17, no harm caused really (which is true for
almost any patch to floppy driver anyway :) ).
Thanks,
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] floppy: Neaten message logging
2014-06-18 18:44 ` [PATCH] floppy: Neaten message logging Joe Perches
@ 2014-06-18 21:59 ` Jiri Kosina
2014-06-18 22:09 ` Joe Perches
0 siblings, 1 reply; 6+ messages in thread
From: Jiri Kosina @ 2014-06-18 21:59 UTC (permalink / raw)
To: Joe Perches; +Cc: Jens Axboe, linux-kernel
On Wed, 18 Jun 2014, Joe Perches wrote:
> Use a more current style to prefix "floppy: " on
> all messages.
>
> Convert DPRINT to emit at KERN_DEBUG.
>
> Other miscellaneous logging changes:
>
> o Add missing newline
> o Remove embedded "floppy" style prefixes
Why is this a good change?
[ ... ]
> if (!req) {
> - pr_info("floppy.c: no request in request_done\n");
> + pr_info("no request in request_done\n");
I think that in cases like this (and elsewhere where you are changing it
in your patch) the prefix is actually useful.
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] floppy: Neaten message logging
2014-06-18 21:59 ` Jiri Kosina
@ 2014-06-18 22:09 ` Joe Perches
0 siblings, 0 replies; 6+ messages in thread
From: Joe Perches @ 2014-06-18 22:09 UTC (permalink / raw)
To: Jiri Kosina; +Cc: Jens Axboe, linux-kernel
On Wed, 2014-06-18 at 23:59 +0200, Jiri Kosina wrote:
> On Wed, 18 Jun 2014, Joe Perches wrote:
>
> > Use a more current style to prefix "floppy: " on
> > all messages.
> >
> > Convert DPRINT to emit at KERN_DEBUG.
> >
> > Other miscellaneous logging changes:
> >
> > o Add missing newline
> > o Remove embedded "floppy" style prefixes
>
> Why is this a good change?
>
> [ ... ]
> > if (!req) {
> > - pr_info("floppy.c: no request in request_done\n");
> > + pr_info("no request in request_done\n");
>
> I think that in cases like this (and elsewhere where you are changing it
> in your patch) the prefix is actually useful.
Adding
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
makes sure that all printks from this module
are prefixed with "floppy: ".
Currently, only a very few actually are prefixed
with anything and there are some prefix mixtures of
"floppy: " and "floppy.c: "
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-06-18 22:09 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-18 12:07 [GIT PULL] floppy Jiri Kosina
2014-06-18 17:30 ` Jens Axboe
2014-06-18 21:35 ` Jiri Kosina
2014-06-18 18:44 ` [PATCH] floppy: Neaten message logging Joe Perches
2014-06-18 21:59 ` Jiri Kosina
2014-06-18 22:09 ` Joe Perches
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox