[PATCH] soc: qcom: smem: Fix signedness bug

Ethan Tidmore <[email protected]>
Newsgroups gmane.linux.ports.arm.msm,gmane.linux.kernel
Message-ID <[email protected]>
The function smem_dram_infer_struct_version() returns negative error
codes and 'ver' is an enum, which makes subsequent condition (ver < 0)
always impossible.

Fixes: 1d234eeafc56a ("soc: qcom: smem: Expose DDR data from SMEM")
Signed-off-by: Ethan Tidmore <[email protected]>
---
 drivers/soc/qcom/smem_dramc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/soc/qcom/smem_dramc.c b/drivers/soc/qcom/smem_dramc.c
index 63ebe7f6db59..3a3d2f8f1775 100644
--- a/drivers/soc/qcom/smem_dramc.c
+++ b/drivers/soc/qcom/smem_dramc.c
@@ -371,10 +371,10 @@ DEFINE_SHOW_ATTRIBUTE(smem_hbb);
 struct dentry *smem_dram_parse(struct qcom_smem *smem, struct device *dev)
 {
 	struct dentry *debugfs_dir;
-	enum ddr_info_version ver;
 	struct smem_dram *dram;
 	size_t actual_size;
 	void *data;
+	int ver;
 
 	/* No need to check qcom_smem_is_available(), this func is called by the SMEM driver */
 	data = __qcom_smem_get(smem, QCOM_SMEM_HOST_ANY, SMEM_DDR_INFO_ID, &actual_size);
-- 
Thanks,
ET
https://github.com/sponsors/ethantidmore
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.