* [PATCH v2] mtd: spi-nor: explicitly include <linux/math64.h>
@ 2025-02-23 6:51 Tudor Ambarus
2025-02-24 17:09 ` Pratyush Yadav
2025-03-07 6:37 ` Tudor Ambarus
0 siblings, 2 replies; 3+ messages in thread
From: Tudor Ambarus @ 2025-02-23 6:51 UTC (permalink / raw)
To: Pratyush Yadav, Michael Walle, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra
Cc: linux-mtd, linux-kernel, Tudor Ambarus
swp and otp drivers use div_u64 and div64_u64 and rely on implicit
inclusion of <linux/math64.h>.
It is good practice to directly include all headers used, it avoids
implicit dependencies and spurious breakage if someone rearranges
headers and causes the implicit include to vanish.
Include the missing header.
Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
---
Changes in v2:
- fix typo in commit message s/if/of/.
- Link to v1: https://lore.kernel.org/r/20250223-snor-math64-v1-1-8c7653111356@linaro.org
---
drivers/mtd/spi-nor/otp.c | 1 +
drivers/mtd/spi-nor/swp.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/drivers/mtd/spi-nor/otp.c b/drivers/mtd/spi-nor/otp.c
index 9a729aa3452d..7d0b145d78d8 100644
--- a/drivers/mtd/spi-nor/otp.c
+++ b/drivers/mtd/spi-nor/otp.c
@@ -6,6 +6,7 @@
*/
#include <linux/log2.h>
+#include <linux/math64.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/spi-nor.h>
diff --git a/drivers/mtd/spi-nor/swp.c b/drivers/mtd/spi-nor/swp.c
index e48c3cff247a..9c9328478d8a 100644
--- a/drivers/mtd/spi-nor/swp.c
+++ b/drivers/mtd/spi-nor/swp.c
@@ -5,6 +5,7 @@
* Copyright (C) 2005, Intec Automation Inc.
* Copyright (C) 2014, Freescale Semiconductor, Inc.
*/
+#include <linux/math64.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/spi-nor.h>
---
base-commit: 03e7bb864d9a9efca02743d4a9fab8f3d0b00407
change-id: 20250223-snor-math64-8d8d6db27a42
Best regards,
--
Tudor Ambarus <tudor.ambarus@linaro.org>
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] mtd: spi-nor: explicitly include <linux/math64.h>
2025-02-23 6:51 [PATCH v2] mtd: spi-nor: explicitly include <linux/math64.h> Tudor Ambarus
@ 2025-02-24 17:09 ` Pratyush Yadav
2025-03-07 6:37 ` Tudor Ambarus
1 sibling, 0 replies; 3+ messages in thread
From: Pratyush Yadav @ 2025-02-24 17:09 UTC (permalink / raw)
To: Tudor Ambarus
Cc: Pratyush Yadav, Michael Walle, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra, linux-mtd, linux-kernel
On Sun, Feb 23 2025, Tudor Ambarus wrote:
> swp and otp drivers use div_u64 and div64_u64 and rely on implicit
> inclusion of <linux/math64.h>.
>
> It is good practice to directly include all headers used, it avoids
> implicit dependencies and spurious breakage if someone rearranges
> headers and causes the implicit include to vanish.
>
> Include the missing header.
>
> Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Reviewed-by: Pratyush Yadav <pratyush@kernel.org>
--
Regards,
Pratyush Yadav
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] mtd: spi-nor: explicitly include <linux/math64.h>
2025-02-23 6:51 [PATCH v2] mtd: spi-nor: explicitly include <linux/math64.h> Tudor Ambarus
2025-02-24 17:09 ` Pratyush Yadav
@ 2025-03-07 6:37 ` Tudor Ambarus
1 sibling, 0 replies; 3+ messages in thread
From: Tudor Ambarus @ 2025-03-07 6:37 UTC (permalink / raw)
To: Pratyush Yadav, Michael Walle, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra, Tudor Ambarus
Cc: linux-mtd, linux-kernel
On Sun, 23 Feb 2025 06:51:10 +0000, Tudor Ambarus wrote:
> swp and otp drivers use div_u64 and div64_u64 and rely on implicit
> inclusion of <linux/math64.h>.
>
> It is good practice to directly include all headers used, it avoids
> implicit dependencies and spurious breakage if someone rearranges
> headers and causes the implicit include to vanish.
>
> [...]
Applied, thanks!
[1/1] mtd: spi-nor: explicitly include <linux/math64.h>
https://git.kernel.org/mtd/c/93020292fea7
Best regards,
--
Tudor Ambarus <tudor.ambarus@linaro.org>
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-03-07 6:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-23 6:51 [PATCH v2] mtd: spi-nor: explicitly include <linux/math64.h> Tudor Ambarus
2025-02-24 17:09 ` Pratyush Yadav
2025-03-07 6:37 ` Tudor Ambarus
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).