on a recent submit to LKML https://lore.kernel.org/lkml/20230801170255.163237-1-jim.cromie@gmail.com/ I got a Patchwork CI warning in report: https://patchwork.freedesktop.org/series/113363/ 1a864a4fe7ce dyndbg-API: fix CONFIG_DRM_USE_DYNAMIC_DEBUG regression -:445: CHECK:MACRO_ARG_REUSE: Macro argument reuse '_var' - possible side-effects? #445: FILE: include/linux/dynamic_debug.h:120: +#define DYNDBG_CLASSMAP_USE_(_var, _uname) \ + extern struct ddebug_class_map _var; \ + struct ddebug_class_user __used \ + __section("__dyndbg_class_users") _uname = { \ + .user_mod_name = KBUILD_MODNAME, \ + .map = &_var, \ } _var is expanded 2x, the "extra" time is to declare it as "extern", meaning its exported elsewhere. the usual fix for macro problems like this is __typeof(); something like: #define foo(a,b,...) \ typeof(a) _a = a; \ ... but I dont see how to use it - I need _var to name the struct exported from another module, and I need to take its &-address. Is there a trick / technique I can use ?
Hello, I posted this message to linix-gpio group about a week ago, but it didn't get any reply so far; thus trying here. I am developing a driver for PCIe-based device that needs to receive external signals through on-board GPIOs. The target platform is Intel-based board running Fedora 34 kernel 5.11.12-300.fc34.x86_64 and has GPIO controller driven by gpio-it87. # gpiodetect gpiochip0 [INT34BB:00] (312 lines) gpiochip1 [gpio_it87] (64 lines) 8 of available 64 lines are connected to a header on the board: # gpioinfo 1 ... line 49: "it87_gp71" unused input active-high line 50: "it87_gp72" unused input active-high line 51: "it87_gp73" unused input active-high line 52: "it87_gp74" unused input active-high line 53: "it87_gp75" unused input active-high line 54: "it87_gp76" unused input active-high line 55: "it87_gp77" unused input active-high ... These lines were verified with logic analyzer and `gpioset 1 nn=0|1` The PCIe device driver defines these lines as: static struct gpiod_lookup_table gpio_it87_gpios = { .dev_id = "gpio_it87", .table = { GPIO_LOOKUP("gpio-it87", 48, "it87_gp70", GPIO_ACTIVE_HIGH), GPIO_LOOKUP("gpio-it87", 49, "it87_gp71", GPIO_ACTIVE_HIGH), GPIO_LOOKUP("gpio-it87", 50, "it87_gp72", GPIO_ACTIVE_HIGH), GPIO_LOOKUP("gpio-it87", 51, "it87_gp73", GPIO_ACTIVE_HIGH), GPIO_LOOKUP("gpio-it87", 52, "it87_gp74", GPIO_ACTIVE_HIGH), GPIO_LOOKUP("gpio-it87", 53, "it87_gp75", GPIO_ACTIVE_HIGH), GPIO_LOOKUP("gpio-it87", 54, "it87_gp76", GPIO_ACTIVE_HIGH), GPIO_LOOKUP("gpio-it87", 55, "it87_gp77", GPIO_ACTIVE_HIGH), {}, }, }; and then adds them to lookup table, eg.: gpiod_add_lookup_table(&gpio_it87_gpios); However, none of those lines seem available struct desc *gpio = gpiod_get(dev, "it87_gp70", GPIOD_IN); Above returns -ENOENT for any of those lines. I believe it is due to incorrct lookup definions in gpio_it87_gpios above, however, I cannot figure out what is wrong there. What am I missing? Thanks, --Alex
participants (2)
-
Alexander Ivanov -
jim.cromie@gmail.com