Skip to content

Commit

Permalink
drivers/firmware/iscsi_ibft.c: remove NIPQUAD_FMT, use %pI4
Browse files Browse the repository at this point in the history
Convert netmask to __be32 and format it with %pI4

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Konrad Rzeszutek <ketuzsezr@darnok.org>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Cc: Peter Jones <pjones@redhat.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
  • Loading branch information
Joe Perches authored and Konrad Rzeszutek Wilk committed Feb 26, 2010
1 parent 6ebdc66 commit 00e7825
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions drivers/firmware/iscsi_ibft.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ static ssize_t ibft_attr_show_nic(struct ibft_kobject *entry,
void *ibft_loc = entry->header;
char *str = buf;
char *mac;
int val;
__be32 val;

if (!nic)
return 0;
Expand All @@ -397,10 +397,8 @@ static ssize_t ibft_attr_show_nic(struct ibft_kobject *entry,
str += sprintf_ipaddr(str, nic->ip_addr);
break;
case ibft_eth_subnet_mask:
val = ~((1 << (32-nic->subnet_mask_prefix))-1);
str += sprintf(str, NIPQUAD_FMT,
(u8)(val >> 24), (u8)(val >> 16),
(u8)(val >> 8), (u8)(val));
val = cpu_to_be32(~((1 << (32-nic->subnet_mask_prefix))-1));
str += sprintf(str, "%pI4", &val);
break;
case ibft_eth_origin:
str += sprintf(str, "%d\n", nic->origin);
Expand Down

0 comments on commit 00e7825

Please sign in to comment.