spi: Fix for v6.8

One simple fix for a minor but valid issue with constants overflowing
 identified via cppcheck.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmW7h68ACgkQJNaLcl1U
 h9Boagf/TtTmAT4H7a+fUJhFoudhvYEgwCSt9t8RdIIQDB1j0c5jLQBUJRyFN8cu
 JMpdB0ShF29HVwfCccB2+VJlz9zk0Qjyr3ekADyGdDxnOQPd99gooWOy5K04DO6f
 Z/3g/PB2u+vHJZbzngkmhAnl3iCDPc9ykG4VQ5w6rQ2945ULsL4zoj8NSTqxpash
 AbxkKkR55UQ5ILq/YCwuSE84T+VsS/vk5iNQDK972Fc69wKoMwFA1hTPNDFO7jqg
 dRYZR1vZsECVzBeApMU2rUMstOmG/9dtW5tQnF9DTFiaYyw3KVfYlcjsopcI9y5u
 E6Es3HWkJFqoFnEo+2ES1c5ryvSmog==
 =jEDS
 -----END PGP SIGNATURE-----

Merge tag 'spi-fix-v6.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi

Pull spi fix from Mark Brown:
 "One simple fix for a minor but valid issue with constants overflowing
  identified via cppcheck"

* tag 'spi-fix-v6.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
  spi: sh-msiof: avoid integer overflow in constants
This commit is contained in:
Linus Torvalds 2024-02-01 10:10:17 -08:00
commit 6a864c09ea

View File

@ -136,14 +136,14 @@ struct sh_msiof_spi_priv {
/* SIFCTR */
#define SIFCTR_TFWM_MASK GENMASK(31, 29) /* Transmit FIFO Watermark */
#define SIFCTR_TFWM_64 (0 << 29) /* Transfer Request when 64 empty stages */
#define SIFCTR_TFWM_32 (1 << 29) /* Transfer Request when 32 empty stages */
#define SIFCTR_TFWM_24 (2 << 29) /* Transfer Request when 24 empty stages */
#define SIFCTR_TFWM_16 (3 << 29) /* Transfer Request when 16 empty stages */
#define SIFCTR_TFWM_12 (4 << 29) /* Transfer Request when 12 empty stages */
#define SIFCTR_TFWM_8 (5 << 29) /* Transfer Request when 8 empty stages */
#define SIFCTR_TFWM_4 (6 << 29) /* Transfer Request when 4 empty stages */
#define SIFCTR_TFWM_1 (7 << 29) /* Transfer Request when 1 empty stage */
#define SIFCTR_TFWM_64 (0UL << 29) /* Transfer Request when 64 empty stages */
#define SIFCTR_TFWM_32 (1UL << 29) /* Transfer Request when 32 empty stages */
#define SIFCTR_TFWM_24 (2UL << 29) /* Transfer Request when 24 empty stages */
#define SIFCTR_TFWM_16 (3UL << 29) /* Transfer Request when 16 empty stages */
#define SIFCTR_TFWM_12 (4UL << 29) /* Transfer Request when 12 empty stages */
#define SIFCTR_TFWM_8 (5UL << 29) /* Transfer Request when 8 empty stages */
#define SIFCTR_TFWM_4 (6UL << 29) /* Transfer Request when 4 empty stages */
#define SIFCTR_TFWM_1 (7UL << 29) /* Transfer Request when 1 empty stage */
#define SIFCTR_TFUA_MASK GENMASK(26, 20) /* Transmit FIFO Usable Area */
#define SIFCTR_TFUA_SHIFT 20
#define SIFCTR_TFUA(i) ((i) << SIFCTR_TFUA_SHIFT)