mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] include: linux/limits: add definition for RESOURCE_SIZE_MAX
@ 2025-04-09  6:56 Ahmad Fatoum
  2025-04-10  7:26 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2025-04-09  6:56 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

This is the maximum value that can be stored in a resource_size_t
and can be used as dummy invalid value if needed.

Import it with the same definition as in Linux.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 include/linux/limits.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/linux/limits.h b/include/linux/limits.h
index 8baf8494943e..2318e4f606d5 100644
--- a/include/linux/limits.h
+++ b/include/linux/limits.h
@@ -22,6 +22,8 @@
 #define INTPTR_MAX	LONG_MAX
 #define UINTPTR_MAX	ULONG_MAX
 
+#define RESOURCE_SIZE_MAX	((resource_size_t)~0)
+
 #define U8_MAX		((u8)~0U)
 #define S8_MAX		((s8)(U8_MAX >> 1))
 #define S8_MIN		((s8)(-S8_MAX - 1))
-- 
2.39.5




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] include: linux/limits: add definition for RESOURCE_SIZE_MAX
  2025-04-09  6:56 [PATCH] include: linux/limits: add definition for RESOURCE_SIZE_MAX Ahmad Fatoum
@ 2025-04-10  7:26 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2025-04-10  7:26 UTC (permalink / raw)
  To: barebox, Ahmad Fatoum


On Wed, 09 Apr 2025 08:56:12 +0200, Ahmad Fatoum wrote:
> This is the maximum value that can be stored in a resource_size_t
> and can be used as dummy invalid value if needed.
> 
> Import it with the same definition as in Linux.
> 
> 

Applied, thanks!

[1/1] include: linux/limits: add definition for RESOURCE_SIZE_MAX
      https://git.pengutronix.de/cgit/barebox/commit/?id=d3d49c7ac831 (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-04-10  8:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-09  6:56 [PATCH] include: linux/limits: add definition for RESOURCE_SIZE_MAX Ahmad Fatoum
2025-04-10  7:26 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox