[PATCH] s390: remove redundant and useless code in qeth

[patch 3/3] s390: remove redundant and useless code in qeth

From: Frank Pavlic <pavlic@de.ibm.com>
- remove redundant and useless code in qeth for
procfs operations.
- update Revision numbers
Signed-off-by: Frank Pavlic <pavlic@de.ibm.com>

diffstat:
qeth_main.c | 6 -
qeth_mpc.c | 2
qeth_mpc.h | 2
qeth_proc.c | 250 ++++++------------------------------------------------------
qeth_sys.c | 4
qeth_tso.h | 4
6 files changed, 38 insertions(+), 230 deletions(-)
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>

authored by Frank Pavlic and committed by Jeff Garzik 3df3cc6d 4965e97f

+38 -230
+3 -3
drivers/s390/net/qeth_main.c
··· 1 /* 2 * 3 - * linux/drivers/s390/net/qeth_main.c ($Revision: 1.246 $) 4 * 5 * Linux on zSeries OSA Express and HiperSockets support 6 * ··· 12 * Frank Pavlic (fpavlic@de.ibm.com) and 13 * Thomas Spatzier <tspat@de.ibm.com> 14 * 15 - * $Revision: 1.242 $ $Date: 2005/05/04 20:19:18 $ 16 * 17 * This program is free software; you can redistribute it and/or modify 18 * it under the terms of the GNU General Public License as published by ··· 72 #include "qeth_eddp.h" 73 #include "qeth_tso.h" 74 75 - #define VERSION_QETH_C "$Revision: 1.246 $" 76 static const char *version = "qeth S/390 OSA-Express driver"; 77 78 /**
··· 1 /* 2 * 3 + * linux/drivers/s390/net/qeth_main.c ($Revision: 1.251 $) 4 * 5 * Linux on zSeries OSA Express and HiperSockets support 6 * ··· 12 * Frank Pavlic (fpavlic@de.ibm.com) and 13 * Thomas Spatzier <tspat@de.ibm.com> 14 * 15 + * $Revision: 1.251 $ $Date: 2005/05/04 20:19:18 $ 16 * 17 * This program is free software; you can redistribute it and/or modify 18 * it under the terms of the GNU General Public License as published by ··· 72 #include "qeth_eddp.h" 73 #include "qeth_tso.h" 74 75 + #define VERSION_QETH_C "$Revision: 1.251 $" 76 static const char *version = "qeth S/390 OSA-Express driver"; 77 78 /**
+1 -1
drivers/s390/net/qeth_mpc.c
··· 11 #include <asm/cio.h> 12 #include "qeth_mpc.h" 13 14 - const char *VERSION_QETH_MPC_C = "$Revision: 1.12 $"; 15 16 unsigned char IDX_ACTIVATE_READ[]={ 17 0x00,0x00,0x80,0x00, 0x00,0x00,0x00,0x00,
··· 11 #include <asm/cio.h> 12 #include "qeth_mpc.h" 13 14 + const char *VERSION_QETH_MPC_C = "$Revision: 1.13 $"; 15 16 unsigned char IDX_ACTIVATE_READ[]={ 17 0x00,0x00,0x80,0x00, 0x00,0x00,0x00,0x00,
+1 -1
drivers/s390/net/qeth_mpc.h
··· 14 15 #include <asm/qeth.h> 16 17 - #define VERSION_QETH_MPC_H "$Revision: 1.44 $" 18 19 extern const char *VERSION_QETH_MPC_C; 20
··· 14 15 #include <asm/qeth.h> 16 17 + #define VERSION_QETH_MPC_H "$Revision: 1.46 $" 18 19 extern const char *VERSION_QETH_MPC_C; 20
+29 -221
drivers/s390/net/qeth_proc.c
··· 1 /* 2 * 3 - * linux/drivers/s390/net/qeth_fs.c ($Revision: 1.13 $) 4 * 5 * Linux on zSeries OSA Express and HiperSockets support 6 * This file contains code related to procfs. ··· 21 #include "qeth_mpc.h" 22 #include "qeth_fs.h" 23 24 - const char *VERSION_QETH_PROC_C = "$Revision: 1.13 $"; 25 26 /***** /proc/qeth *****/ 27 #define QETH_PROCFILE_NAME "qeth" ··· 30 static int 31 qeth_procfile_seq_match(struct device *dev, void *data) 32 { 33 - return 1; 34 } 35 36 static void * 37 qeth_procfile_seq_start(struct seq_file *s, loff_t *offset) 38 { 39 - struct device *dev; 40 - loff_t nr; 41 - 42 down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); 43 - 44 - nr = *offset; 45 - if (nr == 0) 46 return SEQ_START_TOKEN; 47 - 48 - dev = driver_find_device(&qeth_ccwgroup_driver.driver, NULL, 49 - NULL, qeth_procfile_seq_match); 50 - 51 - /* get card at pos *offset */ 52 - nr = *offset; 53 - while (nr-- > 1 && dev) 54 dev = driver_find_device(&qeth_ccwgroup_driver.driver, dev, 55 NULL, qeth_procfile_seq_match); 56 - return (void *) dev; 57 } 58 59 static void ··· 62 qeth_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset) 63 { 64 struct device *prev, *next; 65 - 66 - if (it == SEQ_START_TOKEN) { 67 - next = driver_find_device(&qeth_ccwgroup_driver.driver, 68 - NULL, NULL, qeth_procfile_seq_match); 69 - if (next) 70 - (*offset)++; 71 - return (void *) next; 72 - } 73 - prev = (struct device *) it; 74 next = driver_find_device(&qeth_ccwgroup_driver.driver, 75 prev, NULL, qeth_procfile_seq_match); 76 - if (next) 77 - (*offset)++; 78 return (void *) next; 79 } 80 ··· 78 { 79 int routing_type = 0; 80 81 - if (ipv == 4){ 82 routing_type = card->options.route4.type; 83 } else { 84 #ifdef CONFIG_QETH_IPV6 ··· 145 card->qdio.in_buf_pool.buf_count); 146 else 147 seq_printf(s, " +++ LAN OFFLINE +++\n"); 148 } 149 return 0; 150 } ··· 176 static struct proc_dir_entry *qeth_perf_procfile; 177 178 #ifdef CONFIG_QETH_PERF_STATS 179 - 180 - static void * 181 - qeth_perf_procfile_seq_start(struct seq_file *s, loff_t *offset) 182 - { 183 - struct device *dev = NULL; 184 - int nr; 185 - 186 - down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); 187 - /* get card at pos *offset */ 188 - dev = driver_find_device(&qeth_ccwgroup_driver.driver, NULL, NULL, 189 - qeth_procfile_seq_match); 190 - 191 - /* get card at pos *offset */ 192 - nr = *offset; 193 - while (nr-- > 1 && dev) 194 - dev = driver_find_device(&qeth_ccwgroup_driver.driver, dev, 195 - NULL, qeth_procfile_seq_match); 196 - return (void *) dev; 197 - } 198 - 199 - static void 200 - qeth_perf_procfile_seq_stop(struct seq_file *s, void* it) 201 - { 202 - up_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); 203 - } 204 - 205 - static void * 206 - qeth_perf_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset) 207 - { 208 - struct device *prev, *next; 209 - 210 - prev = (struct device *) it; 211 - next = driver_find_device(&qeth_ccwgroup_driver.driver, prev, 212 - NULL, qeth_procfile_seq_match); 213 - if (next) 214 - (*offset)++; 215 - return (void *) next; 216 - } 217 - 218 static int 219 qeth_perf_procfile_seq_show(struct seq_file *s, void *it) 220 { 221 struct device *device; 222 struct qeth_card *card; 223 224 device = (struct device *) it; 225 card = device->driver_data; ··· 252 card->perf_stats.outbound_do_qdio_time, 253 card->perf_stats.outbound_do_qdio_cnt 254 ); 255 return 0; 256 } 257 258 static struct seq_operations qeth_perf_procfile_seq_ops = { 259 - .start = qeth_perf_procfile_seq_start, 260 - .stop = qeth_perf_procfile_seq_stop, 261 - .next = qeth_perf_procfile_seq_next, 262 .show = qeth_perf_procfile_seq_show, 263 }; 264 ··· 282 #define qeth_perf_procfile_created 1 283 #endif /* CONFIG_QETH_PERF_STATS */ 284 285 - /***** /proc/qeth_ipa_takeover *****/ 286 - #define QETH_IPATO_PROCFILE_NAME "qeth_ipa_takeover" 287 - static struct proc_dir_entry *qeth_ipato_procfile; 288 - 289 - static void * 290 - qeth_ipato_procfile_seq_start(struct seq_file *s, loff_t *offset) 291 - { 292 - struct device *dev; 293 - loff_t nr; 294 - 295 - down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); 296 - /* TODO: finish this */ 297 - /* 298 - * maybe SEQ_SATRT_TOKEN can be returned for offset 0 299 - * output driver settings then; 300 - * else output setting for respective card 301 - */ 302 - 303 - dev = driver_find_device(&qeth_ccwgroup_driver.driver, NULL, NULL, 304 - qeth_procfile_seq_match); 305 - 306 - /* get card at pos *offset */ 307 - nr = *offset; 308 - while (nr-- > 1 && dev) 309 - dev = driver_find_device(&qeth_ccwgroup_driver.driver, dev, 310 - NULL, qeth_procfile_seq_match); 311 - return (void *) dev; 312 - } 313 - 314 - static void 315 - qeth_ipato_procfile_seq_stop(struct seq_file *s, void* it) 316 - { 317 - up_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); 318 - } 319 - 320 - static void * 321 - qeth_ipato_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset) 322 - { 323 - struct device *prev, *next; 324 - 325 - prev = (struct device *) it; 326 - next = driver_find_device(&qeth_ccwgroup_driver.driver, prev, 327 - NULL, qeth_procfile_seq_match); 328 - if (next) 329 - (*offset)++; 330 - return (void *) next; 331 - } 332 - 333 - static int 334 - qeth_ipato_procfile_seq_show(struct seq_file *s, void *it) 335 - { 336 - struct device *device; 337 - struct qeth_card *card; 338 - 339 - /* TODO: finish this */ 340 - /* 341 - * maybe SEQ_SATRT_TOKEN can be returned for offset 0 342 - * output driver settings then; 343 - * else output setting for respective card 344 - */ 345 - device = (struct device *) it; 346 - card = device->driver_data; 347 - 348 - return 0; 349 - } 350 - 351 - static struct seq_operations qeth_ipato_procfile_seq_ops = { 352 - .start = qeth_ipato_procfile_seq_start, 353 - .stop = qeth_ipato_procfile_seq_stop, 354 - .next = qeth_ipato_procfile_seq_next, 355 - .show = qeth_ipato_procfile_seq_show, 356 - }; 357 - 358 - static int 359 - qeth_ipato_procfile_open(struct inode *inode, struct file *file) 360 - { 361 - return seq_open(file, &qeth_ipato_procfile_seq_ops); 362 - } 363 - 364 - static struct file_operations qeth_ipato_procfile_fops = { 365 - .owner = THIS_MODULE, 366 - .open = qeth_ipato_procfile_open, 367 - .read = seq_read, 368 - .llseek = seq_lseek, 369 - .release = seq_release, 370 - }; 371 - 372 int __init 373 qeth_create_procfs_entries(void) 374 { ··· 297 qeth_perf_procfile->proc_fops = &qeth_perf_procfile_fops; 298 #endif /* CONFIG_QETH_PERF_STATS */ 299 300 - qeth_ipato_procfile = create_proc_entry(QETH_IPATO_PROCFILE_NAME, 301 - S_IFREG | 0444, NULL); 302 - if (qeth_ipato_procfile) 303 - qeth_ipato_procfile->proc_fops = &qeth_ipato_procfile_fops; 304 - 305 if (qeth_procfile && 306 - qeth_ipato_procfile && 307 qeth_perf_procfile_created) 308 return 0; 309 else ··· 311 remove_proc_entry(QETH_PROCFILE_NAME, NULL); 312 if (qeth_perf_procfile) 313 remove_proc_entry(QETH_PERF_PROCFILE_NAME, NULL); 314 - if (qeth_ipato_procfile) 315 - remove_proc_entry(QETH_IPATO_PROCFILE_NAME, NULL); 316 } 317 318 - 319 - /* ONLY FOR DEVELOPMENT! -> make it as module */ 320 - /* 321 - static void 322 - qeth_create_sysfs_entries(void) 323 - { 324 - struct device *dev; 325 - 326 - down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); 327 - 328 - list_for_each_entry(dev, &qeth_ccwgroup_driver.driver.devices, 329 - driver_list) 330 - qeth_create_device_attributes(dev); 331 - 332 - up_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); 333 - } 334 - 335 - static void 336 - qeth_remove_sysfs_entries(void) 337 - { 338 - struct device *dev; 339 - 340 - down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); 341 - 342 - list_for_each_entry(dev, &qeth_ccwgroup_driver.driver.devices, 343 - driver_list) 344 - qeth_remove_device_attributes(dev); 345 - 346 - up_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); 347 - } 348 - 349 - static int __init 350 - qeth_fs_init(void) 351 - { 352 - printk(KERN_INFO "qeth_fs_init\n"); 353 - qeth_create_procfs_entries(); 354 - qeth_create_sysfs_entries(); 355 - 356 - return 0; 357 - } 358 - 359 - static void __exit 360 - qeth_fs_exit(void) 361 - { 362 - printk(KERN_INFO "qeth_fs_exit\n"); 363 - qeth_remove_procfs_entries(); 364 - qeth_remove_sysfs_entries(); 365 - } 366 - 367 - 368 - module_init(qeth_fs_init); 369 - module_exit(qeth_fs_exit); 370 - 371 - MODULE_LICENSE("GPL"); 372 - */
··· 1 /* 2 * 3 + * linux/drivers/s390/net/qeth_fs.c ($Revision: 1.16 $) 4 * 5 * Linux on zSeries OSA Express and HiperSockets support 6 * This file contains code related to procfs. ··· 21 #include "qeth_mpc.h" 22 #include "qeth_fs.h" 23 24 + const char *VERSION_QETH_PROC_C = "$Revision: 1.16 $"; 25 26 /***** /proc/qeth *****/ 27 #define QETH_PROCFILE_NAME "qeth" ··· 30 static int 31 qeth_procfile_seq_match(struct device *dev, void *data) 32 { 33 + return(dev ? 1 : 0); 34 } 35 36 static void * 37 qeth_procfile_seq_start(struct seq_file *s, loff_t *offset) 38 { 39 + struct device *dev = NULL; 40 + loff_t nr = 0; 41 + 42 down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); 43 + if (*offset == 0) 44 return SEQ_START_TOKEN; 45 + while (1) { 46 dev = driver_find_device(&qeth_ccwgroup_driver.driver, dev, 47 NULL, qeth_procfile_seq_match); 48 + if (++nr == *offset) 49 + break; 50 + put_device(dev); 51 + } 52 + return dev; 53 } 54 55 static void ··· 66 qeth_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset) 67 { 68 struct device *prev, *next; 69 + 70 + if (it == SEQ_START_TOKEN) 71 + prev = NULL; 72 + else 73 + prev = (struct device *) it; 74 next = driver_find_device(&qeth_ccwgroup_driver.driver, 75 prev, NULL, qeth_procfile_seq_match); 76 + (*offset)++; 77 return (void *) next; 78 } 79 ··· 87 { 88 int routing_type = 0; 89 90 + if (ipv == 4) { 91 routing_type = card->options.route4.type; 92 } else { 93 #ifdef CONFIG_QETH_IPV6 ··· 154 card->qdio.in_buf_pool.buf_count); 155 else 156 seq_printf(s, " +++ LAN OFFLINE +++\n"); 157 + put_device(device); 158 } 159 return 0; 160 } ··· 184 static struct proc_dir_entry *qeth_perf_procfile; 185 186 #ifdef CONFIG_QETH_PERF_STATS 187 static int 188 qeth_perf_procfile_seq_show(struct seq_file *s, void *it) 189 { 190 struct device *device; 191 struct qeth_card *card; 192 + 193 + 194 + if (it == SEQ_START_TOKEN) 195 + return 0; 196 197 device = (struct device *) it; 198 card = device->driver_data; ··· 295 card->perf_stats.outbound_do_qdio_time, 296 card->perf_stats.outbound_do_qdio_cnt 297 ); 298 + put_device(device); 299 return 0; 300 } 301 302 static struct seq_operations qeth_perf_procfile_seq_ops = { 303 + .start = qeth_procfile_seq_start, 304 + .stop = qeth_procfile_seq_stop, 305 + .next = qeth_procfile_seq_next, 306 .show = qeth_perf_procfile_seq_show, 307 }; 308 ··· 324 #define qeth_perf_procfile_created 1 325 #endif /* CONFIG_QETH_PERF_STATS */ 326 327 int __init 328 qeth_create_procfs_entries(void) 329 { ··· 426 qeth_perf_procfile->proc_fops = &qeth_perf_procfile_fops; 427 #endif /* CONFIG_QETH_PERF_STATS */ 428 429 if (qeth_procfile && 430 qeth_perf_procfile_created) 431 return 0; 432 else ··· 446 remove_proc_entry(QETH_PROCFILE_NAME, NULL); 447 if (qeth_perf_procfile) 448 remove_proc_entry(QETH_PERF_PROCFILE_NAME, NULL); 449 } 450
+2 -2
drivers/s390/net/qeth_sys.c
··· 1 /* 2 * 3 - * linux/drivers/s390/net/qeth_sys.c ($Revision: 1.59 $) 4 * 5 * Linux on zSeries OSA Express and HiperSockets support 6 * This file contains code related to sysfs. ··· 20 #include "qeth_mpc.h" 21 #include "qeth_fs.h" 22 23 - const char *VERSION_QETH_SYS_C = "$Revision: 1.59 $"; 24 25 /*****************************************************************************/ 26 /* */
··· 1 /* 2 * 3 + * linux/drivers/s390/net/qeth_sys.c ($Revision: 1.60 $) 4 * 5 * Linux on zSeries OSA Express and HiperSockets support 6 * This file contains code related to sysfs. ··· 20 #include "qeth_mpc.h" 21 #include "qeth_fs.h" 22 23 + const char *VERSION_QETH_SYS_C = "$Revision: 1.60 $"; 24 25 /*****************************************************************************/ 26 /* */
+2 -2
drivers/s390/net/qeth_tso.h
··· 1 /* 2 - * linux/drivers/s390/net/qeth_tso.h ($Revision: 1.7 $) 3 * 4 * Header file for qeth TCP Segmentation Offload support. 5 * ··· 7 * 8 * Author(s): Frank Pavlic <fpavlic@de.ibm.com> 9 * 10 - * $Revision: 1.7 $ $Date: 2005/05/04 20:19:18 $ 11 * 12 */ 13 #ifndef __QETH_TSO_H__
··· 1 /* 2 + * linux/drivers/s390/net/qeth_tso.h ($Revision: 1.8 $) 3 * 4 * Header file for qeth TCP Segmentation Offload support. 5 * ··· 7 * 8 * Author(s): Frank Pavlic <fpavlic@de.ibm.com> 9 * 10 + * $Revision: 1.8 $ $Date: 2005/05/04 20:19:18 $ 11 * 12 */ 13 #ifndef __QETH_TSO_H__