diff options
Diffstat (limited to 'drivers/firmware/iscsi_ibft.c')
-rw-r--r-- | drivers/firmware/iscsi_ibft.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c index 5aeb3b541c80..a3600e3ed0fa 100644 --- a/drivers/firmware/iscsi_ibft.c +++ b/drivers/firmware/iscsi_ibft.c | |||
@@ -380,7 +380,7 @@ static ssize_t ibft_attr_show_nic(struct ibft_kobject *entry, | |||
380 | struct ibft_nic *nic = entry->nic; | 380 | struct ibft_nic *nic = entry->nic; |
381 | void *ibft_loc = entry->header; | 381 | void *ibft_loc = entry->header; |
382 | char *str = buf; | 382 | char *str = buf; |
383 | int val; | 383 | __be32 val; |
384 | 384 | ||
385 | if (!nic) | 385 | if (!nic) |
386 | return 0; | 386 | return 0; |
@@ -396,10 +396,8 @@ static ssize_t ibft_attr_show_nic(struct ibft_kobject *entry, | |||
396 | str += sprintf_ipaddr(str, nic->ip_addr); | 396 | str += sprintf_ipaddr(str, nic->ip_addr); |
397 | break; | 397 | break; |
398 | case ibft_eth_subnet_mask: | 398 | case ibft_eth_subnet_mask: |
399 | val = ~((1 << (32-nic->subnet_mask_prefix))-1); | 399 | val = cpu_to_be32(~((1 << (32-nic->subnet_mask_prefix))-1)); |
400 | str += sprintf(str, NIPQUAD_FMT, | 400 | str += sprintf(str, "%pI4", &val); |
401 | (u8)(val >> 24), (u8)(val >> 16), | ||
402 | (u8)(val >> 8), (u8)(val)); | ||
403 | break; | 401 | break; |
404 | case ibft_eth_origin: | 402 | case ibft_eth_origin: |
405 | str += sprintf(str, "%d\n", nic->origin); | 403 | str += sprintf(str, "%d\n", nic->origin); |