Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d095e311 authored by Subhash Jadavani's avatar Subhash Jadavani
Browse files

scsi: ufs: fix compilation errors with gcc5



When compiling with gcc5, it throws below errors:

drivers/scsi/ufs/ufs-qcom.c: In function 'ufs_qcom_hce_enable_notify':
drivers/scsi/ufs/ufs-qcom.c:352:10: warning: switch condition has boolean
value [-Wswitch-bool] error, forbidden warning: ufs-qcom.c:352

This is because we are using the boolean value in switch condition and it
seems to be forbidden by compiler (by default). Fix this by using the
proper enum type instead of boolean.

Change-Id: Iee6950e5986dc51afbf9440cd4773b4d0f02fcdc
Signed-off-by: default avatarSubhash Jadavani <subhashj@codeaurora.org>
parent d3846f3c
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -345,7 +345,8 @@ static void ufs_qcom_enable_hw_clk_gating(struct ufs_hba *hba)
	mb();
}

static int ufs_qcom_hce_enable_notify(struct ufs_hba *hba, bool status)
static int ufs_qcom_hce_enable_notify(struct ufs_hba *hba,
				      enum ufs_notify_change_status status)
{
	struct ufs_qcom_host *host = hba->priv;
	int err = 0;
@@ -530,7 +531,8 @@ out:
	return ret;
}

static int ufs_qcom_link_startup_notify(struct ufs_hba *hba, bool status)
static int ufs_qcom_link_startup_notify(struct ufs_hba *hba,
					enum ufs_notify_change_status status)
{
	int err = 0;
	struct ufs_qcom_host *host = hba->priv;
@@ -908,7 +910,7 @@ static void ufs_qcom_dev_ref_clk_ctrl(struct ufs_qcom_host *host, bool enable)
}

static int ufs_qcom_pwr_change_notify(struct ufs_hba *hba,
				bool status,
				enum ufs_notify_change_status status,
				struct ufs_pa_layer_attr *dev_max_params,
				struct ufs_pa_layer_attr *dev_req_params)
{
+10 −5
Original line number Diff line number Diff line
@@ -264,8 +264,10 @@ struct ufs_clk_info {
	bool enabled;
};

#define PRE_CHANGE      0
#define POST_CHANGE     1
enum ufs_notify_change_status {
	PRE_CHANGE,
	POST_CHANGE,
};

struct ufs_pa_layer_attr {
	u32 gear_rx;
@@ -325,10 +327,13 @@ struct ufs_hba_variant_ops {
	int	(*clk_scale_notify)(struct ufs_hba *, bool, bool);
	int	(*setup_clocks)(struct ufs_hba *, bool);
	int	(*setup_regulators)(struct ufs_hba *, bool);
	int	(*hce_enable_notify)(struct ufs_hba *, bool);
	int	(*link_startup_notify)(struct ufs_hba *, bool);
	int	(*hce_enable_notify)(struct ufs_hba *,
				     enum ufs_notify_change_status);
	int	(*link_startup_notify)(struct ufs_hba *,
				       enum ufs_notify_change_status);
	int	(*pwr_change_notify)(struct ufs_hba *,
					bool, struct ufs_pa_layer_attr *,
					enum ufs_notify_change_status status,
					struct ufs_pa_layer_attr *,
					struct ufs_pa_layer_attr *);
	int	(*suspend)(struct ufs_hba *, enum ufs_pm_op);
	int	(*resume)(struct ufs_hba *, enum ufs_pm_op);