Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[S390] struct device - replace bus_id with dev_name(), dev_set_name()

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>

authored by

Kay Sievers and committed by
Martin Schwidefsky
98df67b3 0cd4bd47

+20 -14
+7 -6
drivers/s390/block/dasd_devmap.c
··· 23 23 24 24 /* This is ugly... */ 25 25 #define PRINTK_HEADER "dasd_devmap:" 26 + #define DASD_BUS_ID_SIZE 20 26 27 27 28 #include "dasd_int.h" 28 29 ··· 42 41 */ 43 42 struct dasd_devmap { 44 43 struct list_head list; 45 - char bus_id[BUS_ID_SIZE]; 44 + char bus_id[DASD_BUS_ID_SIZE]; 46 45 unsigned int devindex; 47 46 unsigned short features; 48 47 struct dasd_device *device; ··· 95 94 int hash, i; 96 95 97 96 hash = 0; 98 - for (i = 0; (i < BUS_ID_SIZE) && *bus_id; i++, bus_id++) 97 + for (i = 0; (i < DASD_BUS_ID_SIZE) && *bus_id; i++, bus_id++) 99 98 hash += *bus_id; 100 99 return hash & 0xff; 101 100 } ··· 302 301 int from, from_id0, from_id1; 303 302 int to, to_id0, to_id1; 304 303 int features, rc; 305 - char bus_id[BUS_ID_SIZE+1], *str; 304 + char bus_id[DASD_BUS_ID_SIZE+1], *str; 306 305 307 306 str = parsestring; 308 307 rc = dasd_busid(&str, &from_id0, &from_id1, &from); ··· 408 407 devmap = NULL; 409 408 hash = dasd_hash_busid(bus_id); 410 409 list_for_each_entry(tmp, &dasd_hashlists[hash], list) 411 - if (strncmp(tmp->bus_id, bus_id, BUS_ID_SIZE) == 0) { 410 + if (strncmp(tmp->bus_id, bus_id, DASD_BUS_ID_SIZE) == 0) { 412 411 devmap = tmp; 413 412 break; 414 413 } 415 414 if (!devmap) { 416 415 /* This bus_id is new. */ 417 416 new->devindex = dasd_max_devindex++; 418 - strncpy(new->bus_id, bus_id, BUS_ID_SIZE); 417 + strncpy(new->bus_id, bus_id, DASD_BUS_ID_SIZE); 419 418 new->features = features; 420 419 new->device = NULL; 421 420 list_add(&new->list, &dasd_hashlists[hash]); ··· 440 439 devmap = ERR_PTR(-ENODEV); 441 440 hash = dasd_hash_busid(bus_id); 442 441 list_for_each_entry(tmp, &dasd_hashlists[hash], list) { 443 - if (strncmp(tmp->bus_id, bus_id, BUS_ID_SIZE) == 0) { 442 + if (strncmp(tmp->bus_id, bus_id, DASD_BUS_ID_SIZE) == 0) { 444 443 devmap = tmp; 445 444 break; 446 445 }
+3 -2
drivers/s390/block/dcssblk.c
··· 21 21 #define DCSSBLK_NAME "dcssblk" 22 22 #define DCSSBLK_MINORS_PER_DISK 1 23 23 #define DCSSBLK_PARM_LEN 400 24 + #define DCSS_BUS_ID_SIZE 20 24 25 25 26 #ifdef DCSSBLK_DEBUG 26 27 #define PRINT_DEBUG(x...) printk(KERN_DEBUG DCSSBLK_NAME " debug: " x) ··· 51 50 struct dcssblk_dev_info { 52 51 struct list_head lh; 53 52 struct device dev; 54 - char segment_name[BUS_ID_SIZE]; 53 + char segment_name[DCSS_BUS_ID_SIZE]; 55 54 atomic_t use_count; 56 55 struct gendisk *gd; 57 56 unsigned long start; ··· 66 65 67 66 struct segment_info { 68 67 struct list_head lh; 69 - char segment_name[BUS_ID_SIZE]; 68 + char segment_name[DCSS_BUS_ID_SIZE]; 70 69 unsigned long start; 71 70 unsigned long end; 72 71 int segment_type;
+5 -3
drivers/s390/cio/ccwgroup.c
··· 19 19 #include <asm/ccwdev.h> 20 20 #include <asm/ccwgroup.h> 21 21 22 + #define CCW_BUS_ID_SIZE 20 23 + 22 24 /* In Linux 2.4, we had a channel device layer called "chandev" 23 25 * that did all sorts of obscure stuff for networking devices. 24 26 * This is another driver that serves as a replacement for just ··· 174 172 len = end - start + 1; 175 173 end++; 176 174 } 177 - if (len < BUS_ID_SIZE) { 175 + if (len < CCW_BUS_ID_SIZE) { 178 176 strlcpy(bus_id, start, len); 179 177 rc = 0; 180 178 } else ··· 183 181 return rc; 184 182 } 185 183 186 - static int __is_valid_bus_id(char bus_id[BUS_ID_SIZE]) 184 + static int __is_valid_bus_id(char bus_id[CCW_BUS_ID_SIZE]) 187 185 { 188 186 int cssid, ssid, devno; 189 187 ··· 215 213 { 216 214 struct ccwgroup_device *gdev; 217 215 int rc, i; 218 - char tmp_bus_id[BUS_ID_SIZE]; 216 + char tmp_bus_id[CCW_BUS_ID_SIZE]; 219 217 const char *curr_buf; 220 218 221 219 gdev = kzalloc(sizeof(*gdev) + num_devices * sizeof(gdev->cdev[0]),
+1 -1
drivers/s390/cio/device.c
··· 1723 1723 1724 1724 bus_id = id; 1725 1725 1726 - return (strncmp(bus_id, dev_name(dev), BUS_ID_SIZE) == 0); 1726 + return (strcmp(bus_id, dev_name(dev)) == 0); 1727 1727 } 1728 1728 1729 1729
+4 -2
drivers/s390/scsi/zfcp_aux.c
··· 29 29 #include <linux/seq_file.h> 30 30 #include "zfcp_ext.h" 31 31 32 + #define ZFCP_BUS_ID_SIZE 20 33 + 32 34 static char *device; 33 35 34 36 MODULE_AUTHOR("IBM Deutschland Entwicklung GmbH - linux390@de.ibm.com"); ··· 86 84 strcpy(str, devstr); 87 85 88 86 token = strsep(&str, ","); 89 - if (!token || strlen(token) >= BUS_ID_SIZE) 87 + if (!token || strlen(token) >= ZFCP_BUS_ID_SIZE) 90 88 goto err_out; 91 - strncpy(zfcp_data.init_busid, token, BUS_ID_SIZE); 89 + strncpy(zfcp_data.init_busid, token, ZFCP_BUS_ID_SIZE); 92 90 93 91 token = strsep(&str, ","); 94 92 if (!token || strict_strtoull(token, 0,