lkml.org 
[lkml]   [2020]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 3/3] scsi: ufs: use UFS device indicated maximum LU number
From
Date
On 2020-01-10 10:36, Bean Huo wrote:
> @@ -548,12 +547,19 @@ struct ufs_dev_desc {
>
> /**
> * ufs_is_valid_unit_desc_lun - checks if the given LUN has a unit descriptor
> + * @dev_info: pointer of instance of struct ufs_dev_info
> * @lun: LU number to check
> * @return: true if the lun has a matching unit descriptor, false otherwise
> */
> -static inline bool ufs_is_valid_unit_desc_lun(u8 lun)
> +static inline bool ufs_is_valid_unit_desc_lun(struct ufs_dev_info *dev_info,
> + u8 lun)
> {

Can the dev_info be declared 'const' (const truct ufs_dev_info *dev_info)?

> - return lun == UFS_UPIU_RPMB_WLUN || (lun < UFS_UPIU_MAX_GENERAL_LUN);
> + if (!dev_info || !dev_info->max_lu_supported) {
> + pr_err("Max General LU supported by UFS isn't initilized\n");
^^^^^^^^^^
initialized?
> + return false;
> + }
> +
> + return lun == UFS_UPIU_RPMB_WLUN || (lun < dev_info->max_lu_supported);
> }

Are the parentheses in the above expression necessary?

Thanks,

Bart.

\
 
 \ /
  Last update: 2020-01-11 23:51    [W:0.092 / U:4.508 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site