diff options
author | Bean Huo <beanhuo@micron.com> | 2020-06-03 12:19:55 +0300 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2020-06-16 06:17:45 +0300 |
commit | 458a45f5262b294e68c0f3ecb5db76d1be757a33 (patch) | |
tree | 820c5559057d0512ff180a968f9b97102ed8e3cd /drivers/scsi/ufs | |
parent | fc4983018fea1237e027a9fc6530a3e04850fbfa (diff) | |
download | linux-458a45f5262b294e68c0f3ecb5db76d1be757a33.tar.xz |
scsi: ufs: Remove max_t in ufs_get_device_desc
For the UFS device, the maximum descriptor size is 255, max_t called on
ufs_get_device_desc() is useless.
Link: https://lore.kernel.org/r/20200603091959.27618-2-huobean@gmail.com
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
Acked-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Bart van Assche <bvanassche@acm.org>
Signed-off-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/ufs')
-rw-r--r-- | drivers/scsi/ufs/ufshcd.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index e83afcc56f88..ec6fbedff58e 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -7005,14 +7005,11 @@ static void ufs_fixup_device_setup(struct ufs_hba *hba) static int ufs_get_device_desc(struct ufs_hba *hba) { int err; - size_t buff_len; u8 model_index; u8 *desc_buf; struct ufs_dev_info *dev_info = &hba->dev_info; - buff_len = max_t(size_t, hba->desc_size.dev_desc, - QUERY_DESC_MAX_SIZE + 1); - desc_buf = kmalloc(buff_len, GFP_KERNEL); + desc_buf = kmalloc(QUERY_DESC_MAX_SIZE, GFP_KERNEL); if (!desc_buf) { err = -ENOMEM; goto out; |