aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firmware/iscsi_ibft.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/firmware/iscsi_ibft.c')
-rw-r--r--drivers/firmware/iscsi_ibft.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c
index 051d1ebbd287..ed2801c378de 100644
--- a/drivers/firmware/iscsi_ibft.c
+++ b/drivers/firmware/iscsi_ibft.c
@@ -380,8 +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 char *mac; 383 __be32 val;
384 int val;
385 384
386 if (!nic) 385 if (!nic)
387 return 0; 386 return 0;
@@ -397,10 +396,8 @@ static ssize_t ibft_attr_show_nic(struct ibft_kobject *entry,
397 str += sprintf_ipaddr(str, nic->ip_addr); 396 str += sprintf_ipaddr(str, nic->ip_addr);
398 break; 397 break;
399 case ibft_eth_subnet_mask: 398 case ibft_eth_subnet_mask:
400 val = ~((1 << (32-nic->subnet_mask_prefix))-1); 399 val = cpu_to_be32(~((1 << (32-nic->subnet_mask_prefix))-1));
401 str += sprintf(str, NIPQUAD_FMT, 400 str += sprintf(str, "%pI4", &val);
402 (u8)(val >> 24), (u8)(val >> 16),
403 (u8)(val >> 8), (u8)(val));
404 break; 401 break;
405 case ibft_eth_origin: 402 case ibft_eth_origin:
406 str += sprintf(str, "%d\n", nic->origin); 403 str += sprintf(str, "%d\n", nic->origin);
@@ -421,10 +418,7 @@ static ssize_t ibft_attr_show_nic(struct ibft_kobject *entry,
421 str += sprintf(str, "%d\n", nic->vlan); 418 str += sprintf(str, "%d\n", nic->vlan);
422 break; 419 break;
423 case ibft_eth_mac: 420 case ibft_eth_mac:
424 mac = nic->mac; 421 str += sprintf(str, "%pM\n", nic->mac);
425 str += sprintf(str, "%02x:%02x:%02x:%02x:%02x:%02x\n",
426 (u8)mac[0], (u8)mac[1], (u8)mac[2],
427 (u8)mac[3], (u8)mac[4], (u8)mac[5]);
428 break; 422 break;
429 case ibft_eth_hostname: 423 case ibft_eth_hostname:
430 str += sprintf_string(str, nic->hostname_len, 424 str += sprintf_string(str, nic->hostname_len,
@@ -525,7 +519,7 @@ static ssize_t ibft_show_attribute(struct kobject *kobj,
525 return ret; 519 return ret;
526} 520}
527 521
528static struct sysfs_ops ibft_attr_ops = { 522static const struct sysfs_ops ibft_attr_ops = {
529 .show = ibft_show_attribute, 523 .show = ibft_show_attribute,
530}; 524};
531 525