[stgt] [PATCH 03/15] tgt: Fix eprintf warnings

FUJITA Tomonori fujita.tomonori at lab.ntt.co.jp
Mon Mar 2 08:08:38 CET 2009


On Sun,  1 Mar 2009 18:48:04 +0200
Boaz Harrosh <bharrosh at panasas.com> wrote:

> inttypes.h's PRIu64 is busted and gives warnings on my platform
> (Vanilla FC10). Handle that like in kernel with unsigned_long_long
> cast.
> 
> And another place that needed an "%zu"
> 
> Signed-off-by: Boaz Harrosh <bharrosh at panasas.com>
> ---
>  usr/fcoe/fcoe_dev.c |    2 +-
>  usr/tgtif.c         |    5 +++--
>  2 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/usr/fcoe/fcoe_dev.c b/usr/fcoe/fcoe_dev.c
> index 2d0149c..e5ebf8a 100644
> --- a/usr/fcoe/fcoe_dev.c
> +++ b/usr/fcoe/fcoe_dev.c
> @@ -248,7 +248,7 @@ int fcoe_rcv(struct fcdev *fdev)
>  	hlen = fc->fcoe_hlen;
>  	if (hlen != sizeof(struct fcoe_hdr)) {
>  		eprintf("Wrong fcoe header size. Got %u, but should "
> -			"be %u. Make sure you are using a initiator that "
> +			"be %zu. Make sure you are using a initiator that "

This is fine.

>  			"is using the current header format\n",
>  			hlen, sizeof(struct fcoe_hdr));
>  		stats->ErrorFrames++;
> diff --git a/usr/tgtif.c b/usr/tgtif.c
> index fd5ad5b..adf70a4 100644
> --- a/usr/tgtif.c
> +++ b/usr/tgtif.c
> @@ -246,8 +246,9 @@ static void kern_cmd_done(struct tgt_event *ev)
>  		}
>  		free(KCMD(cmd));
>  	} else
> -		eprintf("unknow command %d %" PRIu64 " %" PRIu64 "\n",
> -			tid, ev->p.cmd_done.itn_id, ev->p.cmd_done.tag);
> +		eprintf("unknow command %d %llu %llu\n", tid,
> +			(unsigned long long)ev->p.cmd_done.itn_id,
> +			(unsigned long long)ev->p.cmd_done.tag);

PRIu64 should work. If not, you should ask FC people to fix it instead
adding a hacky workaround. And as you know, even kernel developers
will remove this 'unsigned long long' hack soon. This hack is really
wrong.
--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the stgt mailing list