[stgt] isns.c: fix compiler warnings

FUJITA Tomonori fujita.tomonori at lab.ntt.co.jp
Mon Apr 2 21:40:38 CEST 2012


On Sat, 31 Mar 2012 23:56:00 +0200
Arne Redlich <arne.redlich at googlemail.com> wrote:

> The get_hdr_param macro is used exuberantly, leading to variables
> that are defined and set but never actually used, as pointed out by
> gcc-4.6.
> 
> Signed-off-by: Arne Redlich <arne.redlich at googlemail.com>
> ---
> 
> Tomo, list,
> 
> This patch is a rather mechanic translation from IET's isns code, and merely compile tested.
> 
> Cheers,
> Arne
> 
>  usr/iscsi/isns.c |   20 ++++++++------------
>  1 files changed, 8 insertions(+), 12 deletions(-)
> 
> 
> diff --git a/usr/iscsi/isns.c b/usr/iscsi/isns.c
> index 1f1852c..452c7af 100644
> --- a/usr/iscsi/isns.c
> +++ b/usr/iscsi/isns.c
> @@ -638,12 +638,10 @@ static int recv_pdu(int fd, struct isns_io *rx, struct isns_hdr *hdr)
>  static char *print_scn_pdu(struct isns_hdr *hdr)
>  {
>  	struct isns_tlv *tlv = (struct isns_tlv *) hdr->pdu;
> -	uint16_t function, length, flags, transaction, sequence;
> +	uint16_t length = ntohs(hdr->length);
>  	char *name = NULL;
>  	static char iscsi_name[224];
>  
> -	get_hdr_param(hdr, function, length, flags, transaction, sequence);

I think that the point of get_hdr_param is putting how to get extract
values from a header into one place. That is, I like to avoid putting
ntohs everywhere.

I guess we had better to drop -Wall?
--
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