@@ -1189,7 +1189,7 @@ static int p_fill_from_dev_buffer(struct scsi_cmnd *scp, const void *arr,
1189
1189
__func__ , off_dst , scsi_bufflen (scp ), act_len ,
1190
1190
scsi_get_resid (scp ));
1191
1191
n = scsi_bufflen (scp ) - (off_dst + act_len );
1192
- scsi_set_resid (scp , min_t (int , scsi_get_resid (scp ), n ));
1192
+ scsi_set_resid (scp , min_t (u32 , scsi_get_resid (scp ), n ));
1193
1193
return 0 ;
1194
1194
}
1195
1195
@@ -1562,7 +1562,8 @@ static int resp_inquiry(struct scsi_cmnd *scp, struct sdebug_dev_info *devip)
1562
1562
unsigned char pq_pdt ;
1563
1563
unsigned char * arr ;
1564
1564
unsigned char * cmd = scp -> cmnd ;
1565
- int alloc_len , n , ret ;
1565
+ u32 alloc_len , n ;
1566
+ int ret ;
1566
1567
bool have_wlun , is_disk , is_zbc , is_disk_zbc ;
1567
1568
1568
1569
alloc_len = get_unaligned_be16 (cmd + 3 );
@@ -1585,7 +1586,8 @@ static int resp_inquiry(struct scsi_cmnd *scp, struct sdebug_dev_info *devip)
1585
1586
kfree (arr );
1586
1587
return check_condition_result ;
1587
1588
} else if (0x1 & cmd [1 ]) { /* EVPD bit set */
1588
- int lu_id_num , port_group_id , target_dev_id , len ;
1589
+ int lu_id_num , port_group_id , target_dev_id ;
1590
+ u32 len ;
1589
1591
char lu_id_str [6 ];
1590
1592
int host_no = devip -> sdbg_host -> shost -> host_no ;
1591
1593
@@ -1676,9 +1678,9 @@ static int resp_inquiry(struct scsi_cmnd *scp, struct sdebug_dev_info *devip)
1676
1678
kfree (arr );
1677
1679
return check_condition_result ;
1678
1680
}
1679
- len = min ( get_unaligned_be16 (arr + 2 ) + 4 , alloc_len );
1681
+ len = min_t ( u32 , get_unaligned_be16 (arr + 2 ) + 4 , alloc_len );
1680
1682
ret = fill_from_dev_buffer (scp , arr ,
1681
- min ( len , SDEBUG_MAX_INQ_ARR_SZ ));
1683
+ min_t ( u32 , len , SDEBUG_MAX_INQ_ARR_SZ ));
1682
1684
kfree (arr );
1683
1685
return ret ;
1684
1686
}
@@ -1714,7 +1716,7 @@ static int resp_inquiry(struct scsi_cmnd *scp, struct sdebug_dev_info *devip)
1714
1716
}
1715
1717
put_unaligned_be16 (0x2100 , arr + n ); /* SPL-4 no version claimed */
1716
1718
ret = fill_from_dev_buffer (scp , arr ,
1717
- min_t (int , alloc_len , SDEBUG_LONG_INQ_SZ ));
1719
+ min_t (u32 , alloc_len , SDEBUG_LONG_INQ_SZ ));
1718
1720
kfree (arr );
1719
1721
return ret ;
1720
1722
}
@@ -1729,8 +1731,8 @@ static int resp_requests(struct scsi_cmnd *scp,
1729
1731
unsigned char * cmd = scp -> cmnd ;
1730
1732
unsigned char arr [SCSI_SENSE_BUFFERSIZE ]; /* assume >= 18 bytes */
1731
1733
bool dsense = !!(cmd [1 ] & 1 );
1732
- int alloc_len = cmd [4 ];
1733
- int len = 18 ;
1734
+ u32 alloc_len = cmd [4 ];
1735
+ u32 len = 18 ;
1734
1736
int stopped_state = atomic_read (& devip -> stopped );
1735
1737
1736
1738
memset (arr , 0 , sizeof (arr ));
@@ -1774,7 +1776,7 @@ static int resp_requests(struct scsi_cmnd *scp,
1774
1776
arr [7 ] = 0xa ;
1775
1777
}
1776
1778
}
1777
- return fill_from_dev_buffer (scp , arr , min_t (int , len , alloc_len ));
1779
+ return fill_from_dev_buffer (scp , arr , min_t (u32 , len , alloc_len ));
1778
1780
}
1779
1781
1780
1782
static int resp_start_stop (struct scsi_cmnd * scp , struct sdebug_dev_info * devip )
@@ -2312,7 +2314,8 @@ static int resp_mode_sense(struct scsi_cmnd *scp,
2312
2314
{
2313
2315
int pcontrol , pcode , subpcode , bd_len ;
2314
2316
unsigned char dev_spec ;
2315
- int alloc_len , offset , len , target_dev_id ;
2317
+ u32 alloc_len , offset , len ;
2318
+ int target_dev_id ;
2316
2319
int target = scp -> device -> id ;
2317
2320
unsigned char * ap ;
2318
2321
unsigned char arr [SDEBUG_MAX_MSENSE_SZ ];
@@ -2468,7 +2471,7 @@ static int resp_mode_sense(struct scsi_cmnd *scp,
2468
2471
arr [0 ] = offset - 1 ;
2469
2472
else
2470
2473
put_unaligned_be16 ((offset - 2 ), arr + 0 );
2471
- return fill_from_dev_buffer (scp , arr , min_t (int , alloc_len , offset ));
2474
+ return fill_from_dev_buffer (scp , arr , min_t (u32 , alloc_len , offset ));
2472
2475
}
2473
2476
2474
2477
#define SDEBUG_MAX_MSELECT_SZ 512
@@ -2583,7 +2586,8 @@ static int resp_ie_l_pg(unsigned char *arr)
2583
2586
static int resp_log_sense (struct scsi_cmnd * scp ,
2584
2587
struct sdebug_dev_info * devip )
2585
2588
{
2586
- int ppc , sp , pcode , subpcode , alloc_len , len , n ;
2589
+ int ppc , sp , pcode , subpcode ;
2590
+ u32 alloc_len , len , n ;
2587
2591
unsigned char arr [SDEBUG_MAX_LSENSE_SZ ];
2588
2592
unsigned char * cmd = scp -> cmnd ;
2589
2593
@@ -2653,9 +2657,9 @@ static int resp_log_sense(struct scsi_cmnd *scp,
2653
2657
mk_sense_invalid_fld (scp , SDEB_IN_CDB , 3 , -1 );
2654
2658
return check_condition_result ;
2655
2659
}
2656
- len = min_t (int , get_unaligned_be16 (arr + 2 ) + 4 , alloc_len );
2660
+ len = min_t (u32 , get_unaligned_be16 (arr + 2 ) + 4 , alloc_len );
2657
2661
return fill_from_dev_buffer (scp , arr ,
2658
- min_t (int , len , SDEBUG_MAX_INQ_ARR_SZ ));
2662
+ min_t (u32 , len , SDEBUG_MAX_INQ_ARR_SZ ));
2659
2663
}
2660
2664
2661
2665
static inline bool sdebug_dev_is_zoned (struct sdebug_dev_info * devip )
@@ -4430,7 +4434,7 @@ static int resp_report_zones(struct scsi_cmnd *scp,
4430
4434
put_unaligned_be64 (sdebug_capacity - 1 , arr + 8 );
4431
4435
4432
4436
rep_len = (unsigned long )desc - (unsigned long )arr ;
4433
- ret = fill_from_dev_buffer (scp , arr , min_t (int , alloc_len , rep_len ));
4437
+ ret = fill_from_dev_buffer (scp , arr , min_t (u32 , alloc_len , rep_len ));
4434
4438
4435
4439
fini :
4436
4440
read_unlock (macc_lckp );
0 commit comments