From: hgchu Date: Mon, 26 Mar 2018 02:27:05 +0000 (+0900) Subject: [COMMON] ufs: fix build error in clang compiler X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7ec8af94d3f7ae24628d85462470289cc98bc88e;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [COMMON] ufs: fix build error in clang compiler Equality comparison with extraneous parentheses error fixed. Change-Id: Iae6545f83d379080a7ebe5a414481bed6f8bd5ff Signed-off-by: hgchu --- diff --git a/drivers/scsi/ufs/ufs-exynos.c b/drivers/scsi/ufs/ufs-exynos.c index b24b984c69e0..2548f9c5e30f 100644 --- a/drivers/scsi/ufs/ufs-exynos.c +++ b/drivers/scsi/ufs/ufs-exynos.c @@ -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, diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 3be7dc65ecdd..7460a5ad645a 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -2027,23 +2027,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; diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h index 649ea54c7132..7f0f5677cce5 100644 --- a/drivers/scsi/ufs/ufshcd.h +++ b/drivers/scsi/ufs/ufshcd.h @@ -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);