Re: [PATCH v2 28/29] scsi: ufs: Move the ufs_is_valid_unit_desc_lun() definition

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2022-04-12 at 11:18 -0700, Bart Van Assche wrote:
> diff --git a/drivers/scsi/ufs/ufshcd-priv.h
> b/drivers/scsi/ufs/ufshcd-priv.h
> index 3fa8ab94e4e1..38bc77d3dbbd 100644
> --- a/drivers/scsi/ufs/ufshcd-priv.h
> +++ b/drivers/scsi/ufs/ufshcd-priv.h
> @@ -276,4 +276,23 @@ static inline int ufshcd_rpm_put(struct ufs_hba
> *hba)
>         return pm_runtime_put(&hba->ufs_device_wlun->sdev_gendev);
>  }
>  
> +/**
> + * 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(struct ufs_dev_info
> *dev_info,
> +               u8 lun, u8 param_offset)
> +{
> +       if (!dev_info || !dev_info->max_lu_supported) {
> +               pr_err("Max General LU supported by UFS isn't
> initialized\n");
> +               return false;
> +       }
> +       /* WB is available only for the logical unit from 0 to 7 */
> +       if (param_offset == UNIT_DESC_PARAM_WB_BUF_ALLOC_UNITS)
> +               return lun < UFS_UPIU_MAX_WB_LUN_ID;
> +       return lun == UFS_UPIU_RPMB_WLUN || (lun < dev_info-
> >max_lu_supported);
> +}
> +
>  #endif /* _UFSHCD_PRIV_H_ */


You didn't move this function to drivers/ufs/core/ufshcd-priv.h,
It is used by the drivers/ufs/core/ufs-sysfs.c. Otherwise, there is no
problem in compiling.


Kind regards,
Bean







[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux