RE: [RESEND PATCH 4/4] scsi:ufs:add fbo functionality

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

 



Here also - missing spaces in the title.

...............

> +static int ufsfbo_get_fbo_prog_state(struct ufs_hba *hba, int
> +*prog_state) {
> +       int ret = 0, attr = -1;
> +
> +       down(&hba->host_sem);
> +       if (!ufshcd_is_user_access_allowed(hba)) {
> +               ret = -EBUSY;
> +               goto out;
> +       }
> +       ufshcd_rpm_get_sync(hba);
> +       ret = ufshcd_query_attr_retry(hba, UPIU_QUERY_OPCODE_READ_ATTR,
> +                       QUERY_ATTR_IDN_FBO_PROG_STATE, 0, 0, &attr);
> +       ufshcd_rpm_put_sync(hba);
> +       if (ret) {
> +               pr_err("Query attr fbo prog state failed.");
> +               goto out;
> +       }
> +
> +       switch (attr) {
> +       case 0x0:
> +       case 0x1:
> +       case 0x2:
> +       case 0x3:
> +       case 0xff:
Maybe use enum UFSFBO_PROG_STATE values?

..................

> +static ssize_t fbo_operation_ctrl_store(struct device *dev,
> +                                   struct device_attribute *attr,
> +                                   const char *buf, size_t count) {
> +       int ret = 0;
> +       u32 val;
> +       struct scsi_device *sdev = to_scsi_device(dev);
> +       struct ufs_hba *hba = shost_priv(sdev->host);
> +
> +       if (kstrtouint(buf, 0, &val))
> +               return -EINVAL;
Maybe also test for valid bFBOControl value?
And add the appropriate enum as well.


Thanks,
Avri




[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