]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[S390] struct device - replace bus_id with dev_name(), dev_set_name()
authorKay Sievers <kay.sievers@vrfy.org>
Thu, 25 Dec 2008 12:38:55 +0000 (13:38 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 25 Dec 2008 12:39:03 +0000 (13:39 +0100)
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/block/dasd_devmap.c
drivers/s390/block/dcssblk.c
drivers/s390/cio/ccwgroup.c
drivers/s390/cio/device.c
drivers/s390/scsi/zfcp_aux.c

index 3f4881e01cb6d0604b6942b90d6d487a91f2471a..2ef25731d197ed0f6a9ce2fdfdc1fc4358b9e460 100644 (file)
@@ -23,6 +23,7 @@
 
 /* This is ugly... */
 #define PRINTK_HEADER "dasd_devmap:"
+#define DASD_BUS_ID_SIZE 20
 
 #include "dasd_int.h"
 
@@ -41,7 +42,7 @@ EXPORT_SYMBOL_GPL(dasd_page_cache);
  */
 struct dasd_devmap {
        struct list_head list;
-       char bus_id[BUS_ID_SIZE];
+       char bus_id[DASD_BUS_ID_SIZE];
         unsigned int devindex;
         unsigned short features;
        struct dasd_device *device;
@@ -94,7 +95,7 @@ dasd_hash_busid(const char *bus_id)
        int hash, i;
 
        hash = 0;
-       for (i = 0; (i < BUS_ID_SIZE) && *bus_id; i++, bus_id++)
+       for (i = 0; (i < DASD_BUS_ID_SIZE) && *bus_id; i++, bus_id++)
                hash += *bus_id;
        return hash & 0xff;
 }
@@ -301,7 +302,7 @@ dasd_parse_range( char *parsestring ) {
        int from, from_id0, from_id1;
        int to, to_id0, to_id1;
        int features, rc;
-       char bus_id[BUS_ID_SIZE+1], *str;
+       char bus_id[DASD_BUS_ID_SIZE+1], *str;
 
        str = parsestring;
        rc = dasd_busid(&str, &from_id0, &from_id1, &from);
@@ -407,14 +408,14 @@ dasd_add_busid(const char *bus_id, int features)
        devmap = NULL;
        hash = dasd_hash_busid(bus_id);
        list_for_each_entry(tmp, &dasd_hashlists[hash], list)
-               if (strncmp(tmp->bus_id, bus_id, BUS_ID_SIZE) == 0) {
+               if (strncmp(tmp->bus_id, bus_id, DASD_BUS_ID_SIZE) == 0) {
                        devmap = tmp;
                        break;
                }
        if (!devmap) {
                /* This bus_id is new. */
                new->devindex = dasd_max_devindex++;
-               strncpy(new->bus_id, bus_id, BUS_ID_SIZE);
+               strncpy(new->bus_id, bus_id, DASD_BUS_ID_SIZE);
                new->features = features;
                new->device = NULL;
                list_add(&new->list, &dasd_hashlists[hash]);
@@ -439,7 +440,7 @@ dasd_find_busid(const char *bus_id)
        devmap = ERR_PTR(-ENODEV);
        hash = dasd_hash_busid(bus_id);
        list_for_each_entry(tmp, &dasd_hashlists[hash], list) {
-               if (strncmp(tmp->bus_id, bus_id, BUS_ID_SIZE) == 0) {
+               if (strncmp(tmp->bus_id, bus_id, DASD_BUS_ID_SIZE) == 0) {
                        devmap = tmp;
                        break;
                }
index 63f26a135fe5ae9764a26eda10cd5cae64aa4c49..b1b204c448ed2c303025f0fe9cc4712b67c71d46 100644 (file)
@@ -21,6 +21,7 @@
 #define DCSSBLK_NAME "dcssblk"
 #define DCSSBLK_MINORS_PER_DISK 1
 #define DCSSBLK_PARM_LEN 400
+#define DCSS_BUS_ID_SIZE 20
 
 #ifdef DCSSBLK_DEBUG
 #define PRINT_DEBUG(x...) printk(KERN_DEBUG DCSSBLK_NAME " debug: " x)
@@ -50,7 +51,7 @@ static struct block_device_operations dcssblk_devops = {
 struct dcssblk_dev_info {
        struct list_head lh;
        struct device dev;
-       char segment_name[BUS_ID_SIZE];
+       char segment_name[DCSS_BUS_ID_SIZE];
        atomic_t use_count;
        struct gendisk *gd;
        unsigned long start;
@@ -65,7 +66,7 @@ struct dcssblk_dev_info {
 
 struct segment_info {
        struct list_head lh;
-       char segment_name[BUS_ID_SIZE];
+       char segment_name[DCSS_BUS_ID_SIZE];
        unsigned long start;
        unsigned long end;
        int segment_type;
index 3ac2c2019f5e28ffae89e7c0d07f965be297f500..17fa009d9959788783e7c821b6b04575df45b4f5 100644 (file)
@@ -19,6 +19,8 @@
 #include <asm/ccwdev.h>
 #include <asm/ccwgroup.h>
 
+#define CCW_BUS_ID_SIZE                20
+
 /* In Linux 2.4, we had a channel device layer called "chandev"
  * that did all sorts of obscure stuff for networking devices.
  * This is another driver that serves as a replacement for just
@@ -172,7 +174,7 @@ static int __get_next_bus_id(const char **buf, char *bus_id)
                len = end - start + 1;
                end++;
        }
-       if (len < BUS_ID_SIZE) {
+       if (len < CCW_BUS_ID_SIZE) {
                strlcpy(bus_id, start, len);
                rc = 0;
        } else
@@ -181,7 +183,7 @@ static int __get_next_bus_id(const char **buf, char *bus_id)
        return rc;
 }
 
-static int __is_valid_bus_id(char bus_id[BUS_ID_SIZE])
+static int __is_valid_bus_id(char bus_id[CCW_BUS_ID_SIZE])
 {
        int cssid, ssid, devno;
 
@@ -213,7 +215,7 @@ int ccwgroup_create_from_string(struct device *root, unsigned int creator_id,
 {
        struct ccwgroup_device *gdev;
        int rc, i;
-       char tmp_bus_id[BUS_ID_SIZE];
+       char tmp_bus_id[CCW_BUS_ID_SIZE];
        const char *curr_buf;
 
        gdev = kzalloc(sizeof(*gdev) + num_devices * sizeof(gdev->cdev[0]),
index 4e4008325e281edc58f11b3a211506b3f8bac35a..fac85160a75357612e063dc65be60da8af7ee37d 100644 (file)
@@ -1723,7 +1723,7 @@ __ccwdev_check_busid(struct device *dev, void *id)
 
        bus_id = id;
 
-       return (strncmp(bus_id, dev_name(dev), BUS_ID_SIZE) == 0);
+       return (strcmp(bus_id, dev_name(dev)) == 0);
 }
 
 
index fc4a2895382490a6891636b38a6daf3087b789a8..f140b46df12a6884801e191e667d91b11fdf2da7 100644 (file)
@@ -29,6 +29,8 @@
 #include <linux/seq_file.h>
 #include "zfcp_ext.h"
 
+#define ZFCP_BUS_ID_SIZE       20
+
 static char *device;
 
 MODULE_AUTHOR("IBM Deutschland Entwicklung GmbH - linux390@de.ibm.com");
@@ -84,9 +86,9 @@ static int __init zfcp_device_setup(char *devstr)
        strcpy(str, devstr);
 
        token = strsep(&str, ",");
-       if (!token || strlen(token) >= BUS_ID_SIZE)
+       if (!token || strlen(token) >= ZFCP_BUS_ID_SIZE)
                goto err_out;
-       strncpy(zfcp_data.init_busid, token, BUS_ID_SIZE);
+       strncpy(zfcp_data.init_busid, token, ZFCP_BUS_ID_SIZE);
 
        token = strsep(&str, ",");
        if (!token || strict_strtoull(token, 0,