netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Felix Manlunas <felix.manlunas@cavium.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org,
	raghu.vatsavayi@cavium.com, derek.chickles@cavium.com,
	satananda.burla@cavium.com, ricardo.farrington@cavium.com
Subject: Re: [PATCH net-next] liquidio: standardization: use min_t instead of custom macro
Date: Sun, 25 Jun 2017 09:09:06 +0300	[thread overview]
Message-ID: <20170625060906.GO1248@mtr-leonro.local> (raw)
In-Reply-To: <20170624113156.GA1313@felix-thinkpad.cavium.com>

[-- Attachment #1: Type: text/plain, Size: 1631 bytes --]

On Sat, Jun 24, 2017 at 04:31:56AM -0700, Felix Manlunas wrote:
> From: Rick Farrington <ricardo.farrington@cavium.com>
>
> Replaced custom MIN macro with use of standard 'min_t'.
>
> Signed-off-by: Rick Farrington <ricardo.farrington@cavium.com>
> Signed-off-by: Derek Chickles <derek.chickles@cavium.com>
> Signed-off-by: Felix Manlunas <felix.manlunas@cavium.com>
> ---
>  drivers/net/ethernet/cavium/liquidio/octeon_console.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/cavium/liquidio/octeon_console.c b/drivers/net/ethernet/cavium/liquidio/octeon_console.c
> index 53f38d0..2dc0e30 100644
> --- a/drivers/net/ethernet/cavium/liquidio/octeon_console.c
> +++ b/drivers/net/ethernet/cavium/liquidio/octeon_console.c
> @@ -42,7 +42,6 @@ static int octeon_console_read(struct octeon_device *oct, u32 console_num,
>  MODULE_PARM_DESC(console_bitmask,
>  		 "Bitmask indicating which consoles have debug output redirected to syslog.");
>
> -#define MIN(a, b) min((a), (b))
>  #define CAST_ULL(v) ((u64)(v))

It will be awesome to drop this macro too. It is used in one place and
hides important information.

Thanks

>
>  #define BOOTLOADER_PCI_READ_BUFFER_DATA_ADDR    0x0006c008
> @@ -704,7 +703,7 @@ static int octeon_console_read(struct octeon_device *oct, u32 console_num,
>  	if (bytes_to_read <= 0)
>  		return bytes_to_read;
>
> -	bytes_to_read = MIN(bytes_to_read, (s32)buf_size);
> +	bytes_to_read = min_t(s32, bytes_to_read, buf_size);
>
>  	/* Check to see if what we want to read is not contiguous, and limit
>  	 * ourselves to the contiguous block
> --
> 1.8.3.1
>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

      reply	other threads:[~2017-06-25  6:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-24 11:31 [PATCH net-next] liquidio: standardization: use min_t instead of custom macro Felix Manlunas
2017-06-25  6:09 ` Leon Romanovsky [this message]

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=20170625060906.GO1248@mtr-leonro.local \
    --to=leon@kernel.org \
    --cc=davem@davemloft.net \
    --cc=derek.chickles@cavium.com \
    --cc=felix.manlunas@cavium.com \
    --cc=netdev@vger.kernel.org \
    --cc=raghu.vatsavayi@cavium.com \
    --cc=ricardo.farrington@cavium.com \
    --cc=satananda.burla@cavium.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 NNTP newsgroup(s).