LKML Archive mirror
 help / color / mirror / Atom feed
From: Edward Cree <ecree.xilinx@gmail.com>
To: Yang Yingliang <yangyingliang@huawei.com>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Cc: davem@davemloft.net
Subject: Re: [PATCH -next resend] sfc: farch: fix compile warning in efx_farch_dimension_resources()
Date: Wed, 19 May 2021 15:40:12 +0100	[thread overview]
Message-ID: <d90bd556-efd0-1b75-7708-7217fe490cf2@gmail.com> (raw)
In-Reply-To: <20210519021136.1638370-1-yangyingliang@huawei.com>

On 19/05/2021 03:11, Yang Yingliang wrote:
> Fix the following kernel build warning when CONFIG_SFC_SRIOV is disabled:
> 
>   drivers/net/ethernet/sfc/farch.c: In function ‘efx_farch_dimension_resources’:
>   drivers/net/ethernet/sfc/farch.c:1671:21: warning: variable ‘buftbl_min’ set but not used [-Wunused-but-set-variable]
>     unsigned vi_count, buftbl_min, total_tx_channels;
> 
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
>  drivers/net/ethernet/sfc/farch.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ethernet/sfc/farch.c b/drivers/net/ethernet/sfc/farch.c
> index 49df02ecee91..6048b08b89ec 100644
> --- a/drivers/net/ethernet/sfc/farch.c
> +++ b/drivers/net/ethernet/sfc/farch.c
> @@ -1668,13 +1668,17 @@ void efx_farch_rx_pull_indir_table(struct efx_nic *efx)
>   */
>  void efx_farch_dimension_resources(struct efx_nic *efx, unsigned sram_lim_qw)
>  {
> -	unsigned vi_count, buftbl_min, total_tx_channels;
> +	unsigned vi_count, total_tx_channels;
>  
>  #ifdef CONFIG_SFC_SRIOV
>  	struct siena_nic_data *nic_data = efx->nic_data;
> +	unsigned buftbl_min;
>  #endif
As I said the first time you sent this:
Reverse xmas tree is messed up here, please fix.
Apart from that, LGTM.

-ed

>  
>  	total_tx_channels = efx->n_tx_channels + efx->n_extra_tx_channels;
> +	vi_count = max(efx->n_channels, total_tx_channels * EFX_MAX_TXQ_PER_CHANNEL);
> +
> +#ifdef CONFIG_SFC_SRIOV
>  	/* Account for the buffer table entries backing the datapath channels
>  	 * and the descriptor caches for those channels.
>  	 */
> @@ -1682,9 +1686,6 @@ void efx_farch_dimension_resources(struct efx_nic *efx, unsigned sram_lim_qw)
>  		       total_tx_channels * EFX_MAX_TXQ_PER_CHANNEL * EFX_MAX_DMAQ_SIZE +
>  		       efx->n_channels * EFX_MAX_EVQ_SIZE)
>  		      * sizeof(efx_qword_t) / EFX_BUF_SIZE);
> -	vi_count = max(efx->n_channels, total_tx_channels * EFX_MAX_TXQ_PER_CHANNEL);
> -
> -#ifdef CONFIG_SFC_SRIOV
>  	if (efx->type->sriov_wanted) {
>  		if (efx->type->sriov_wanted(efx)) {
>  			unsigned vi_dc_entries, buftbl_free;
> 


  reply	other threads:[~2021-05-19 14:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-19  2:11 [PATCH -next resend] sfc: farch: fix compile warning in efx_farch_dimension_resources() Yang Yingliang
2021-05-19 14:40 ` Edward Cree [this message]
2021-05-20  2:13   ` Yang Yingliang
2021-05-20 11:52     ` Edward Cree

Reply instructions:

You may reply publicly 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=d90bd556-efd0-1b75-7708-7217fe490cf2@gmail.com \
    --to=ecree.xilinx@gmail.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=yangyingliang@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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).