lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Wed, 2 Nov 2022 08:53:13 +0000 From: Avri Altman <Avri.Altman@....com> To: Jiaming Li <lijiaming3@...omi.corp-partner.google.com>, "alim.akhtar@...sung.com" <alim.akhtar@...sung.com>, "bvanassche@....org" <bvanassche@....org> CC: "linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>, "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, lijiaming3 <lijiaming3@...omi.com> Subject: RE: [RESEND PATCH 4/4] scsi:ufs:add fbo functionality 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
Powered by blists - more mailing lists