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

fas216: switch to ->show_info()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro 9d4e5c54 6b3a8bbf

+49 -142
+7 -33
drivers/scsi/arm/arxescsi.c
··· 220 220 return string; 221 221 } 222 222 223 - /* 224 - * Function: int arxescsi_proc_info(char *buffer, char **start, off_t offset, 225 - * int length, int host_no, int inout) 226 - * Purpose : Return information about the driver to a user process accessing 227 - * the /proc filesystem. 228 - * Params : buffer - a buffer to write information to 229 - * start - a pointer into this buffer set by this routine to the start 230 - * of the required information. 231 - * offset - offset into information that we have read up to. 232 - * length - length of buffer 233 - * host_no - host number to return information for 234 - * inout - 0 for reading, 1 for writing. 235 - * Returns : length of data written to buffer. 236 - */ 237 223 static int 238 - arxescsi_proc_info(struct Scsi_Host *host, char *buffer, char **start, off_t offset, int length, 239 - int inout) 224 + arxescsi_show_info(struct seq_file *m, struct Scsi_Host *host) 240 225 { 241 226 struct arxescsi_info *info; 242 - char *p = buffer; 243 - int pos; 244 - 245 227 info = (struct arxescsi_info *)host->hostdata; 246 - if (inout == 1) 247 - return -EINVAL; 248 228 249 - p += sprintf(p, "ARXE 16-bit SCSI driver v%s\n", VERSION); 250 - p += fas216_print_host(&info->info, p); 251 - p += fas216_print_stats(&info->info, p); 252 - p += fas216_print_devices(&info->info, p); 253 - 254 - *start = buffer + offset; 255 - pos = p - buffer - offset; 256 - if (pos > length) 257 - pos = length; 258 - 259 - return pos; 229 + seq_printf(m, "ARXE 16-bit SCSI driver v%s\n", VERSION); 230 + fas216_print_host(&info->info, m); 231 + fas216_print_stats(&info->info, m); 232 + fas216_print_devices(&info->info, m); 233 + return 0; 260 234 } 261 235 262 236 static struct scsi_host_template arxescsi_template = { 263 - .proc_info = arxescsi_proc_info, 237 + .show_info = arxescsi_show_info, 264 238 .name = "ARXE SCSI card", 265 239 .info = arxescsi_info, 266 240 .queuecommand = fas216_noqueue_command,
+9 -34
drivers/scsi/arm/cumana_2.c
··· 337 337 return ret; 338 338 } 339 339 340 - /* Prototype: int cumanascsi_2_proc_info(char *buffer, char **start, off_t offset, 341 - * int length, int host_no, int inout) 342 - * Purpose : Return information about the driver to a user process accessing 343 - * the /proc filesystem. 344 - * Params : buffer - a buffer to write information to 345 - * start - a pointer into this buffer set by this routine to the start 346 - * of the required information. 347 - * offset - offset into information that we have read up to. 348 - * length - length of buffer 349 - * host_no - host number to return information for 350 - * inout - 0 for reading, 1 for writing. 351 - * Returns : length of data written to buffer. 352 - */ 353 - int cumanascsi_2_proc_info (struct Scsi_Host *host, char *buffer, char **start, off_t offset, 354 - int length, int inout) 340 + static int cumanascsi_2_show_info(struct seq_file *m, struct Scsi_Host *host) 355 341 { 356 342 struct cumanascsi2_info *info; 357 - char *p = buffer; 358 - int pos; 359 - 360 - if (inout == 1) 361 - return cumanascsi_2_set_proc_info(host, buffer, length); 362 - 363 343 info = (struct cumanascsi2_info *)host->hostdata; 364 344 365 - p += sprintf(p, "Cumana SCSI II driver v%s\n", VERSION); 366 - p += fas216_print_host(&info->info, p); 367 - p += sprintf(p, "Term : o%s\n", 345 + seq_printf(m, "Cumana SCSI II driver v%s\n", VERSION); 346 + fas216_print_host(&info->info, m); 347 + seq_printf(m, "Term : o%s\n", 368 348 info->terms ? "n" : "ff"); 369 349 370 - p += fas216_print_stats(&info->info, p); 371 - p += fas216_print_devices(&info->info, p); 372 - 373 - *start = buffer + offset; 374 - pos = p - buffer - offset; 375 - if (pos > length) 376 - pos = length; 377 - 378 - return pos; 350 + fas216_print_stats(&info->info, m); 351 + fas216_print_devices(&info->info, m); 352 + return 0; 379 353 } 380 354 381 355 static struct scsi_host_template cumanascsi2_template = { 382 356 .module = THIS_MODULE, 383 - .proc_info = cumanascsi_2_proc_info, 357 + .show_info = cumanascsi_2_show_info, 358 + .write_info = cumanascsi_2_set_proc_info, 384 359 .name = "Cumana SCSI II", 385 360 .info = cumanascsi_2_info, 386 361 .queuecommand = fas216_queue_command,
+9 -33
drivers/scsi/arm/eesox.c
··· 422 422 return ret; 423 423 } 424 424 425 - /* Prototype: int eesoxscsi_proc_info(char *buffer, char **start, off_t offset, 426 - * int length, int host_no, int inout) 427 - * Purpose : Return information about the driver to a user process accessing 428 - * the /proc filesystem. 429 - * Params : buffer - a buffer to write information to 430 - * start - a pointer into this buffer set by this routine to the start 431 - * of the required information. 432 - * offset - offset into information that we have read up to. 433 - * length - length of buffer 434 - * host_no - host number to return information for 435 - * inout - 0 for reading, 1 for writing. 436 - * Returns : length of data written to buffer. 437 - */ 438 - int eesoxscsi_proc_info(struct Scsi_Host *host, char *buffer, char **start, off_t offset, 439 - int length, int inout) 425 + static int eesoxscsi_show_info(struct seq_file *m, struct Scsi_Host *host) 440 426 { 441 427 struct eesoxscsi_info *info; 442 - char *p = buffer; 443 - int pos; 444 - 445 - if (inout == 1) 446 - return eesoxscsi_set_proc_info(host, buffer, length); 447 428 448 429 info = (struct eesoxscsi_info *)host->hostdata; 449 430 450 - p += sprintf(p, "EESOX SCSI driver v%s\n", VERSION); 451 - p += fas216_print_host(&info->info, p); 452 - p += sprintf(p, "Term : o%s\n", 431 + seq_printf(m, "EESOX SCSI driver v%s\n", VERSION); 432 + fas216_print_host(&info->info, m); 433 + seq_printf(m, "Term : o%s\n", 453 434 info->control & EESOX_TERM_ENABLE ? "n" : "ff"); 454 435 455 - p += fas216_print_stats(&info->info, p); 456 - p += fas216_print_devices(&info->info, p); 457 - 458 - *start = buffer + offset; 459 - pos = p - buffer - offset; 460 - if (pos > length) 461 - pos = length; 462 - 463 - return pos; 436 + fas216_print_stats(&info->info, m); 437 + fas216_print_devices(&info->info, m); 438 + return 0; 464 439 } 465 440 466 441 static ssize_t eesoxscsi_show_term(struct device *dev, struct device_attribute *attr, char *buf) ··· 473 498 474 499 static struct scsi_host_template eesox_template = { 475 500 .module = THIS_MODULE, 476 - .proc_info = eesoxscsi_proc_info, 501 + .show_info = eesoxscsi_show_info, 502 + .write_info = eesoxscsi_set_proc_info, 477 503 .name = "EESOX SCSI", 478 504 .info = eesoxscsi_info, 479 505 .queuecommand = fas216_queue_command,
+12 -19
drivers/scsi/arm/fas216.c
··· 2958 2958 queue_free(&info->queues.issue); 2959 2959 } 2960 2960 2961 - int fas216_print_host(FAS216_Info *info, char *buffer) 2961 + void fas216_print_host(FAS216_Info *info, struct seq_file *m) 2962 2962 { 2963 - return sprintf(buffer, 2963 + seq_printf(m, 2964 2964 "\n" 2965 2965 "Chip : %s\n" 2966 2966 " Address: 0x%p\n" ··· 2970 2970 info->scsi.irq, info->scsi.dma); 2971 2971 } 2972 2972 2973 - int fas216_print_stats(FAS216_Info *info, char *buffer) 2973 + void fas216_print_stats(FAS216_Info *info, struct seq_file *m) 2974 2974 { 2975 - char *p = buffer; 2976 - 2977 - p += sprintf(p, "\n" 2975 + seq_printf(m, "\n" 2978 2976 "Command Statistics:\n" 2979 2977 " Queued : %u\n" 2980 2978 " Issued : %u\n" ··· 2989 2991 info->stats.writes, info->stats.miscs, 2990 2992 info->stats.disconnects, info->stats.aborts, 2991 2993 info->stats.bus_resets, info->stats.host_resets); 2992 - 2993 - return p - buffer; 2994 2994 } 2995 2995 2996 - int fas216_print_devices(FAS216_Info *info, char *buffer) 2996 + void fas216_print_devices(FAS216_Info *info, struct seq_file *m) 2997 2997 { 2998 2998 struct fas216_device *dev; 2999 2999 struct scsi_device *scd; 3000 - char *p = buffer; 3001 3000 3002 - p += sprintf(p, "Device/Lun TaggedQ Parity Sync\n"); 3001 + seq_printf(m, "Device/Lun TaggedQ Parity Sync\n"); 3003 3002 3004 3003 shost_for_each_device(scd, info->host) { 3005 3004 dev = &info->device[scd->id]; 3006 - p += sprintf(p, " %d/%d ", scd->id, scd->lun); 3005 + seq_printf(m, " %d/%d ", scd->id, scd->lun); 3007 3006 if (scd->tagged_supported) 3008 - p += sprintf(p, "%3sabled(%3d) ", 3007 + seq_printf(m, "%3sabled(%3d) ", 3009 3008 scd->simple_tags ? "en" : "dis", 3010 3009 scd->current_tag); 3011 3010 else 3012 - p += sprintf(p, "unsupported "); 3011 + seq_printf(m, "unsupported "); 3013 3012 3014 - p += sprintf(p, "%3sabled ", dev->parity_enabled ? "en" : "dis"); 3013 + seq_printf(m, "%3sabled ", dev->parity_enabled ? "en" : "dis"); 3015 3014 3016 3015 if (dev->sof) 3017 - p += sprintf(p, "offset %d, %d ns\n", 3016 + seq_printf(m, "offset %d, %d ns\n", 3018 3017 dev->sof, dev->period * 4); 3019 3018 else 3020 - p += sprintf(p, "async\n"); 3019 + seq_printf(m, "async\n"); 3021 3020 } 3022 - 3023 - return p - buffer; 3024 3021 } 3025 3022 3026 3023 EXPORT_SYMBOL(fas216_init);
+3 -3
drivers/scsi/arm/fas216.h
··· 358 358 */ 359 359 extern void fas216_release (struct Scsi_Host *instance); 360 360 361 - extern int fas216_print_host(FAS216_Info *info, char *buffer); 362 - extern int fas216_print_stats(FAS216_Info *info, char *buffer); 363 - extern int fas216_print_devices(FAS216_Info *info, char *buffer); 361 + extern void fas216_print_host(FAS216_Info *info, struct seq_file *m); 362 + extern void fas216_print_stats(FAS216_Info *info, struct seq_file *m); 363 + extern void fas216_print_devices(FAS216_Info *info, struct seq_file *m); 364 364 365 365 /* Function: int fas216_eh_abort(struct scsi_cmnd *SCpnt) 366 366 * Purpose : abort this command
+9 -20
drivers/scsi/arm/powertec.c
··· 237 237 * inout - 0 for reading, 1 for writing. 238 238 * Returns : length of data written to buffer. 239 239 */ 240 - int powertecscsi_proc_info(struct Scsi_Host *host, char *buffer, char **start, off_t offset, 241 - int length, int inout) 240 + static int powertecscsi_show_info(struct seq_file *m, struct Scsi_Host *host) 242 241 { 243 242 struct powertec_info *info; 244 - char *p = buffer; 245 - int pos; 246 - 247 - if (inout == 1) 248 - return powertecscsi_set_proc_info(host, buffer, length); 249 243 250 244 info = (struct powertec_info *)host->hostdata; 251 245 252 - p += sprintf(p, "PowerTec SCSI driver v%s\n", VERSION); 253 - p += fas216_print_host(&info->info, p); 254 - p += sprintf(p, "Term : o%s\n", 246 + seq_printf(m, "PowerTec SCSI driver v%s\n", VERSION); 247 + fas216_print_host(&info->info, m); 248 + seq_printf(m, "Term : o%s\n", 255 249 info->term_ctl ? "n" : "ff"); 256 250 257 - p += fas216_print_stats(&info->info, p); 258 - p += fas216_print_devices(&info->info, p); 259 - 260 - *start = buffer + offset; 261 - pos = p - buffer - offset; 262 - if (pos > length) 263 - pos = length; 264 - 265 - return pos; 251 + fas216_print_stats(&info->info, m); 252 + fas216_print_devices(&info->info, m); 253 + return 0; 266 254 } 267 255 268 256 static ssize_t powertecscsi_show_term(struct device *dev, struct device_attribute *attr, char *buf) ··· 279 291 280 292 static struct scsi_host_template powertecscsi_template = { 281 293 .module = THIS_MODULE, 282 - .proc_info = powertecscsi_proc_info, 294 + .show_info = powertecscsi_show_info, 295 + .write_info = powertecscsi_set_proc_info, 283 296 .name = "PowerTec SCSI", 284 297 .info = powertecscsi_info, 285 298 .queuecommand = fas216_queue_command,