[PATCH v2 18/20] of: constify string pointed to by struct of_device_id::compatible

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In Linux struct of_device_id::compatible is a character array, but in
barebox, so far it has been a pointer to char *. As most compatible
strings are smaller than 24 bytes, we are likely saving some space by
using a pointer, so we will keep that is, but let's make the member
const to reflect the fact that it points at immutable strings and to
allow easier use without casting.

Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx>
---
v1 -> v2:
  - new patch (Sascha)
---
 include/of.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/of.h b/include/of.h
index 5686709fcf0a..e99b41ef6f14 100644
--- a/include/of.h
+++ b/include/of.h
@@ -40,7 +40,7 @@ struct device_node {
 };
 
 struct of_device_id {
-	char *compatible;
+	const char *compatible;
 	const void *data;
 };
 
-- 
2.39.2





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux