[COMMON] ufs: fix build error in clang compiler
authorhgchu <hg.chu@samsung.com>
Mon, 26 Mar 2018 02:27:05 +0000 (11:27 +0900)
committerCosmin Tanislav <demonsingur@gmail.com>
Mon, 22 Apr 2024 17:22:12 +0000 (20:22 +0300)
Equality comparison with extraneous parentheses error fixed.

Change-Id: Iae6545f83d379080a7ebe5a414481bed6f8bd5ff
Signed-off-by: hgchu <hg.chu@samsung.com>
drivers/scsi/ufs/ufs-exynos.c
drivers/scsi/ufs/ufshcd.c
drivers/scsi/ufs/ufshcd.h

index b24b984c69e018403fd2abbd0e134d82726b5bb7..2548f9c5e30f639ceacfcf35eb934a4531e4d3fa 100644 (file)
@@ -965,7 +965,7 @@ static int __exynos_ufs_resume(struct ufs_hba *hba, enum ufs_pm_op pm_op)
        return 0;
 }
 
-static u8 exynos_ufs_get_unipro_direct(struct ufs_hba *hba, int num)
+static u8 exynos_ufs_get_unipro_direct(struct ufs_hba *hba, u32 num)
 {
        u32 offset[] = {
                UNIP_DME_LINKSTARTUP_CNF_RESULT,
index 2572070054f2f143229bba08ff350ba8f975e826..2539920c86c84cc7cdd490d18a24da52f92b3bde 100644 (file)
@@ -2037,23 +2037,22 @@ ufshcd_wait_for_uic_cmd(struct ufs_hba *hba, struct uic_command *uic_cmd)
 {
        int ret;
        unsigned long flags;
-       int index;
-
-       if (uic_cmd->command == UIC_CMD_DME_LINK_STARTUP)
-               index = 0;
-       else if ((uic_cmd->command == UIC_CMD_DME_HIBER_ENTER))
-               index = 1;
-       else if ((uic_cmd->command == UIC_CMD_DME_HIBER_EXIT))
-               index = 2;
-       else
-               index = -1;
 
        if (wait_for_completion_timeout(&uic_cmd->done,
                                msecs_to_jiffies(UIC_CMD_TIMEOUT))) {
-               if ((hba->quirks & UFSHCD_QUIRK_GET_GENERRCODE_DIRECT) && (index != -1))
-                       ret = ufshcd_vops_get_unipro(hba, index);
-               else
-                       ret = uic_cmd->argument2 & MASK_UIC_COMMAND_RESULT;
+               switch (uic_cmd->command) {
+               case UIC_CMD_DME_LINK_STARTUP:
+               case UIC_CMD_DME_HIBER_ENTER:
+               case UIC_CMD_DME_HIBER_EXIT:
+                       if (hba->quirks & UFSHCD_QUIRK_GET_GENERRCODE_DIRECT)
+                               ret = ufshcd_vops_get_unipro(hba, uic_cmd->command - UIC_CMD_DME_LINK_STARTUP);
+                       else
+                               ret = uic_cmd->argument2 & MASK_UIC_COMMAND_RESULT;
+                       break;
+               default:
+                               ret = uic_cmd->argument2 & MASK_UIC_COMMAND_RESULT;
+                       break;
+               }
        } else
                ret = -ETIMEDOUT;
 
index 50fa468ab7472939427b8a426c95b6392d20997a..9e74fb8e09aff568519aa046be883378eb92e2a2 100644 (file)
@@ -337,7 +337,7 @@ struct ufs_hba_variant_ops {
        int     (*suspend)(struct ufs_hba *, enum ufs_pm_op);
        int     (*resume)(struct ufs_hba *, enum ufs_pm_op);
        void    (*dbg_register_dump)(struct ufs_hba *hba);
-       u8      (*get_unipro_result)(struct ufs_hba *hba, int num);
+       u8      (*get_unipro_result)(struct ufs_hba *hba, u32 num);
        int     (*phy_initialization)(struct ufs_hba *);
        int     (*crypto_engine_cfg)(struct ufs_hba *, struct ufshcd_lrb *,
                                        struct scatterlist *, int, int);