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

usb-storage: switch to ->show_info()

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

Al Viro 09dae7fc dd7ab71b

+14 -28
+14 -28
drivers/usb/storage/scsiglue.c
··· 438 438 * /proc/scsi/ functions 439 439 ***********************************************************************/ 440 440 441 + static int write_info(struct Scsi_Host *host, char *buffer, int length) 442 + { 443 + /* if someone is sending us data, just throw it away */ 444 + return length; 445 + } 446 + 441 447 /* we use this macro to help us write into the buffer */ 442 448 #undef SPRINTF 443 - #define SPRINTF(args...) \ 444 - do { if (pos < buffer+length) pos += sprintf(pos, ## args); } while (0) 449 + #define SPRINTF(args...) seq_printf(m, ## args) 445 450 446 - static int proc_info (struct Scsi_Host *host, char *buffer, 447 - char **start, off_t offset, int length, int inout) 451 + static int show_info (struct seq_file *m, struct Scsi_Host *host) 448 452 { 449 453 struct us_data *us = host_to_us(host); 450 - char *pos = buffer; 451 454 const char *string; 452 - 453 - /* if someone is sending us data, just throw it away */ 454 - if (inout) 455 - return length; 456 455 457 456 /* print the controller name */ 458 457 SPRINTF(" Host scsi%d: usb-storage\n", host->host_no); ··· 482 483 SPRINTF(" Transport: %s\n", us->transport_name); 483 484 484 485 /* show the device flags */ 485 - if (pos < buffer + length) { 486 - pos += sprintf(pos, " Quirks:"); 486 + SPRINTF(" Quirks:"); 487 487 488 488 #define US_FLAG(name, value) \ 489 - if (us->fflags & value) pos += sprintf(pos, " " #name); 489 + if (us->fflags & value) seq_printf(m, " " #name); 490 490 US_DO_ALL_FLAGS 491 491 #undef US_FLAG 492 - 493 - *(pos++) = '\n'; 494 - } 495 - 496 - /* 497 - * Calculate start of next buffer, and return value. 498 - */ 499 - *start = buffer + offset; 500 - 501 - if ((pos - buffer) < offset) 502 - return (0); 503 - else if ((pos - buffer - offset) < length) 504 - return (pos - buffer - offset); 505 - else 506 - return (length); 492 + seq_putc(m, '\n'); 493 + return 0; 507 494 } 508 495 509 496 /*********************************************************************** ··· 534 549 /* basic userland interface stuff */ 535 550 .name = "usb-storage", 536 551 .proc_name = "usb-storage", 537 - .proc_info = proc_info, 552 + .show_info = show_info, 553 + .write_info = write_info, 538 554 .info = host_info, 539 555 540 556 /* command interface -- queued only */