Re: [PATCH v2 3/8] scsi: ufs: core: Add a vops to map clock frequency to gear speed

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

 





On 1/23/2025 2:30 AM, Bart Van Assche wrote:
On 1/22/25 2:02 AM, Ziqi Chen wrote:
+static inline int ufshcd_vops_freq_to_gear_speed(struct ufs_hba *hba,
+                         unsigned long freq,
+                         u32 *gear)
+{
+    if (hba->vops && hba->vops->freq_to_gear_speed)
+        return hba->vops->freq_to_gear_speed(hba, freq, gear);
+
+    return -EOPNOTSUPP;
+}

Please remove "vops_" from the function name. I don't think this part of the function name is useful. Additionally, please return the gear value as the function result and remove the "u32 *gear" argument.

Thanks,

Bart.

Hi Bart,

Thanks for your review~

In ufshcd-priv.h , the function name of all vop wrapping APIs have the same prefix "ufshcd_vops", I need to use the same format as them.


As for return the gear value as the function result. In our original design, we also return gear result for this function, but finally we want to use return value to indicate the status , e.g,, if vendor doesn't implement this vop, we return -EOPNOTSUPP , if there is no matched gear to the freq , we return -EINVAL. Although we didn't check the return value in this series, we still want to preserve this extensibility in case this function be used to other where in the future.

-Ziqi




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [Linux for Sparc]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux