mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'You Kangren' <youkangren@vivo.com>,
	Kalle Valo <kvalo@kernel.org>, Dongliang Mu <dzm91@hust.edu.cn>,
	Simon Horman <simon.horman@corigine.com>,
	Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
	"open list:RAYLINK/WEBGEAR 802.11 WIRELESS LAN DRIVER" 
	<linux-wireless@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>
Cc: "opensource.kernel@vivo.com" <opensource.kernel@vivo.com>
Subject: RE: [PATCH v3] wifi: ray_cs: Replace the ternary conditional operator with min()
Date: Thu, 29 Jun 2023 11:44:34 +0000	[thread overview]
Message-ID: <ab5f3f7ff5d24d659b2988d549499c5f@AcuMS.aculab.com> (raw)
In-Reply-To: <20230627043151.19576-1-youkangren@vivo.com>

From: You Kangren <youkangren@vivo.com>
> Sent: 27 June 2023 05:32
> 
> Replace the ternary conditional operator with min_t() to simplify the code
> 
> Signed-off-by: You Kangren <youkangren@vivo.com>
> ---
>  drivers/net/wireless/legacy/ray_cs.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/legacy/ray_cs.c b/drivers/net/wireless/legacy/ray_cs.c
> index 8ace797ce951..25edbc655738 100644
> --- a/drivers/net/wireless/legacy/ray_cs.c
> +++ b/drivers/net/wireless/legacy/ray_cs.c
> @@ -2086,8 +2086,7 @@ static void ray_rx(struct net_device *dev, ray_dev_t *local,
>  			rx_data(dev, prcs, pkt_addr, rx_len);
> 
>  		copy_from_rx_buff(local, (UCHAR *) &local->last_bcn, pkt_addr,
> -				  rx_len < sizeof(struct beacon_rx) ?
> -				  rx_len : sizeof(struct beacon_rx));
> +				  min_t(size_t, rx_len, sizeof(struct beacon_rx));

You should really consider changing the type of rx_len
before using min_t().

	David

> 
>  		local->beacon_rxed = 1;
>  		/* Get the statistics so the card counters never overflow */
> --
> 2.39.0

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)


  reply	other threads:[~2023-06-29 11:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-27  4:31 You Kangren
2023-06-29 11:44 ` David Laight [this message]
2023-06-29 20:05 ` Simon Horman

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=ab5f3f7ff5d24d659b2988d549499c5f@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=dzm91@hust.edu.cn \
    --cc=kvalo@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=opensource.kernel@vivo.com \
    --cc=simon.horman@corigine.com \
    --cc=youkangren@vivo.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

all inboxes | Powered by JetHome®