RE: [PATCH] scsi: ufs: Split struct ufs_hba

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

 



Hi Bart,

>Improve separation between UFSHCI core and host drivers by splitting
>struct ufs_hba. This patch does not change the behavior of the UFS
>driver. The conversions between the struct ufs_hba and the struct
>ufs_hba_priv pointer types do not introduce any overhead since the
>compiler can optimize these out.
> 
>Cc: Adrian Hunter <adrian.hunter@xxxxxxxxx>
>Cc: Avri Altman <avri.altman@xxxxxxx>
>Cc: Bean Huo <beanhuo@xxxxxxxxxx>
>Cc: Bjorn Andersson <bjorn.andersson@xxxxxxxxxx>
>Cc: Keoseong Park <keosung.park@xxxxxxxxxxx>
>Cc: Eric Biggers <ebiggers@xxxxxxxxxx>
>Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx>
>---
> drivers/ufs/core/ufs-debugfs.c   |   79 +-
> drivers/ufs/core/ufs-hwmon.c     |   42 +-
> drivers/ufs/core/ufs-sysfs.c     |  141 ++-
> drivers/ufs/core/ufs_bsg.c       |   14 +-
> drivers/ufs/core/ufshcd-crypto.c |   49 +-
> drivers/ufs/core/ufshcd-priv.h   |  229 +++-
> drivers/ufs/core/ufshcd.c        | 1782 ++++++++++++++++--------------
> drivers/ufs/core/ufshpb.c        |   40 +-
> include/ufs/ufshcd.h             |  175 +--
> 9 files changed, 1409 insertions(+), 1142 deletions(-)
> 
>diff --git a/drivers/ufs/core/ufs-debugfs.c b/drivers/ufs/core/ufs-debugfs.c
>index e3baed6c70bd..12ff7bdf84aa 100644
>--- a/drivers/ufs/core/ufs-debugfs.c
>+++ b/drivers/ufs/core/ufs-debugfs.c
>@@ -34,7 +34,8 @@ void ufs_debugfs_exit(void)
> static int ufs_debugfs_stats_show(struct seq_file *s, void *data)
> {
>         struct ufs_hba *hba = hba_from_file(s->file);
>-        struct ufs_event_hist *e = hba->ufs_stats.event;
>+        struct ufs_hba_priv *priv = container_of(hba, typeof(*priv), hba);

How about functionalizing container_of in ufshcd-priv.h like below?

static inline struct ufs_hba_priv *hba_to_hba_priv(struct ufs_hba *hba)
{
        return container_of(hba, struct ufs_hba_priv, hba);
}

I think it will be easy to understand.

Best Regards,
Keoseong Park

>+        struct ufs_event_hist *e = priv->ufs_stats.event;
> 
> #define PRT(fmt, typ) \
>         seq_printf(s, fmt, e[UFS_EVT_ ## typ].cnt)
>



[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