Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH -next] firmware: ti_sci: remove set but not used variable 'dev'
@ 2019-06-14 15:44 YueHaibing
  2019-06-14 16:26 ` Suman Anna
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: YueHaibing @ 2019-06-14 15:44 UTC (permalink / raw)
  To: nm, t-kristo, ssantosh, s-anna, santosh.shilimkar
  Cc: YueHaibing, linux-kernel, linux-arm-kernel

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/firmware/ti_sci.c: In function ti_sci_cmd_ring_config:
drivers/firmware/ti_sci.c:2035:17: warning: variable dev set but not used [-Wunused-but-set-variable]
drivers/firmware/ti_sci.c: In function ti_sci_cmd_ring_get_config:
drivers/firmware/ti_sci.c:2104:17: warning: variable dev set but not used [-Wunused-but-set-variable]
drivers/firmware/ti_sci.c: In function ti_sci_cmd_rm_udmap_tx_ch_cfg:
drivers/firmware/ti_sci.c:2287:17: warning: variable dev set but not used [-Wunused-but-set-variable]
drivers/firmware/ti_sci.c: In function ti_sci_cmd_rm_udmap_rx_ch_cfg:
drivers/firmware/ti_sci.c:2357:17: warning: variable dev set but not used [-Wunused-but-set-variable]

It is never used since commit 1e407f337f40 ("firmware:
ti_sci: Add support for processor control")

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/firmware/ti_sci.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c
index 86b2727..8c1a961 100644
--- a/drivers/firmware/ti_sci.c
+++ b/drivers/firmware/ti_sci.c
@@ -2032,14 +2032,12 @@ static int ti_sci_cmd_ring_config(const struct ti_sci_handle *handle,
 	struct ti_sci_msg_hdr *resp;
 	struct ti_sci_xfer *xfer;
 	struct ti_sci_info *info;
-	struct device *dev;
 	int ret = 0;
 
 	if (IS_ERR_OR_NULL(handle))
 		return -EINVAL;
 
 	info = handle_to_ti_sci_info(handle);
-	dev = info->dev;
 
 	xfer = ti_sci_get_one_xfer(info, TI_SCI_MSG_RM_RING_CFG,
 				   TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
@@ -2101,14 +2099,12 @@ static int ti_sci_cmd_ring_get_config(const struct ti_sci_handle *handle,
 	struct ti_sci_msg_rm_ring_get_cfg_req *req;
 	struct ti_sci_xfer *xfer;
 	struct ti_sci_info *info;
-	struct device *dev;
 	int ret = 0;
 
 	if (IS_ERR_OR_NULL(handle))
 		return -EINVAL;
 
 	info = handle_to_ti_sci_info(handle);
-	dev = info->dev;
 
 	xfer = ti_sci_get_one_xfer(info, TI_SCI_MSG_RM_RING_GET_CFG,
 				   TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
@@ -2284,14 +2280,12 @@ static int ti_sci_cmd_rm_udmap_tx_ch_cfg(const struct ti_sci_handle *handle,
 	struct ti_sci_msg_hdr *resp;
 	struct ti_sci_xfer *xfer;
 	struct ti_sci_info *info;
-	struct device *dev;
 	int ret = 0;
 
 	if (IS_ERR_OR_NULL(handle))
 		return -EINVAL;
 
 	info = handle_to_ti_sci_info(handle);
-	dev = info->dev;
 
 	xfer = ti_sci_get_one_xfer(info, TISCI_MSG_RM_UDMAP_TX_CH_CFG,
 				   TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
@@ -2354,14 +2348,12 @@ static int ti_sci_cmd_rm_udmap_rx_ch_cfg(const struct ti_sci_handle *handle,
 	struct ti_sci_msg_hdr *resp;
 	struct ti_sci_xfer *xfer;
 	struct ti_sci_info *info;
-	struct device *dev;
 	int ret = 0;
 
 	if (IS_ERR_OR_NULL(handle))
 		return -EINVAL;
 
 	info = handle_to_ti_sci_info(handle);
-	dev = info->dev;
 
 	xfer = ti_sci_get_one_xfer(info, TISCI_MSG_RM_UDMAP_RX_CH_CFG,
 				   TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
-- 
2.7.4



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH -next] firmware: ti_sci: remove set but not used variable 'dev'
  2019-06-14 15:44 [PATCH -next] firmware: ti_sci: remove set but not used variable 'dev' YueHaibing
@ 2019-06-14 16:26 ` Suman Anna
  2019-06-15 12:38 ` [PATCH v2 " YueHaibing
  2019-06-15 12:50 ` [PATCH v3 -next] firmware: ti_sci: Fix gcc unused-but-set-variable warning YueHaibing
  2 siblings, 0 replies; 7+ messages in thread
From: Suman Anna @ 2019-06-14 16:26 UTC (permalink / raw)
  To: YueHaibing, nm, t-kristo, ssantosh, santosh.shilimkar
  Cc: linux-kernel, linux-arm-kernel

On 6/14/19 10:44 AM, YueHaibing wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> drivers/firmware/ti_sci.c: In function ti_sci_cmd_ring_config:
> drivers/firmware/ti_sci.c:2035:17: warning: variable dev set but not used [-Wunused-but-set-variable]
> drivers/firmware/ti_sci.c: In function ti_sci_cmd_ring_get_config:
> drivers/firmware/ti_sci.c:2104:17: warning: variable dev set but not used [-Wunused-but-set-variable]
> drivers/firmware/ti_sci.c: In function ti_sci_cmd_rm_udmap_tx_ch_cfg:
> drivers/firmware/ti_sci.c:2287:17: warning: variable dev set but not used [-Wunused-but-set-variable]
> drivers/firmware/ti_sci.c: In function ti_sci_cmd_rm_udmap_rx_ch_cfg:
> drivers/firmware/ti_sci.c:2357:17: warning: variable dev set but not used [-Wunused-but-set-variable]

Thanks for the fix.

> 
> It is never used since commit 1e407f337f40 ("firmware:
> ti_sci: Add support for processor control")

Warnings are actually introduced in commit 68608b5e5063 ("firmware:
ti_sci: Add resource management APIs for ringacc, psi-l and udma").

While this patch fixes the warnings as well, I suggest to replace the
dev_dbg/dev_err traces in these functions to use the dev variable
instead of info->dev, to be consistent with the usage in the rest of the
file.

regards
Suman

> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  drivers/firmware/ti_sci.c | 8 --------
>  1 file changed, 8 deletions(-)
> 
> diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c
> index 86b2727..8c1a961 100644
> --- a/drivers/firmware/ti_sci.c
> +++ b/drivers/firmware/ti_sci.c
> @@ -2032,14 +2032,12 @@ static int ti_sci_cmd_ring_config(const struct ti_sci_handle *handle,
>  	struct ti_sci_msg_hdr *resp;
>  	struct ti_sci_xfer *xfer;
>  	struct ti_sci_info *info;
> -	struct device *dev;
>  	int ret = 0;
>  
>  	if (IS_ERR_OR_NULL(handle))
>  		return -EINVAL;
>  
>  	info = handle_to_ti_sci_info(handle);
> -	dev = info->dev;
>  
>  	xfer = ti_sci_get_one_xfer(info, TI_SCI_MSG_RM_RING_CFG,
>  				   TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
> @@ -2101,14 +2099,12 @@ static int ti_sci_cmd_ring_get_config(const struct ti_sci_handle *handle,
>  	struct ti_sci_msg_rm_ring_get_cfg_req *req;
>  	struct ti_sci_xfer *xfer;
>  	struct ti_sci_info *info;
> -	struct device *dev;
>  	int ret = 0;
>  
>  	if (IS_ERR_OR_NULL(handle))
>  		return -EINVAL;
>  
>  	info = handle_to_ti_sci_info(handle);
> -	dev = info->dev;
>  
>  	xfer = ti_sci_get_one_xfer(info, TI_SCI_MSG_RM_RING_GET_CFG,
>  				   TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
> @@ -2284,14 +2280,12 @@ static int ti_sci_cmd_rm_udmap_tx_ch_cfg(const struct ti_sci_handle *handle,
>  	struct ti_sci_msg_hdr *resp;
>  	struct ti_sci_xfer *xfer;
>  	struct ti_sci_info *info;
> -	struct device *dev;
>  	int ret = 0;
>  
>  	if (IS_ERR_OR_NULL(handle))
>  		return -EINVAL;
>  
>  	info = handle_to_ti_sci_info(handle);
> -	dev = info->dev;
>  
>  	xfer = ti_sci_get_one_xfer(info, TISCI_MSG_RM_UDMAP_TX_CH_CFG,
>  				   TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
> @@ -2354,14 +2348,12 @@ static int ti_sci_cmd_rm_udmap_rx_ch_cfg(const struct ti_sci_handle *handle,
>  	struct ti_sci_msg_hdr *resp;
>  	struct ti_sci_xfer *xfer;
>  	struct ti_sci_info *info;
> -	struct device *dev;
>  	int ret = 0;
>  
>  	if (IS_ERR_OR_NULL(handle))
>  		return -EINVAL;
>  
>  	info = handle_to_ti_sci_info(handle);
> -	dev = info->dev;
>  
>  	xfer = ti_sci_get_one_xfer(info, TISCI_MSG_RM_UDMAP_RX_CH_CFG,
>  				   TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
> 


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2 -next] firmware: ti_sci: remove set but not used variable 'dev'
  2019-06-14 15:44 [PATCH -next] firmware: ti_sci: remove set but not used variable 'dev' YueHaibing
  2019-06-14 16:26 ` Suman Anna
@ 2019-06-15 12:38 ` " YueHaibing
  2019-06-15 12:46   ` Yuehaibing
  2019-06-15 12:50 ` [PATCH v3 -next] firmware: ti_sci: Fix gcc unused-but-set-variable warning YueHaibing
  2 siblings, 1 reply; 7+ messages in thread
From: YueHaibing @ 2019-06-15 12:38 UTC (permalink / raw)
  To: nm, t-kristo, ssantosh, s-anna, santosh.shilimkar
  Cc: YueHaibing, linux-kernel, linux-arm-kernel

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/firmware/ti_sci.c: In function ti_sci_cmd_ring_config:
drivers/firmware/ti_sci.c:2035:17: warning: variable dev set but not used [-Wunused-but-set-variable]
drivers/firmware/ti_sci.c: In function ti_sci_cmd_ring_get_config:
drivers/firmware/ti_sci.c:2104:17: warning: variable dev set but not used [-Wunused-but-set-variable]
drivers/firmware/ti_sci.c: In function ti_sci_cmd_rm_udmap_tx_ch_cfg:
drivers/firmware/ti_sci.c:2287:17: warning: variable dev set but not used [-Wunused-but-set-variable]
drivers/firmware/ti_sci.c: In function ti_sci_cmd_rm_udmap_rx_ch_cfg:
drivers/firmware/ti_sci.c:2357:17: warning: variable dev set but not used [-Wunused-but-set-variable]

Use the 'dev' variable instead of 'info->dev' to fix this.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
v2: use the 'dev' variable as Suman Anna's suggestion
---
 drivers/firmware/ti_sci.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c
index 86b2727..c8da6e2 100644
--- a/drivers/firmware/ti_sci.c
+++ b/drivers/firmware/ti_sci.c
@@ -2046,7 +2046,7 @@ static int ti_sci_cmd_ring_config(const struct ti_sci_handle *handle,
 				   sizeof(*req), sizeof(*resp));
 	if (IS_ERR(xfer)) {
 		ret = PTR_ERR(xfer);
-		dev_err(info->dev, "RM_RA:Message config failed(%d)\n", ret);
+		dev_err(dev, "RM_RA:Message config failed(%d)\n", ret);
 		return ret;
 	}
 	req = (struct ti_sci_msg_rm_ring_cfg_req *)xfer->xfer_buf;
@@ -2062,7 +2062,7 @@ static int ti_sci_cmd_ring_config(const struct ti_sci_handle *handle,
 
 	ret = ti_sci_do_xfer(info, xfer);
 	if (ret) {
-		dev_err(info->dev, "RM_RA:Mbox config send fail %d\n", ret);
+		dev_err(dev, "RM_RA:Mbox config send fail %d\n", ret);
 		goto fail;
 	}
 
@@ -2071,7 +2071,7 @@ static int ti_sci_cmd_ring_config(const struct ti_sci_handle *handle,
 
 fail:
 	ti_sci_put_one_xfer(&info->minfo, xfer);
-	dev_dbg(info->dev, "RM_RA:config ring %u ret:%d\n", index, ret);
+	dev_dbg(dev, "RM_RA:config ring %u ret:%d\n", index, ret);
 	return ret;
 }
 
@@ -2115,7 +2115,7 @@ static int ti_sci_cmd_ring_get_config(const struct ti_sci_handle *handle,
 				   sizeof(*req), sizeof(*resp));
 	if (IS_ERR(xfer)) {
 		ret = PTR_ERR(xfer);
-		dev_err(info->dev,
+		dev_err(dev,
 			"RM_RA:Message get config failed(%d)\n", ret);
 		return ret;
 	}
@@ -2125,7 +2125,7 @@ static int ti_sci_cmd_ring_get_config(const struct ti_sci_handle *handle,
 
 	ret = ti_sci_do_xfer(info, xfer);
 	if (ret) {
-		dev_err(info->dev, "RM_RA:Mbox get config send fail %d\n", ret);
+		dev_err(dev, "RM_RA:Mbox get config send fail %d\n", ret);
 		goto fail;
 	}
 
@@ -2150,7 +2150,7 @@ static int ti_sci_cmd_ring_get_config(const struct ti_sci_handle *handle,
 
 fail:
 	ti_sci_put_one_xfer(&info->minfo, xfer);
-	dev_dbg(info->dev, "RM_RA:get config ring %u ret:%d\n", index, ret);
+	dev_dbg(dev, "RM_RA:get config ring %u ret:%d\n", index, ret);
 	return ret;
 }
 
@@ -2298,7 +2298,7 @@ static int ti_sci_cmd_rm_udmap_tx_ch_cfg(const struct ti_sci_handle *handle,
 				   sizeof(*req), sizeof(*resp));
 	if (IS_ERR(xfer)) {
 		ret = PTR_ERR(xfer);
-		dev_err(info->dev, "Message TX_CH_CFG alloc failed(%d)\n", ret);
+		dev_err(dev, "Message TX_CH_CFG alloc failed(%d)\n", ret);
 		return ret;
 	}
 	req = (struct ti_sci_msg_rm_udmap_tx_ch_cfg_req *)xfer->xfer_buf;
@@ -2323,7 +2323,7 @@ static int ti_sci_cmd_rm_udmap_tx_ch_cfg(const struct ti_sci_handle *handle,
 
 	ret = ti_sci_do_xfer(info, xfer);
 	if (ret) {
-		dev_err(info->dev, "Mbox send TX_CH_CFG fail %d\n", ret);
+		dev_err(dev, "Mbox send TX_CH_CFG fail %d\n", ret);
 		goto fail;
 	}
 
@@ -2332,7 +2332,7 @@ static int ti_sci_cmd_rm_udmap_tx_ch_cfg(const struct ti_sci_handle *handle,
 
 fail:
 	ti_sci_put_one_xfer(&info->minfo, xfer);
-	dev_dbg(info->dev, "TX_CH_CFG: chn %u ret:%u\n", params->index, ret);
+	dev_dbg(dev, "TX_CH_CFG: chn %u ret:%u\n", params->index, ret);
 	return ret;
 }
 
@@ -2368,7 +2368,7 @@ static int ti_sci_cmd_rm_udmap_rx_ch_cfg(const struct ti_sci_handle *handle,
 				   sizeof(*req), sizeof(*resp));
 	if (IS_ERR(xfer)) {
 		ret = PTR_ERR(xfer);
-		dev_err(info->dev, "Message RX_CH_CFG alloc failed(%d)\n", ret);
+		dev_err(dev, "Message RX_CH_CFG alloc failed(%d)\n", ret);
 		return ret;
 	}
 	req = (struct ti_sci_msg_rm_udmap_rx_ch_cfg_req *)xfer->xfer_buf;
@@ -2392,7 +2392,7 @@ static int ti_sci_cmd_rm_udmap_rx_ch_cfg(const struct ti_sci_handle *handle,
 
 	ret = ti_sci_do_xfer(info, xfer);
 	if (ret) {
-		dev_err(info->dev, "Mbox send RX_CH_CFG fail %d\n", ret);
+		dev_err(dev, "Mbox send RX_CH_CFG fail %d\n", ret);
 		goto fail;
 	}
 
@@ -2401,7 +2401,7 @@ static int ti_sci_cmd_rm_udmap_rx_ch_cfg(const struct ti_sci_handle *handle,
 
 fail:
 	ti_sci_put_one_xfer(&info->minfo, xfer);
-	dev_dbg(info->dev, "RX_CH_CFG: chn %u ret:%d\n", params->index, ret);
+	dev_dbg(dev, "RX_CH_CFG: chn %u ret:%d\n", params->index, ret);
 	return ret;
 }
 
-- 
2.7.4



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 -next] firmware: ti_sci: remove set but not used variable 'dev'
  2019-06-15 12:38 ` [PATCH v2 " YueHaibing
@ 2019-06-15 12:46   ` Yuehaibing
  0 siblings, 0 replies; 7+ messages in thread
From: Yuehaibing @ 2019-06-15 12:46 UTC (permalink / raw)
  To: nm, t-kristo, ssantosh, s-anna, santosh.shilimkar
  Cc: linux-kernel, linux-arm-kernel

Sorry, Pls ignore this, will fix the patch title

On 2019/6/15 20:38, YueHaibing wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> drivers/firmware/ti_sci.c: In function ti_sci_cmd_ring_config:
> drivers/firmware/ti_sci.c:2035:17: warning: variable dev set but not used [-Wunused-but-set-variable]
> drivers/firmware/ti_sci.c: In function ti_sci_cmd_ring_get_config:
> drivers/firmware/ti_sci.c:2104:17: warning: variable dev set but not used [-Wunused-but-set-variable]
> drivers/firmware/ti_sci.c: In function ti_sci_cmd_rm_udmap_tx_ch_cfg:
> drivers/firmware/ti_sci.c:2287:17: warning: variable dev set but not used [-Wunused-but-set-variable]
> drivers/firmware/ti_sci.c: In function ti_sci_cmd_rm_udmap_rx_ch_cfg:
> drivers/firmware/ti_sci.c:2357:17: warning: variable dev set but not used [-Wunused-but-set-variable]
> 
> Use the 'dev' variable instead of 'info->dev' to fix this.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
> v2: use the 'dev' variable as Suman Anna's suggestion
> ---
>  drivers/firmware/ti_sci.c | 24 ++++++++++++------------
>  1 file changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c
> index 86b2727..c8da6e2 100644
> --- a/drivers/firmware/ti_sci.c
> +++ b/drivers/firmware/ti_sci.c
> @@ -2046,7 +2046,7 @@ static int ti_sci_cmd_ring_config(const struct ti_sci_handle *handle,
>  				   sizeof(*req), sizeof(*resp));
>  	if (IS_ERR(xfer)) {
>  		ret = PTR_ERR(xfer);
> -		dev_err(info->dev, "RM_RA:Message config failed(%d)\n", ret);
> +		dev_err(dev, "RM_RA:Message config failed(%d)\n", ret);
>  		return ret;
>  	}
>  	req = (struct ti_sci_msg_rm_ring_cfg_req *)xfer->xfer_buf;
> @@ -2062,7 +2062,7 @@ static int ti_sci_cmd_ring_config(const struct ti_sci_handle *handle,
>  
>  	ret = ti_sci_do_xfer(info, xfer);
>  	if (ret) {
> -		dev_err(info->dev, "RM_RA:Mbox config send fail %d\n", ret);
> +		dev_err(dev, "RM_RA:Mbox config send fail %d\n", ret);
>  		goto fail;
>  	}
>  
> @@ -2071,7 +2071,7 @@ static int ti_sci_cmd_ring_config(const struct ti_sci_handle *handle,
>  
>  fail:
>  	ti_sci_put_one_xfer(&info->minfo, xfer);
> -	dev_dbg(info->dev, "RM_RA:config ring %u ret:%d\n", index, ret);
> +	dev_dbg(dev, "RM_RA:config ring %u ret:%d\n", index, ret);
>  	return ret;
>  }
>  
> @@ -2115,7 +2115,7 @@ static int ti_sci_cmd_ring_get_config(const struct ti_sci_handle *handle,
>  				   sizeof(*req), sizeof(*resp));
>  	if (IS_ERR(xfer)) {
>  		ret = PTR_ERR(xfer);
> -		dev_err(info->dev,
> +		dev_err(dev,
>  			"RM_RA:Message get config failed(%d)\n", ret);
>  		return ret;
>  	}
> @@ -2125,7 +2125,7 @@ static int ti_sci_cmd_ring_get_config(const struct ti_sci_handle *handle,
>  
>  	ret = ti_sci_do_xfer(info, xfer);
>  	if (ret) {
> -		dev_err(info->dev, "RM_RA:Mbox get config send fail %d\n", ret);
> +		dev_err(dev, "RM_RA:Mbox get config send fail %d\n", ret);
>  		goto fail;
>  	}
>  
> @@ -2150,7 +2150,7 @@ static int ti_sci_cmd_ring_get_config(const struct ti_sci_handle *handle,
>  
>  fail:
>  	ti_sci_put_one_xfer(&info->minfo, xfer);
> -	dev_dbg(info->dev, "RM_RA:get config ring %u ret:%d\n", index, ret);
> +	dev_dbg(dev, "RM_RA:get config ring %u ret:%d\n", index, ret);
>  	return ret;
>  }
>  
> @@ -2298,7 +2298,7 @@ static int ti_sci_cmd_rm_udmap_tx_ch_cfg(const struct ti_sci_handle *handle,
>  				   sizeof(*req), sizeof(*resp));
>  	if (IS_ERR(xfer)) {
>  		ret = PTR_ERR(xfer);
> -		dev_err(info->dev, "Message TX_CH_CFG alloc failed(%d)\n", ret);
> +		dev_err(dev, "Message TX_CH_CFG alloc failed(%d)\n", ret);
>  		return ret;
>  	}
>  	req = (struct ti_sci_msg_rm_udmap_tx_ch_cfg_req *)xfer->xfer_buf;
> @@ -2323,7 +2323,7 @@ static int ti_sci_cmd_rm_udmap_tx_ch_cfg(const struct ti_sci_handle *handle,
>  
>  	ret = ti_sci_do_xfer(info, xfer);
>  	if (ret) {
> -		dev_err(info->dev, "Mbox send TX_CH_CFG fail %d\n", ret);
> +		dev_err(dev, "Mbox send TX_CH_CFG fail %d\n", ret);
>  		goto fail;
>  	}
>  
> @@ -2332,7 +2332,7 @@ static int ti_sci_cmd_rm_udmap_tx_ch_cfg(const struct ti_sci_handle *handle,
>  
>  fail:
>  	ti_sci_put_one_xfer(&info->minfo, xfer);
> -	dev_dbg(info->dev, "TX_CH_CFG: chn %u ret:%u\n", params->index, ret);
> +	dev_dbg(dev, "TX_CH_CFG: chn %u ret:%u\n", params->index, ret);
>  	return ret;
>  }
>  
> @@ -2368,7 +2368,7 @@ static int ti_sci_cmd_rm_udmap_rx_ch_cfg(const struct ti_sci_handle *handle,
>  				   sizeof(*req), sizeof(*resp));
>  	if (IS_ERR(xfer)) {
>  		ret = PTR_ERR(xfer);
> -		dev_err(info->dev, "Message RX_CH_CFG alloc failed(%d)\n", ret);
> +		dev_err(dev, "Message RX_CH_CFG alloc failed(%d)\n", ret);
>  		return ret;
>  	}
>  	req = (struct ti_sci_msg_rm_udmap_rx_ch_cfg_req *)xfer->xfer_buf;
> @@ -2392,7 +2392,7 @@ static int ti_sci_cmd_rm_udmap_rx_ch_cfg(const struct ti_sci_handle *handle,
>  
>  	ret = ti_sci_do_xfer(info, xfer);
>  	if (ret) {
> -		dev_err(info->dev, "Mbox send RX_CH_CFG fail %d\n", ret);
> +		dev_err(dev, "Mbox send RX_CH_CFG fail %d\n", ret);
>  		goto fail;
>  	}
>  
> @@ -2401,7 +2401,7 @@ static int ti_sci_cmd_rm_udmap_rx_ch_cfg(const struct ti_sci_handle *handle,
>  
>  fail:
>  	ti_sci_put_one_xfer(&info->minfo, xfer);
> -	dev_dbg(info->dev, "RX_CH_CFG: chn %u ret:%d\n", params->index, ret);
> +	dev_dbg(dev, "RX_CH_CFG: chn %u ret:%d\n", params->index, ret);
>  	return ret;
>  }
>  
> 


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v3 -next] firmware: ti_sci: Fix gcc unused-but-set-variable warning
  2019-06-14 15:44 [PATCH -next] firmware: ti_sci: remove set but not used variable 'dev' YueHaibing
  2019-06-14 16:26 ` Suman Anna
  2019-06-15 12:38 ` [PATCH v2 " YueHaibing
@ 2019-06-15 12:50 ` YueHaibing
  2019-06-17 18:41   ` Suman Anna
  2 siblings, 1 reply; 7+ messages in thread
From: YueHaibing @ 2019-06-15 12:50 UTC (permalink / raw)
  To: nm, t-kristo, ssantosh, s-anna, santosh.shilimkar
  Cc: YueHaibing, linux-kernel, linux-arm-kernel

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/firmware/ti_sci.c: In function ti_sci_cmd_ring_config:
drivers/firmware/ti_sci.c:2035:17: warning: variable dev set but not used [-Wunused-but-set-variable]
drivers/firmware/ti_sci.c: In function ti_sci_cmd_ring_get_config:
drivers/firmware/ti_sci.c:2104:17: warning: variable dev set but not used [-Wunused-but-set-variable]
drivers/firmware/ti_sci.c: In function ti_sci_cmd_rm_udmap_tx_ch_cfg:
drivers/firmware/ti_sci.c:2287:17: warning: variable dev set but not used [-Wunused-but-set-variable]
drivers/firmware/ti_sci.c: In function ti_sci_cmd_rm_udmap_rx_ch_cfg:
drivers/firmware/ti_sci.c:2357:17: warning: variable dev set but not used [-Wunused-but-set-variable]

Use the 'dev' variable instead of info->dev to fix this.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
v3: fix patch title
v2: use the 'dev' variable as Suman Anna's suggestion
---
 drivers/firmware/ti_sci.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c
index 86b2727..c8da6e2 100644
--- a/drivers/firmware/ti_sci.c
+++ b/drivers/firmware/ti_sci.c
@@ -2046,7 +2046,7 @@ static int ti_sci_cmd_ring_config(const struct ti_sci_handle *handle,
 				   sizeof(*req), sizeof(*resp));
 	if (IS_ERR(xfer)) {
 		ret = PTR_ERR(xfer);
-		dev_err(info->dev, "RM_RA:Message config failed(%d)\n", ret);
+		dev_err(dev, "RM_RA:Message config failed(%d)\n", ret);
 		return ret;
 	}
 	req = (struct ti_sci_msg_rm_ring_cfg_req *)xfer->xfer_buf;
@@ -2062,7 +2062,7 @@ static int ti_sci_cmd_ring_config(const struct ti_sci_handle *handle,
 
 	ret = ti_sci_do_xfer(info, xfer);
 	if (ret) {
-		dev_err(info->dev, "RM_RA:Mbox config send fail %d\n", ret);
+		dev_err(dev, "RM_RA:Mbox config send fail %d\n", ret);
 		goto fail;
 	}
 
@@ -2071,7 +2071,7 @@ static int ti_sci_cmd_ring_config(const struct ti_sci_handle *handle,
 
 fail:
 	ti_sci_put_one_xfer(&info->minfo, xfer);
-	dev_dbg(info->dev, "RM_RA:config ring %u ret:%d\n", index, ret);
+	dev_dbg(dev, "RM_RA:config ring %u ret:%d\n", index, ret);
 	return ret;
 }
 
@@ -2115,7 +2115,7 @@ static int ti_sci_cmd_ring_get_config(const struct ti_sci_handle *handle,
 				   sizeof(*req), sizeof(*resp));
 	if (IS_ERR(xfer)) {
 		ret = PTR_ERR(xfer);
-		dev_err(info->dev,
+		dev_err(dev,
 			"RM_RA:Message get config failed(%d)\n", ret);
 		return ret;
 	}
@@ -2125,7 +2125,7 @@ static int ti_sci_cmd_ring_get_config(const struct ti_sci_handle *handle,
 
 	ret = ti_sci_do_xfer(info, xfer);
 	if (ret) {
-		dev_err(info->dev, "RM_RA:Mbox get config send fail %d\n", ret);
+		dev_err(dev, "RM_RA:Mbox get config send fail %d\n", ret);
 		goto fail;
 	}
 
@@ -2150,7 +2150,7 @@ static int ti_sci_cmd_ring_get_config(const struct ti_sci_handle *handle,
 
 fail:
 	ti_sci_put_one_xfer(&info->minfo, xfer);
-	dev_dbg(info->dev, "RM_RA:get config ring %u ret:%d\n", index, ret);
+	dev_dbg(dev, "RM_RA:get config ring %u ret:%d\n", index, ret);
 	return ret;
 }
 
@@ -2298,7 +2298,7 @@ static int ti_sci_cmd_rm_udmap_tx_ch_cfg(const struct ti_sci_handle *handle,
 				   sizeof(*req), sizeof(*resp));
 	if (IS_ERR(xfer)) {
 		ret = PTR_ERR(xfer);
-		dev_err(info->dev, "Message TX_CH_CFG alloc failed(%d)\n", ret);
+		dev_err(dev, "Message TX_CH_CFG alloc failed(%d)\n", ret);
 		return ret;
 	}
 	req = (struct ti_sci_msg_rm_udmap_tx_ch_cfg_req *)xfer->xfer_buf;
@@ -2323,7 +2323,7 @@ static int ti_sci_cmd_rm_udmap_tx_ch_cfg(const struct ti_sci_handle *handle,
 
 	ret = ti_sci_do_xfer(info, xfer);
 	if (ret) {
-		dev_err(info->dev, "Mbox send TX_CH_CFG fail %d\n", ret);
+		dev_err(dev, "Mbox send TX_CH_CFG fail %d\n", ret);
 		goto fail;
 	}
 
@@ -2332,7 +2332,7 @@ static int ti_sci_cmd_rm_udmap_tx_ch_cfg(const struct ti_sci_handle *handle,
 
 fail:
 	ti_sci_put_one_xfer(&info->minfo, xfer);
-	dev_dbg(info->dev, "TX_CH_CFG: chn %u ret:%u\n", params->index, ret);
+	dev_dbg(dev, "TX_CH_CFG: chn %u ret:%u\n", params->index, ret);
 	return ret;
 }
 
@@ -2368,7 +2368,7 @@ static int ti_sci_cmd_rm_udmap_rx_ch_cfg(const struct ti_sci_handle *handle,
 				   sizeof(*req), sizeof(*resp));
 	if (IS_ERR(xfer)) {
 		ret = PTR_ERR(xfer);
-		dev_err(info->dev, "Message RX_CH_CFG alloc failed(%d)\n", ret);
+		dev_err(dev, "Message RX_CH_CFG alloc failed(%d)\n", ret);
 		return ret;
 	}
 	req = (struct ti_sci_msg_rm_udmap_rx_ch_cfg_req *)xfer->xfer_buf;
@@ -2392,7 +2392,7 @@ static int ti_sci_cmd_rm_udmap_rx_ch_cfg(const struct ti_sci_handle *handle,
 
 	ret = ti_sci_do_xfer(info, xfer);
 	if (ret) {
-		dev_err(info->dev, "Mbox send RX_CH_CFG fail %d\n", ret);
+		dev_err(dev, "Mbox send RX_CH_CFG fail %d\n", ret);
 		goto fail;
 	}
 
@@ -2401,7 +2401,7 @@ static int ti_sci_cmd_rm_udmap_rx_ch_cfg(const struct ti_sci_handle *handle,
 
 fail:
 	ti_sci_put_one_xfer(&info->minfo, xfer);
-	dev_dbg(info->dev, "RX_CH_CFG: chn %u ret:%d\n", params->index, ret);
+	dev_dbg(dev, "RX_CH_CFG: chn %u ret:%d\n", params->index, ret);
 	return ret;
 }
 
-- 
2.7.4



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3 -next] firmware: ti_sci: Fix gcc unused-but-set-variable warning
  2019-06-15 12:50 ` [PATCH v3 -next] firmware: ti_sci: Fix gcc unused-but-set-variable warning YueHaibing
@ 2019-06-17 18:41   ` Suman Anna
  2019-06-19  4:35     ` santosh.shilimkar
  0 siblings, 1 reply; 7+ messages in thread
From: Suman Anna @ 2019-06-17 18:41 UTC (permalink / raw)
  To: YueHaibing, nm, t-kristo, ssantosh, santosh.shilimkar
  Cc: linux-kernel, linux-arm-kernel

On 6/15/19 7:50 AM, YueHaibing wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> drivers/firmware/ti_sci.c: In function ti_sci_cmd_ring_config:
> drivers/firmware/ti_sci.c:2035:17: warning: variable dev set but not used [-Wunused-but-set-variable]
> drivers/firmware/ti_sci.c: In function ti_sci_cmd_ring_get_config:
> drivers/firmware/ti_sci.c:2104:17: warning: variable dev set but not used [-Wunused-but-set-variable]
> drivers/firmware/ti_sci.c: In function ti_sci_cmd_rm_udmap_tx_ch_cfg:
> drivers/firmware/ti_sci.c:2287:17: warning: variable dev set but not used [-Wunused-but-set-variable]
> drivers/firmware/ti_sci.c: In function ti_sci_cmd_rm_udmap_rx_ch_cfg:
> drivers/firmware/ti_sci.c:2357:17: warning: variable dev set but not used [-Wunused-but-set-variable]
> 
> Use the 'dev' variable instead of info->dev to fix this.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Acked-by: Suman Anna <s-anna@ti.com>

Hi Santosh,
Can you pick up this patch, goes on top of your for_5.3/driver-soc branch?

regards
Suman

> ---
> v3: fix patch title
> v2: use the 'dev' variable as Suman Anna's suggestion
> ---
>  drivers/firmware/ti_sci.c | 24 ++++++++++++------------
>  1 file changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c
> index 86b2727..c8da6e2 100644
> --- a/drivers/firmware/ti_sci.c
> +++ b/drivers/firmware/ti_sci.c
> @@ -2046,7 +2046,7 @@ static int ti_sci_cmd_ring_config(const struct ti_sci_handle *handle,
>  				   sizeof(*req), sizeof(*resp));
>  	if (IS_ERR(xfer)) {
>  		ret = PTR_ERR(xfer);
> -		dev_err(info->dev, "RM_RA:Message config failed(%d)\n", ret);
> +		dev_err(dev, "RM_RA:Message config failed(%d)\n", ret);
>  		return ret;
>  	}
>  	req = (struct ti_sci_msg_rm_ring_cfg_req *)xfer->xfer_buf;
> @@ -2062,7 +2062,7 @@ static int ti_sci_cmd_ring_config(const struct ti_sci_handle *handle,
>  
>  	ret = ti_sci_do_xfer(info, xfer);
>  	if (ret) {
> -		dev_err(info->dev, "RM_RA:Mbox config send fail %d\n", ret);
> +		dev_err(dev, "RM_RA:Mbox config send fail %d\n", ret);
>  		goto fail;
>  	}
>  
> @@ -2071,7 +2071,7 @@ static int ti_sci_cmd_ring_config(const struct ti_sci_handle *handle,
>  
>  fail:
>  	ti_sci_put_one_xfer(&info->minfo, xfer);
> -	dev_dbg(info->dev, "RM_RA:config ring %u ret:%d\n", index, ret);
> +	dev_dbg(dev, "RM_RA:config ring %u ret:%d\n", index, ret);
>  	return ret;
>  }
>  
> @@ -2115,7 +2115,7 @@ static int ti_sci_cmd_ring_get_config(const struct ti_sci_handle *handle,
>  				   sizeof(*req), sizeof(*resp));
>  	if (IS_ERR(xfer)) {
>  		ret = PTR_ERR(xfer);
> -		dev_err(info->dev,
> +		dev_err(dev,
>  			"RM_RA:Message get config failed(%d)\n", ret);
>  		return ret;
>  	}
> @@ -2125,7 +2125,7 @@ static int ti_sci_cmd_ring_get_config(const struct ti_sci_handle *handle,
>  
>  	ret = ti_sci_do_xfer(info, xfer);
>  	if (ret) {
> -		dev_err(info->dev, "RM_RA:Mbox get config send fail %d\n", ret);
> +		dev_err(dev, "RM_RA:Mbox get config send fail %d\n", ret);
>  		goto fail;
>  	}
>  
> @@ -2150,7 +2150,7 @@ static int ti_sci_cmd_ring_get_config(const struct ti_sci_handle *handle,
>  
>  fail:
>  	ti_sci_put_one_xfer(&info->minfo, xfer);
> -	dev_dbg(info->dev, "RM_RA:get config ring %u ret:%d\n", index, ret);
> +	dev_dbg(dev, "RM_RA:get config ring %u ret:%d\n", index, ret);
>  	return ret;
>  }
>  
> @@ -2298,7 +2298,7 @@ static int ti_sci_cmd_rm_udmap_tx_ch_cfg(const struct ti_sci_handle *handle,
>  				   sizeof(*req), sizeof(*resp));
>  	if (IS_ERR(xfer)) {
>  		ret = PTR_ERR(xfer);
> -		dev_err(info->dev, "Message TX_CH_CFG alloc failed(%d)\n", ret);
> +		dev_err(dev, "Message TX_CH_CFG alloc failed(%d)\n", ret);
>  		return ret;
>  	}
>  	req = (struct ti_sci_msg_rm_udmap_tx_ch_cfg_req *)xfer->xfer_buf;
> @@ -2323,7 +2323,7 @@ static int ti_sci_cmd_rm_udmap_tx_ch_cfg(const struct ti_sci_handle *handle,
>  
>  	ret = ti_sci_do_xfer(info, xfer);
>  	if (ret) {
> -		dev_err(info->dev, "Mbox send TX_CH_CFG fail %d\n", ret);
> +		dev_err(dev, "Mbox send TX_CH_CFG fail %d\n", ret);
>  		goto fail;
>  	}
>  
> @@ -2332,7 +2332,7 @@ static int ti_sci_cmd_rm_udmap_tx_ch_cfg(const struct ti_sci_handle *handle,
>  
>  fail:
>  	ti_sci_put_one_xfer(&info->minfo, xfer);
> -	dev_dbg(info->dev, "TX_CH_CFG: chn %u ret:%u\n", params->index, ret);
> +	dev_dbg(dev, "TX_CH_CFG: chn %u ret:%u\n", params->index, ret);
>  	return ret;
>  }
>  
> @@ -2368,7 +2368,7 @@ static int ti_sci_cmd_rm_udmap_rx_ch_cfg(const struct ti_sci_handle *handle,
>  				   sizeof(*req), sizeof(*resp));
>  	if (IS_ERR(xfer)) {
>  		ret = PTR_ERR(xfer);
> -		dev_err(info->dev, "Message RX_CH_CFG alloc failed(%d)\n", ret);
> +		dev_err(dev, "Message RX_CH_CFG alloc failed(%d)\n", ret);
>  		return ret;
>  	}
>  	req = (struct ti_sci_msg_rm_udmap_rx_ch_cfg_req *)xfer->xfer_buf;
> @@ -2392,7 +2392,7 @@ static int ti_sci_cmd_rm_udmap_rx_ch_cfg(const struct ti_sci_handle *handle,
>  
>  	ret = ti_sci_do_xfer(info, xfer);
>  	if (ret) {
> -		dev_err(info->dev, "Mbox send RX_CH_CFG fail %d\n", ret);
> +		dev_err(dev, "Mbox send RX_CH_CFG fail %d\n", ret);
>  		goto fail;
>  	}
>  
> @@ -2401,7 +2401,7 @@ static int ti_sci_cmd_rm_udmap_rx_ch_cfg(const struct ti_sci_handle *handle,
>  
>  fail:
>  	ti_sci_put_one_xfer(&info->minfo, xfer);
> -	dev_dbg(info->dev, "RX_CH_CFG: chn %u ret:%d\n", params->index, ret);
> +	dev_dbg(dev, "RX_CH_CFG: chn %u ret:%d\n", params->index, ret);
>  	return ret;
>  }
>  
> 


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3 -next] firmware: ti_sci: Fix gcc unused-but-set-variable warning
  2019-06-17 18:41   ` Suman Anna
@ 2019-06-19  4:35     ` santosh.shilimkar
  0 siblings, 0 replies; 7+ messages in thread
From: santosh.shilimkar @ 2019-06-19  4:35 UTC (permalink / raw)
  To: Suman Anna, YueHaibing, nm, t-kristo, ssantosh
  Cc: linux-kernel, linux-arm-kernel

On 6/17/19 11:41 AM, Suman Anna wrote:
> On 6/15/19 7:50 AM, YueHaibing wrote:
>> Fixes gcc '-Wunused-but-set-variable' warning:
>>
>> drivers/firmware/ti_sci.c: In function ti_sci_cmd_ring_config:
>> drivers/firmware/ti_sci.c:2035:17: warning: variable dev set but not used [-Wunused-but-set-variable]
>> drivers/firmware/ti_sci.c: In function ti_sci_cmd_ring_get_config:
>> drivers/firmware/ti_sci.c:2104:17: warning: variable dev set but not used [-Wunused-but-set-variable]
>> drivers/firmware/ti_sci.c: In function ti_sci_cmd_rm_udmap_tx_ch_cfg:
>> drivers/firmware/ti_sci.c:2287:17: warning: variable dev set but not used [-Wunused-but-set-variable]
>> drivers/firmware/ti_sci.c: In function ti_sci_cmd_rm_udmap_rx_ch_cfg:
>> drivers/firmware/ti_sci.c:2357:17: warning: variable dev set but not used [-Wunused-but-set-variable]
>>
>> Use the 'dev' variable instead of info->dev to fix this.
>>
>> Reported-by: Hulk Robot <hulkci@huawei.com>
>> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> 
> Acked-by: Suman Anna <s-anna@ti.com>
> 
> Hi Santosh,
> Can you pick up this patch, goes on top of your for_5.3/driver-soc branch?
> 
Applied.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, back to index

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-14 15:44 [PATCH -next] firmware: ti_sci: remove set but not used variable 'dev' YueHaibing
2019-06-14 16:26 ` Suman Anna
2019-06-15 12:38 ` [PATCH v2 " YueHaibing
2019-06-15 12:46   ` Yuehaibing
2019-06-15 12:50 ` [PATCH v3 -next] firmware: ti_sci: Fix gcc unused-but-set-variable warning YueHaibing
2019-06-17 18:41   ` Suman Anna
2019-06-19  4:35     ` santosh.shilimkar

Linux-ARM-Kernel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-arm-kernel/0 linux-arm-kernel/git/0.git
	git clone --mirror https://lore.kernel.org/linux-arm-kernel/1 linux-arm-kernel/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-arm-kernel linux-arm-kernel/ https://lore.kernel.org/linux-arm-kernel \
		linux-arm-kernel@lists.infradead.org infradead-linux-arm-kernel@archiver.kernel.org
	public-inbox-index linux-arm-kernel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-arm-kernel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox