All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: ameynarkhede02@gmail.com
Cc: manishc@marvell.com, GR-Linux-NIC-Dev@marvell.com,
	gregkh@linuxfoundation.org, netdev@vger.kernel.org,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: qlge/qlge_main: Use min_t instead of min
Date: Thu, 4 Feb 2021 15:58:44 -0700	[thread overview]
Message-ID: <20210204225844.GA431671@localhost> (raw)
In-Reply-To: <20210204215451.69928-1-ameynarkhede02@gmail.com>

On Fri, Feb 05, 2021 at 03:24:51AM +0530, ameynarkhede02@gmail.com wrote:
> From: Amey Narkhede <ameynarkhede02@gmail.com>
> 
> Use min_t instead of min function in qlge/qlge_main.c
> Fixes following checkpatch.pl warning:
> WARNING: min() should probably be min_t(int, MAX_CPUS, num_online_cpus())
> 
> Signed-off-by: Amey Narkhede <ameynarkhede02@gmail.com>
> ---
>  drivers/staging/qlge/qlge_main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/qlge/qlge_main.c b/drivers/staging/qlge/qlge_main.c
> index 402edaeff..29606d1eb 100644
> --- a/drivers/staging/qlge/qlge_main.c
> +++ b/drivers/staging/qlge/qlge_main.c
> @@ -3938,7 +3938,7 @@ static int ql_configure_rings(struct ql_adapter *qdev)
>  	int i;
>  	struct rx_ring *rx_ring;
>  	struct tx_ring *tx_ring;
> -	int cpu_cnt = min(MAX_CPUS, (int)num_online_cpus());
> +	int cpu_cnt = min_t(int, MAX_CPUS, (int)num_online_cpus());

You should remove the cast on num_online_cpus() like checkpatch
suggests. min_t adds the cast to int on both of the inputs for you.

> 
>  	/* In a perfect world we have one RSS ring for each CPU
>  	 * and each has it's own vector.  To do that we ask for
> --
> 2.30.0

Cheers,
Nathan

WARNING: multiple messages have this Message-ID (diff)
From: Nathan Chancellor <nathan@kernel.org>
To: ameynarkhede02@gmail.com
Cc: devel@driverdev.osuosl.org, GR-Linux-NIC-Dev@marvell.com,
	manishc@marvell.com, gregkh@linuxfoundation.org,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH] staging: qlge/qlge_main: Use min_t instead of min
Date: Thu, 4 Feb 2021 15:58:44 -0700	[thread overview]
Message-ID: <20210204225844.GA431671@localhost> (raw)
In-Reply-To: <20210204215451.69928-1-ameynarkhede02@gmail.com>

On Fri, Feb 05, 2021 at 03:24:51AM +0530, ameynarkhede02@gmail.com wrote:
> From: Amey Narkhede <ameynarkhede02@gmail.com>
> 
> Use min_t instead of min function in qlge/qlge_main.c
> Fixes following checkpatch.pl warning:
> WARNING: min() should probably be min_t(int, MAX_CPUS, num_online_cpus())
> 
> Signed-off-by: Amey Narkhede <ameynarkhede02@gmail.com>
> ---
>  drivers/staging/qlge/qlge_main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/qlge/qlge_main.c b/drivers/staging/qlge/qlge_main.c
> index 402edaeff..29606d1eb 100644
> --- a/drivers/staging/qlge/qlge_main.c
> +++ b/drivers/staging/qlge/qlge_main.c
> @@ -3938,7 +3938,7 @@ static int ql_configure_rings(struct ql_adapter *qdev)
>  	int i;
>  	struct rx_ring *rx_ring;
>  	struct tx_ring *tx_ring;
> -	int cpu_cnt = min(MAX_CPUS, (int)num_online_cpus());
> +	int cpu_cnt = min_t(int, MAX_CPUS, (int)num_online_cpus());

You should remove the cast on num_online_cpus() like checkpatch
suggests. min_t adds the cast to int on both of the inputs for you.

> 
>  	/* In a perfect world we have one RSS ring for each CPU
>  	 * and each has it's own vector.  To do that we ask for
> --
> 2.30.0

Cheers,
Nathan
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

  reply	other threads:[~2021-02-04 22:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-04 21:54 [PATCH] staging: qlge/qlge_main: Use min_t instead of min ameynarkhede02
2021-02-04 21:54 ` ameynarkhede02
2021-02-04 22:58 ` Nathan Chancellor [this message]
2021-02-04 22:58   ` Nathan Chancellor
2021-02-05  9:20   ` Amey Narkhede
2021-02-05  9:20     ` Amey Narkhede

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=20210204225844.GA431671@localhost \
    --to=nathan@kernel.org \
    --cc=GR-Linux-NIC-Dev@marvell.com \
    --cc=ameynarkhede02@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manishc@marvell.com \
    --cc=netdev@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.