> Date: Wed, 3 Jul 2013 16:40:17 +0200 (CEST)
> From: Stefan Fritsch <s...@sfritsch.de>
> 
> don't pass empty format string in subr_disk.c
> 
> this is necessary to enable -Wformat or -Wno-error=format

Don't think this one makes much sense.  Better to just do:

  log(pri, "%s", "");

and keep the rest of the code as it is.  Not sure what the static
const trickery was necessary for though.

> ---
>  sys/kern/subr_disk.c |   11 ++++++-----
>  1 files changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git sys/kern/subr_disk.c sys/kern/subr_disk.c
> index 4b500c1..2b1036a 100644
> --- sys/kern/subr_disk.c
> +++ sys/kern/subr_disk.c
> @@ -761,13 +761,14 @@ diskerr(struct buf *bp, char *dname, char *what, int 
> pri, int blkdone,
>       daddr_t sn;
>  
>       if (pri != LOG_PRINTF) {
> -             static const char fmt[] = "";
> -             log(pri, fmt);
> +             log(pri, "%s%d%c: %s %sing fsbn ", dname, unit, partname, what,
> +                 bp->b_flags & B_READ ? "read" : "writ");
>               pr = addlog;
> -     } else
> +     } else {
> +             printf("%s%d%c: %s %sing fsbn ", dname, unit, partname, what,
> +                 bp->b_flags & B_READ ? "read" : "writ");
>               pr = printf;
> -     (*pr)("%s%d%c: %s %sing fsbn ", dname, unit, partname, what,
> -         bp->b_flags & B_READ ? "read" : "writ");
> +     }
>       sn = bp->b_blkno;
>       if (bp->b_bcount <= DEV_BSIZE)
>               (*pr)("%lld", sn);
> -- 
> 1.7.6
> 
> 
> 

Reply via email to