* [PATCH 0/3] spi: use min_t() to improve code
@ 2025-08-15 8:21 Qianfeng Rong
2025-08-15 8:21 ` [PATCH 1/3] spi: spi-fsl-lpspi: " Qianfeng Rong
2025-08-18 20:35 ` [PATCH 0/3] spi: " Mark Brown
0 siblings, 2 replies; 4+ messages in thread
From: Qianfeng Rong @ 2025-08-15 8:21 UTC (permalink / raw)
To: Frank Li, Mark Brown, Avi Fishman, Tomer Maimon, Tali Perry,
Patrick Venture, Nancy Yuen, Benjamin Fair, Linus Walleij,
open list:FREESCALE IMX LPSPI DRIVER,
open list:FREESCALE IMX LPSPI DRIVER, open list,
moderated list:ARM/NUVOTON NPCM ARCHITECTURE,
moderated list:ARM PRIMECELL SSP PL022 SPI DRIVER
Cc: Qianfeng Rong
Use min_t() to reduce the code and improve readability.
No functional changes.
Qianfeng Rong (3):
spi: spi-fsl-lpspi: use min_t() to improve code
spi: npcm-fiu: use min_t() to improve code
spi: spl022: use min_t() to improve code
drivers/spi/spi-fsl-lpspi.c | 8 ++++----
drivers/spi/spi-npcm-fiu.c | 6 ++----
drivers/spi/spi-pl022.c | 13 +++++--------
3 files changed, 11 insertions(+), 16 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/3] spi: spi-fsl-lpspi: use min_t() to improve code
2025-08-15 8:21 [PATCH 0/3] spi: use min_t() to improve code Qianfeng Rong
@ 2025-08-15 8:21 ` Qianfeng Rong
2025-08-15 16:48 ` Frank Li
2025-08-18 20:35 ` [PATCH 0/3] spi: " Mark Brown
1 sibling, 1 reply; 4+ messages in thread
From: Qianfeng Rong @ 2025-08-15 8:21 UTC (permalink / raw)
To: Frank Li, Mark Brown, open list:FREESCALE IMX LPSPI DRIVER,
open list:FREESCALE IMX LPSPI DRIVER, open list
Cc: Qianfeng Rong
Use min_t() to reduce the code in fsl_lpspi_setup_transfer() and
improve its readability.
Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
---
drivers/spi/spi-fsl-lpspi.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/spi/spi-fsl-lpspi.c b/drivers/spi/spi-fsl-lpspi.c
index 313e444a34f3..dbdb9e114022 100644
--- a/drivers/spi/spi-fsl-lpspi.c
+++ b/drivers/spi/spi-fsl-lpspi.c
@@ -25,6 +25,7 @@
#include <linux/spi/spi.h>
#include <linux/spi/spi_bitbang.h>
#include <linux/types.h>
+#include <linux/minmax.h>
#define DRIVER_NAME "fsl_lpspi"
@@ -473,10 +474,9 @@ static int fsl_lpspi_setup_transfer(struct spi_controller *controller,
fsl_lpspi->tx = fsl_lpspi_buf_tx_u32;
}
- if (t->len <= fsl_lpspi->txfifosize)
- fsl_lpspi->watermark = t->len;
- else
- fsl_lpspi->watermark = fsl_lpspi->txfifosize;
+ fsl_lpspi->watermark = min_t(typeof(fsl_lpspi->watermark),
+ fsl_lpspi->txfifosize,
+ t->len);
if (fsl_lpspi_can_dma(controller, spi, t))
fsl_lpspi->usedma = true;
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/3] spi: spi-fsl-lpspi: use min_t() to improve code
2025-08-15 8:21 ` [PATCH 1/3] spi: spi-fsl-lpspi: " Qianfeng Rong
@ 2025-08-15 16:48 ` Frank Li
0 siblings, 0 replies; 4+ messages in thread
From: Frank Li @ 2025-08-15 16:48 UTC (permalink / raw)
To: Qianfeng Rong
Cc: Mark Brown, open list:FREESCALE IMX LPSPI DRIVER,
open list:FREESCALE IMX LPSPI DRIVER, open list
On Fri, Aug 15, 2025 at 04:21:15PM +0800, Qianfeng Rong wrote:
> Use min_t() to reduce the code in fsl_lpspi_setup_transfer() and
> improve its readability.
>
Nit: No functionality change.
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
> ---
> drivers/spi/spi-fsl-lpspi.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/spi/spi-fsl-lpspi.c b/drivers/spi/spi-fsl-lpspi.c
> index 313e444a34f3..dbdb9e114022 100644
> --- a/drivers/spi/spi-fsl-lpspi.c
> +++ b/drivers/spi/spi-fsl-lpspi.c
> @@ -25,6 +25,7 @@
> #include <linux/spi/spi.h>
> #include <linux/spi/spi_bitbang.h>
> #include <linux/types.h>
> +#include <linux/minmax.h>
>
> #define DRIVER_NAME "fsl_lpspi"
>
> @@ -473,10 +474,9 @@ static int fsl_lpspi_setup_transfer(struct spi_controller *controller,
> fsl_lpspi->tx = fsl_lpspi_buf_tx_u32;
> }
>
> - if (t->len <= fsl_lpspi->txfifosize)
> - fsl_lpspi->watermark = t->len;
> - else
> - fsl_lpspi->watermark = fsl_lpspi->txfifosize;
> + fsl_lpspi->watermark = min_t(typeof(fsl_lpspi->watermark),
> + fsl_lpspi->txfifosize,
> + t->len);
>
> if (fsl_lpspi_can_dma(controller, spi, t))
> fsl_lpspi->usedma = true;
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 0/3] spi: use min_t() to improve code
2025-08-15 8:21 [PATCH 0/3] spi: use min_t() to improve code Qianfeng Rong
2025-08-15 8:21 ` [PATCH 1/3] spi: spi-fsl-lpspi: " Qianfeng Rong
@ 2025-08-18 20:35 ` Mark Brown
1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2025-08-18 20:35 UTC (permalink / raw)
To: Frank Li, Avi Fishman, Tomer Maimon, Tali Perry, Patrick Venture,
Nancy Yuen, Benjamin Fair, Linus Walleij, linux-spi, imx,
linux-kernel, openbmc, linux-arm-kernel, Qianfeng Rong
On Fri, 15 Aug 2025 16:21:14 +0800, Qianfeng Rong wrote:
> Use min_t() to reduce the code and improve readability.
>
> No functional changes.
>
> Qianfeng Rong (3):
> spi: spi-fsl-lpspi: use min_t() to improve code
> spi: npcm-fiu: use min_t() to improve code
> spi: spl022: use min_t() to improve code
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
Thanks!
[1/3] spi: spi-fsl-lpspi: use min_t() to improve code
commit: a750050349ea138e3e86c66a8a41de736619b9de
[2/3] spi: npcm-fiu: use min_t() to improve code
commit: 1bdc716023a78c2c41fdcb3fc37f09da1be4b7df
[3/3] spi: spl022: use min_t() to improve code
commit: 90179609efa421b1ccc7d8eafbc078bafb25777c
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-08-18 20:35 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-15 8:21 [PATCH 0/3] spi: use min_t() to improve code Qianfeng Rong
2025-08-15 8:21 ` [PATCH 1/3] spi: spi-fsl-lpspi: " Qianfeng Rong
2025-08-15 16:48 ` Frank Li
2025-08-18 20:35 ` [PATCH 0/3] spi: " Mark Brown
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).