RE: [PATCH v2 1/2] scsi: ufs: Prepare to add HCI capabilities sysfs

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

 



> On 8/4/24 12:21 AM, Avri Altman wrote:
> > -     up(&hba->host_sem);
> > -     return ret;
> > +     return sysfs_emit(buf, "%d\n", ufshcd_ahit_to_us(ahit));
> >   }
> 
> All ufshcd_read_hci_reg() callers call sysfs_emit(). How about renaming
> ufshcd_read_hci_reg() into ufshcd_show_hci_reg(), adding an argument that
> indicates how the result should be formatted and moving the
> sysfs_emit() call into ufshcd_show_hci_reg()?
Yes, but with the cost of:
 - complication - You would need to attend the extra processing e.g. if ufs4.0 or as in hibern8 ahit_to_us(),
 - readability - read_hci_reg does just that (reading), and nothing more
 - breaks the _show _store convention that one would expect from a sysfs entry

Wouldn't keep it simple be better?

Thanks,
Avri
> 
> Thanks,
> 
> Bart.




[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