From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: David Laight <david.laight.linux@gmail.com>
Cc: linux-arm-kernel@lists.infradead.org, linux-spi@vger.kernel.org,
linux-kernel@vger.kernel.org, Daniel Mack <daniel@zonque.org>,
Haojian Zhuang <haojian.zhuang@gmail.com>,
Robert Jarzmik <robert.jarzmik@free.fr>,
Mark Brown <broonie@kernel.org>
Subject: Re: [PATCH v1 1/1] spi: pxa2xx: use min() instead of min_t()
Date: Mon, 23 Feb 2026 17:23:58 +0200 [thread overview]
Message-ID: <aZxxDhoyuhNK0r7h@smile.fi.intel.com> (raw)
In-Reply-To: <20260223151829.6192b32d@pumpkin>
On Mon, Feb 23, 2026 at 03:18:29PM +0000, David Laight wrote:
> On Mon, 23 Feb 2026 15:44:37 +0100
> Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
>
> > min_t(int, a, b) casts an 'unsigned long' to 'int'. This might lead
> > to the cases when big number is wrongly chosen. On the other hand,
> > the SPI transfer speed rate is unsigned and driver uses signed type
> > for an unknown reason. Change the type of the SPI transfer speed
> > to be unsigned and convert to use min() instead of min_t().
>
> I think you should use 'unsigned int' or 'u32' not 'unsigned long'.
> There is no reason for these fields to have different sizes on 32 and 64bit.
>
> Were spi to support 4GHz clocks (fat chance on a pcb track) you'd
> need to use u64.
Fair enough. I will correct in v2.
Thanks for review.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2026-02-23 15:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-23 14:44 [PATCH v1 1/1] spi: pxa2xx: use min() instead of min_t() Andy Shevchenko
2026-02-23 15:18 ` David Laight
2026-02-23 15:23 ` Andy Shevchenko [this message]
2026-02-25 19:07 ` Mark Brown
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=aZxxDhoyuhNK0r7h@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=broonie@kernel.org \
--cc=daniel@zonque.org \
--cc=david.laight.linux@gmail.com \
--cc=haojian.zhuang@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=robert.jarzmik@free.fr \
/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