V4L/DVB: saa7127: support new vbi ops to set/get VBI format
[safe/jmp/linux-2.6] / drivers / firmware / iscsi_ibft.c
index 4353414..ed2801c 100644 (file)
@@ -284,15 +284,12 @@ static ssize_t sprintf_ipaddr(char *buf, u8 *ip)
                /*
                 * IPV4
                 */
-               str += sprintf(buf, NIPQUAD_FMT, ip[12],
-                              ip[13], ip[14], ip[15]);
+               str += sprintf(buf, "%pI4", ip + 12);
        } else {
                /*
                 * IPv6
                 */
-               str += sprintf(str, NIP6_FMT, ntohs(ip[0]), ntohs(ip[1]),
-                              ntohs(ip[2]), ntohs(ip[3]), ntohs(ip[4]),
-                              ntohs(ip[5]), ntohs(ip[6]), ntohs(ip[7]));
+               str += sprintf(str, "%pI6", ip);
        }
        str += sprintf(str, "\n");
        return str - buf;
@@ -383,8 +380,7 @@ static ssize_t ibft_attr_show_nic(struct ibft_kobject *entry,
        struct ibft_nic *nic = entry->nic;
        void *ibft_loc = entry->header;
        char *str = buf;
-       char *mac;
-       int val;
+       __be32 val;
 
        if (!nic)
                return 0;
@@ -400,10 +396,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);
@@ -424,10 +418,7 @@ static ssize_t ibft_attr_show_nic(struct ibft_kobject *entry,
                str += sprintf(str, "%d\n", nic->vlan);
                break;
        case ibft_eth_mac:
-               mac = nic->mac;
-               str += sprintf(str, "%02x:%02x:%02x:%02x:%02x:%02x\n",
-                              (u8)mac[0], (u8)mac[1], (u8)mac[2],
-                              (u8)mac[3], (u8)mac[4], (u8)mac[5]);
+               str += sprintf(str, "%pM\n", nic->mac);
                break;
        case ibft_eth_hostname:
                str += sprintf_string(str, nic->hostname_len,
@@ -528,7 +519,7 @@ static ssize_t ibft_show_attribute(struct kobject *kobj,
        return ret;
 }
 
-static struct sysfs_ops ibft_attr_ops = {
+static const struct sysfs_ops ibft_attr_ops = {
        .show = ibft_show_attribute,
 };
 
@@ -757,11 +748,11 @@ static int __init ibft_check_nic_for(struct ibft_nic *nic, int entry)
                rc = 1;
                break;
        case ibft_eth_ip_addr:
-               if (!memcmp(nic->dhcp, nulls, sizeof(nic->dhcp)))
+               if (memcmp(nic->ip_addr, nulls, sizeof(nic->ip_addr)))
                        rc = 1;
                break;
        case ibft_eth_subnet_mask:
-               if (!memcmp(nic->dhcp, nulls, sizeof(nic->dhcp)))
+               if (nic->subnet_mask_prefix)
                        rc = 1;
                break;
        case ibft_eth_origin:
@@ -941,8 +932,8 @@ static int __init ibft_init(void)
                return -ENOMEM;
 
        if (ibft_addr) {
-               printk(KERN_INFO "iBFT detected at 0x%lx.\n",
-                      virt_to_phys((void *)ibft_addr));
+               printk(KERN_INFO "iBFT detected at 0x%llx.\n",
+                      (u64)isa_virt_to_bus(ibft_addr));
 
                rc = ibft_check_device();
                if (rc)