|WARNING| pw168849 [PATCH v15 19/25] vfio: cleanup and refactor

checkpatch at dpdk.org checkpatch at dpdk.org
Tue Sep 1 18:19:39 CEST 2026


Test-Label: checkpatch
Test-Status: WARNING
http://dpdk.org/patch/168849

_coding style issues_


WARNING:LONG_LINE: line length of 101 exceeds 100 columns
#1649: FILE: lib/eal/linux/eal_vfio.c:558:
+		ret = vfio_global_cfg.ops->dma_user_map_func(cfg, map->addr, map->iova, map->len, 1);

ERROR:COMPLEX_MACRO: Macros with complex values should be enclosed in parentheses
#4093: FILE: lib/eal/linux/eal_vfio.h:119:
+#define VFIO_CONTAINER_FOREACH_ACTIVE(cfg) \
+	VFIO_CONTAINER_FOREACH((cfg)) \
+		if (((cfg)->active))

BUT SEE:

   do {} while (0) advice is over-stated in a few situations:

   The more obvious case is macros, like MODULE_PARM_DESC, invoked at
   file-scope, where C disallows code (it must be in functions).  See
   $exceptions if you have one to add by name.

   More troublesome is declarative macros used at top of new scope,
   like DECLARE_PER_CPU.  These might just compile with a do-while-0
   wrapper, but would be incorrect.  Most of these are handled by
   detecting struct,union,etc declaration primitives in $exceptions.

   Theres also macros called inside an if (block), which "return" an
   expression.  These cannot do-while, and need a ({}) wrapper.

   Enjoy this qualification while we work to improve our heuristics.

ERROR:COMPLEX_MACRO: Macros with complex values should be enclosed in parentheses
#4102: FILE: lib/eal/linux/eal_vfio.h:128:
+#define VFIO_GROUP_FOREACH_ACTIVE(cfg, grp) \
+	VFIO_GROUP_FOREACH((cfg), (grp)) \
+		if ((grp)->active)

BUT SEE:

   do {} while (0) advice is over-stated in a few situations:

   The more obvious case is macros, like MODULE_PARM_DESC, invoked at
   file-scope, where C disallows code (it must be in functions).  See
   $exceptions if you have one to add by name.

   More troublesome is declarative macros used at top of new scope,
   like DECLARE_PER_CPU.  These might just compile with a do-while-0
   wrapper, but would be incorrect.  Most of these are handled by
   detecting struct,union,etc declaration primitives in $exceptions.

   Theres also macros called inside an if (block), which "return" an
   expression.  These cannot do-while, and need a ({}) wrapper.

   Enjoy this qualification while we work to improve our heuristics.

ERROR:COMPLEX_MACRO: Macros with complex values should be enclosed in parentheses
#4111: FILE: lib/eal/linux/eal_vfio.h:137:
+#define VFIO_DEVICE_FOREACH_ACTIVE(cfg, dev) \
+	VFIO_DEVICE_FOREACH((cfg), (dev)) \
+		if ((dev)->active)

BUT SEE:

   do {} while (0) advice is over-stated in a few situations:

   The more obvious case is macros, like MODULE_PARM_DESC, invoked at
   file-scope, where C disallows code (it must be in functions).  See
   $exceptions if you have one to add by name.

   More troublesome is declarative macros used at top of new scope,
   like DECLARE_PER_CPU.  These might just compile with a do-while-0
   wrapper, but would be incorrect.  Most of these are handled by
   detecting struct,union,etc declaration primitives in $exceptions.

   Theres also macros called inside an if (block), which "return" an
   expression.  These cannot do-while, and need a ({}) wrapper.

   Enjoy this qualification while we work to improve our heuristics.

WARNING:LONG_LINE: line length of 106 exceeds 100 columns
#5041: FILE: lib/eal/linux/eal_vfio_group.c:865:
+			ops->type_id, ops->name, vfio_global_cfg.ops->type_id, vfio_global_cfg.ops->name);

total: 3 errors, 2 warnings, 4983 lines checked


More information about the test-report mailing list