Search Linux Wireless

Re: [RFC v2 16/96] cl8k: add config.h

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

 



On 5/24/2022 4:33 AM, viktor.barna@xxxxxxxxxx wrote:
[snip]

+#define READ_BOOL(param) \
+{ \
+	if (!strcmp(name, #param)) { \
+		bool new_val = false; \
+		ret = kstrtobool(value, &new_val); \
+		if (ret) { \
+			pr_err("%s: invalid value [%s]\n", #param, value); \
+			break; \
+		} \
+		if (conf->param != new_val) { \
+			pr_debug("%s: old value %u -> new value %u\n", \
+				 #param, conf->param, new_val); \
+			conf->param = new_val; \
+		} \
+		break; \
+	} \
+}

You should review the guidance on macros at
<https://www.kernel.org/doc/html/latest/process/coding-style.html#macros-enums-and-rtl>

Note that things to avoid include:
1. macros that affect control flow
2. macros that depend on having a local variable with a magic name




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux