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