@@ -5500,7 +5500,7 @@ dasd_eckd_ioctl(struct dasd_block *block, unsigned int cmd, void __user *argp)
5500
5500
* Dump the range of CCWs into 'page' buffer
5501
5501
* and return number of printed chars.
5502
5502
*/
5503
- static int
5503
+ static void
5504
5504
dasd_eckd_dump_ccw_range (struct ccw1 * from , struct ccw1 * to , char * page )
5505
5505
{
5506
5506
int len , count ;
@@ -5518,16 +5518,21 @@ dasd_eckd_dump_ccw_range(struct ccw1 *from, struct ccw1 *to, char *page)
5518
5518
else
5519
5519
datap = (char * ) ((addr_t ) from -> cda );
5520
5520
5521
- /* dump data (max 32 bytes) */
5522
- for (count = 0 ; count < from -> count && count < 32 ; count ++ ) {
5523
- if (count % 8 == 0 ) len += sprintf (page + len , " " );
5524
- if (count % 4 == 0 ) len += sprintf (page + len , " " );
5521
+ /* dump data (max 128 bytes) */
5522
+ for (count = 0 ; count < from -> count && count < 128 ; count ++ ) {
5523
+ if (count % 32 == 0 )
5524
+ len += sprintf (page + len , "\n" );
5525
+ if (count % 8 == 0 )
5526
+ len += sprintf (page + len , " " );
5527
+ if (count % 4 == 0 )
5528
+ len += sprintf (page + len , " " );
5525
5529
len += sprintf (page + len , "%02x" , datap [count ]);
5526
5530
}
5527
5531
len += sprintf (page + len , "\n" );
5528
5532
from ++ ;
5529
5533
}
5530
- return len ;
5534
+ if (len > 0 )
5535
+ printk (KERN_ERR "%s" , page );
5531
5536
}
5532
5537
5533
5538
static void
@@ -5619,37 +5624,33 @@ static void dasd_eckd_dump_sense_ccw(struct dasd_device *device,
5619
5624
if (req ) {
5620
5625
/* req == NULL for unsolicited interrupts */
5621
5626
/* dump the Channel Program (max 140 Bytes per line) */
5622
- /* Count CCW and print first CCWs (maximum 1024 % 140 = 7) */
5627
+ /* Count CCW and print first CCWs (maximum 7) */
5623
5628
first = req -> cpaddr ;
5624
5629
for (last = first ; last -> flags & (CCW_FLAG_CC | CCW_FLAG_DC ); last ++ );
5625
5630
to = min (first + 6 , last );
5626
- len = sprintf (page , PRINTK_HEADER
5627
- " Related CP in req: %p\n" , req );
5628
- dasd_eckd_dump_ccw_range (first , to , page + len );
5629
- printk (KERN_ERR "%s" , page );
5631
+ printk (KERN_ERR PRINTK_HEADER " Related CP in req: %p\n" , req );
5632
+ dasd_eckd_dump_ccw_range (first , to , page );
5630
5633
5631
5634
/* print failing CCW area (maximum 4) */
5632
5635
/* scsw->cda is either valid or zero */
5633
- len = 0 ;
5634
5636
from = ++ to ;
5635
5637
fail = (struct ccw1 * )(addr_t )
5636
5638
irb -> scsw .cmd .cpa ; /* failing CCW */
5637
5639
if (from < fail - 2 ) {
5638
5640
from = fail - 2 ; /* there is a gap - print header */
5639
- len += sprintf ( page , PRINTK_HEADER "......\n" );
5641
+ printk ( KERN_ERR PRINTK_HEADER "......\n" );
5640
5642
}
5641
5643
to = min (fail + 1 , last );
5642
- len += dasd_eckd_dump_ccw_range (from , to , page + len );
5644
+ dasd_eckd_dump_ccw_range (from , to , page + len );
5643
5645
5644
5646
/* print last CCWs (maximum 2) */
5647
+ len = 0 ;
5645
5648
from = max (from , ++ to );
5646
5649
if (from < last - 1 ) {
5647
5650
from = last - 1 ; /* there is a gap - print header */
5648
- len += sprintf ( page + len , PRINTK_HEADER "......\n" );
5651
+ printk ( KERN_ERR PRINTK_HEADER "......\n" );
5649
5652
}
5650
- len += dasd_eckd_dump_ccw_range (from , last , page + len );
5651
- if (len > 0 )
5652
- printk (KERN_ERR "%s" , page );
5653
+ dasd_eckd_dump_ccw_range (from , last , page + len );
5653
5654
}
5654
5655
free_page ((unsigned long ) page );
5655
5656
}
0 commit comments