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

aha152x: switch to ->show_info()

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

Al Viro 275084cb 31491e1a

+12 -49
+12 -49
drivers/scsi/aha152x.c
··· 2977 2977 } 2978 2978 2979 2979 #undef SPRINTF 2980 - #define SPRINTF(args...) pos += sprintf(pos, ## args) 2980 + #define SPRINTF(args...) seq_printf(m, ##args) 2981 2981 2982 - static int get_command(char *pos, Scsi_Cmnd * ptr) 2982 + static void get_command(struct seq_file *m, Scsi_Cmnd * ptr) 2983 2983 { 2984 - char *start = pos; 2985 2984 int i; 2986 2985 2987 2986 SPRINTF("%p: target=%d; lun=%d; cmnd=( ", ··· 3010 3011 if (ptr->SCp.phase & syncneg) 3011 3012 SPRINTF("syncneg|"); 3012 3013 SPRINTF("; next=0x%p\n", SCNEXT(ptr)); 3013 - 3014 - return (pos - start); 3015 3014 } 3016 3015 3017 - static int get_ports(struct Scsi_Host *shpnt, char *pos) 3016 + static void get_ports(struct seq_file *m, struct Scsi_Host *shpnt) 3018 3017 { 3019 - char *start = pos; 3020 3018 int s; 3021 3019 3022 3020 SPRINTF("\n%s: %s(%s) ", CURRENT_SC ? "on bus" : "waiting", states[STATE].name, states[PREVSTATE].name); ··· 3269 3273 if (s & ENREQINIT) 3270 3274 SPRINTF("ENREQINIT "); 3271 3275 SPRINTF(")\n"); 3272 - 3273 - return (pos - start); 3274 3276 } 3275 3277 3276 - static int aha152x_set_info(char *buffer, int length, struct Scsi_Host *shpnt) 3278 + static int aha152x_set_info(struct Scsi_Host *shpnt, char *buffer, int length) 3277 3279 { 3278 3280 if(!shpnt || !buffer || length<8 || strncmp("aha152x ", buffer, 8)!=0) 3279 3281 return -EINVAL; ··· 3314 3320 return length; 3315 3321 } 3316 3322 3317 - #undef SPRINTF 3318 - #define SPRINTF(args...) \ 3319 - do { if(pos < buffer + length) pos += sprintf(pos, ## args); } while(0) 3320 - 3321 - static int aha152x_proc_info(struct Scsi_Host *shpnt, char *buffer, char **start, 3322 - off_t offset, int length, int inout) 3323 + static int aha152x_show_info(struct seq_file *m, struct Scsi_Host *shpnt) 3323 3324 { 3324 3325 int i; 3325 - char *pos = buffer; 3326 3326 Scsi_Cmnd *ptr; 3327 3327 unsigned long flags; 3328 - int thislength; 3329 - 3330 - DPRINTK(debug_procinfo, 3331 - KERN_DEBUG "aha152x_proc_info: buffer=%p offset=%ld length=%d hostno=%d inout=%d\n", 3332 - buffer, offset, length, shpnt->host_no, inout); 3333 - 3334 - 3335 - if (inout) 3336 - return aha152x_set_info(buffer, length, shpnt); 3337 3328 3338 3329 SPRINTF(AHA152X_REVID "\n"); 3339 3330 ··· 3371 3392 if (ISSUE_SC) { 3372 3393 SPRINTF("not yet issued commands:\n"); 3373 3394 for (ptr = ISSUE_SC; ptr; ptr = SCNEXT(ptr)) 3374 - pos += get_command(pos, ptr); 3395 + get_command(m, ptr); 3375 3396 } else 3376 3397 SPRINTF("no not yet issued commands\n"); 3377 3398 DO_UNLOCK(flags); 3378 3399 3379 3400 if (CURRENT_SC) { 3380 3401 SPRINTF("current command:\n"); 3381 - pos += get_command(pos, CURRENT_SC); 3402 + get_command(m, CURRENT_SC); 3382 3403 } else 3383 3404 SPRINTF("no current command\n"); 3384 3405 3385 3406 if (DISCONNECTED_SC) { 3386 3407 SPRINTF("disconnected commands:\n"); 3387 3408 for (ptr = DISCONNECTED_SC; ptr; ptr = SCNEXT(ptr)) 3388 - pos += get_command(pos, ptr); 3409 + get_command(m, ptr); 3389 3410 } else 3390 3411 SPRINTF("no disconnected commands\n"); 3391 3412 3392 - pos += get_ports(shpnt, pos); 3413 + get_ports(m, shpnt); 3393 3414 3394 3415 #if defined(AHA152X_STAT) 3395 3416 SPRINTF("statistics:\n" ··· 3419 3440 HOSTDATA(shpnt)->time[i]); 3420 3441 } 3421 3442 #endif 3422 - 3423 - DPRINTK(debug_procinfo, KERN_DEBUG "aha152x_proc_info: pos=%p\n", pos); 3424 - 3425 - thislength = pos - (buffer + offset); 3426 - DPRINTK(debug_procinfo, KERN_DEBUG "aha152x_proc_info: length=%d thislength=%d\n", length, thislength); 3427 - 3428 - if(thislength<0) { 3429 - DPRINTK(debug_procinfo, KERN_DEBUG "aha152x_proc_info: output too short\n"); 3430 - *start = NULL; 3431 - return 0; 3432 - } 3433 - 3434 - thislength = thislength<length ? thislength : length; 3435 - 3436 - DPRINTK(debug_procinfo, KERN_DEBUG "aha152x_proc_info: return %d\n", thislength); 3437 - 3438 - *start = buffer + offset; 3439 - return thislength < length ? thislength : length; 3443 + return 0; 3440 3444 } 3441 3445 3442 3446 static int aha152x_adjust_queue(struct scsi_device *device) ··· 3432 3470 .module = THIS_MODULE, 3433 3471 .name = AHA152X_REVID, 3434 3472 .proc_name = "aha152x", 3435 - .proc_info = aha152x_proc_info, 3473 + .show_info = aha152x_show_info, 3474 + .write_info = aha152x_set_info, 3436 3475 .queuecommand = aha152x_queue, 3437 3476 .eh_abort_handler = aha152x_abort, 3438 3477 .eh_device_reset_handler = aha152x_device_reset,