forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/md/bcache/sysfs.h
....@@ -79,6 +79,16 @@
7979 return strtoul_safe(buf, var) ?: (ssize_t) size; \
8080 } while (0)
8181
82
+#define sysfs_strtoul_bool(file, var) \
83
+do { \
84
+ if (attr == &sysfs_ ## file) { \
85
+ unsigned long v = strtoul_or_return(buf); \
86
+ \
87
+ var = v ? 1 : 0; \
88
+ return size; \
89
+ } \
90
+} while (0)
91
+
8292 #define sysfs_strtoul_clamp(file, var, min, max) \
8393 do { \
8494 if (attr == &sysfs_ ## file) { \