* [PATCH v1 1/1] spi: bitbang: Use NSEC_PER_*SEC rather than hard coding
@ 2024-05-02 15:48 Andy Shevchenko
2024-05-06 1:04 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Andy Shevchenko @ 2024-05-02 15:48 UTC (permalink / raw)
To: Andy Shevchenko, Mark Brown, Uwe Kleine-König, linux-spi,
linux-kernel
Use NSEC_PER_*SEC rather than the hard coded value of 1000s.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/spi/spi-bitbang.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/spi/spi-bitbang.c b/drivers/spi/spi-bitbang.c
index a0e2204fc039..c11af39c9842 100644
--- a/drivers/spi/spi-bitbang.c
+++ b/drivers/spi/spi-bitbang.c
@@ -11,6 +11,7 @@
#include <linux/errno.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
+#include <linux/time64.h>
#include <linux/spi/spi.h>
#include <linux/spi/spi_bitbang.h>
@@ -168,8 +169,8 @@ int spi_bitbang_setup_transfer(struct spi_device *spi, struct spi_transfer *t)
if (!hz)
hz = spi->max_speed_hz;
if (hz) {
- cs->nsecs = (1000000000/2) / hz;
- if (cs->nsecs > (MAX_UDELAY_MS * 1000 * 1000))
+ cs->nsecs = (NSEC_PER_SEC / 2) / hz;
+ if (cs->nsecs > (MAX_UDELAY_MS * NSEC_PER_MSEC))
return -EINVAL;
}
--
2.43.0.rc1.1336.g36b5255a03ac
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v1 1/1] spi: bitbang: Use NSEC_PER_*SEC rather than hard coding
2024-05-02 15:48 [PATCH v1 1/1] spi: bitbang: Use NSEC_PER_*SEC rather than hard coding Andy Shevchenko
@ 2024-05-06 1:04 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2024-05-06 1:04 UTC (permalink / raw)
To: Uwe Kleine-König, linux-spi, linux-kernel, Andy Shevchenko
On Thu, 02 May 2024 18:48:25 +0300, Andy Shevchenko wrote:
> Use NSEC_PER_*SEC rather than the hard coded value of 1000s.
>
>
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
Thanks!
[1/1] spi: bitbang: Use NSEC_PER_*SEC rather than hard coding
commit: 645094b41157cce4ec41dc31298646c82f6998e0
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] 2+ messages in thread
end of thread, other threads:[~2024-05-06 1:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-02 15:48 [PATCH v1 1/1] spi: bitbang: Use NSEC_PER_*SEC rather than hard coding Andy Shevchenko
2024-05-06 1:04 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox