Skip to contentSkip to conversation

include: Include <linux/math.h> to resolve implicit declaration of do_div()

PATCH Applied Abdelrahman Youssef 3 participants 3 messages Oct 16, 2024 – Oct 18, 2024

v1 of 5 Applied Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 include: Include <linux/math.h> to resolve implicit declaration of do_div()

I was testing barebox with randconfig, so I got a warning (treated as an error) : implicit declaration of do_div(). So <linux/math.h> needs to included.

---
 include/linux/ktime.h | 1 +
 1 file changed, 1 insertion(+)
include/linux/ktime.h +1 -0
index ea368b8802..2b9a91d540 100644
@@ -21,6 +21,7 @@
 #ifndef _LINUX_KTIME_H
 #define _LINUX_KTIME_H
 
+#include <linux/math.h>
 #include <linux/time.h>
 #include <clock.h>
 #include <linux/bug.h>

---
base-commit: 9d47ff66c3892c5a6ddd4704993365a797fbeb68
change-id: 20241017-errors_fixes-81248755b864

Best regards,

Signature · 1 line
Abdelrahman Youssef <[email protected]>
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · On 17.10.24 01:47, Abdelrahman Youssef via B4 Relay wrote:

From: Abdelrahman Youssef <[email protected]>

I was testing barebox with randconfig, so I got a warning (treated as an error) : implicit declaration of do_div(). So <linux/math.h> needs to included.

Thanks,
Ahmad

Quoted 22 lines
---
 include/linux/ktime.h | 1 +
 1 file changed, 1 insertion(+)
include/linux/ktime.h +1 -1
index ea368b8802..2b9a91d540 100644
@@ -21,6 +21,7 @@
 #ifndef _LINUX_KTIME_H
 #define _LINUX_KTIME_H
 
+#include <linux/math.h>
 #include <linux/time.h>
 #include <clock.h>
 #include <linux/bug.h>
 
---

base-commit: 9d47ff66c3892c5a6ddd4704993365a797fbeb68
change-id: 20241017-errors_fixes-81248755b864

Best regards,

Signature · 4 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
Applied
#2 lore raw
In reply to Abdelrahman Youssef
Quoted 4 lines · On Thu, 17 Oct 2024 02:47:04 +0300, Abdelrahman Youssef via B4 Relay wrote:

I was testing barebox with randconfig, so I got a warning (treated as an error) : implicit declaration of do_div(). So <linux/math.h> needs to included.

Applied, thanks!

[1/1] include: Include <linux/math.h> to resolve implicit declaration of do_div()

      https://git.pengutronix.de/cgit/barebox/commit/?id=cb8767765854 (link may not be stable)

Best regards,

Signature · 1 line
Sascha Hauer <[email protected]>