Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / Atom feed
From: Suman Anna <s-anna@ti.com>
To: YueHaibing <yuehaibing@huawei.com>, <nm@ti.com>,
	<t-kristo@ti.com>, <ssantosh@kernel.org>,
	<santosh.shilimkar@oracle.com>
Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH -next] firmware: ti_sci: remove set but not used variable 'dev'
Date: Fri, 14 Jun 2019 11:26:47 -0500
Message-ID: <1c1fad17-6efd-ceb7-8583-534e50627dbc@ti.com> (raw)
In-Reply-To: <20190614154421.17556-1-yuehaibing@huawei.com>

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

  reply index

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-14 15:44 YueHaibing
2019-06-14 16:26 ` Suman Anna [this message]
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

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1c1fad17-6efd-ceb7-8583-534e50627dbc@ti.com \
    --to=s-anna@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=santosh.shilimkar@oracle.com \
    --cc=ssantosh@kernel.org \
    --cc=t-kristo@ti.com \
    --cc=yuehaibing@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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


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