✗ Fi.CI.CHECKPATCH: warning for lib: Add a YAML emitter (rev2)

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

 



== Series Details ==

Series: lib: Add a YAML emitter (rev2)
URL   : https://patchwork.freedesktop.org/series/73433/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
d7299d4b320b lib: Add a YAML emitter
-:19: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating?
#19: 
new file mode 100644

-:494: WARNING:CONFIG_DESCRIPTION: please write a paragraph that describes the config symbol fully
#494: FILE: lib/Kconfig:673:
+config TEST_YAML

-:687: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'str' - possible side-effects?
#687: FILE: lib/yaml/yaml-emitter.c:25:
+#define STRING_INIT(str, len) { (str), (str) + (len), (str) }

-:689: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'str' - possible side-effects?
#689: FILE: lib/yaml/yaml-emitter.c:27:
+#define YAML_STRING(name, str) \
+	struct yaml_string name = STRING_INIT(str, strlen(str))

-:696: CHECK:MACRO_ARG_REUSE: Macro argument reuse 's' - possible side-effects?
#696: FILE: lib/yaml/yaml-emitter.c:34:
+#define IS_ALPHA_AT(s, offset)						\
+	(isalnum((s).pos[offset]) ||					\
+	 (s).pos[offset] == '_' ||					\
+	 (s).pos[offset] == '-')

-:696: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'offset' - possible side-effects?
#696: FILE: lib/yaml/yaml-emitter.c:34:
+#define IS_ALPHA_AT(s, offset)						\
+	(isalnum((s).pos[offset]) ||					\
+	 (s).pos[offset] == '_' ||					\
+	 (s).pos[offset] == '-')

-:711: CHECK:MACRO_ARG_REUSE: Macro argument reuse 's' - possible side-effects?
#711: FILE: lib/yaml/yaml-emitter.c:49:
+#define IS_BOM_AT(s, offset)						\
+	(CHECK_AT((s), '\xEF', (offset) + 0) &&				\
+	 CHECK_AT((s), '\xBB', (offset) + 1) &&				\
+	 CHECK_AT((s), '\xBF', (offset) + 2))  /* BOM (#xFEFF) */

-:711: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'offset' - possible side-effects?
#711: FILE: lib/yaml/yaml-emitter.c:49:
+#define IS_BOM_AT(s, offset)						\
+	(CHECK_AT((s), '\xEF', (offset) + 0) &&				\
+	 CHECK_AT((s), '\xBB', (offset) + 1) &&				\
+	 CHECK_AT((s), '\xBF', (offset) + 2))  /* BOM (#xFEFF) */

-:723: CHECK:MACRO_ARG_REUSE: Macro argument reuse 's' - possible side-effects?
#723: FILE: lib/yaml/yaml-emitter.c:61:
+#define IS_BLANK_AT(s, offset)						\
+	(IS_SPACE_AT((s), (offset)) || IS_TAB_AT((s), (offset)))

-:723: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'offset' - possible side-effects?
#723: FILE: lib/yaml/yaml-emitter.c:61:
+#define IS_BLANK_AT(s, offset)						\
+	(IS_SPACE_AT((s), (offset)) || IS_TAB_AT((s), (offset)))

-:727: CHECK:MACRO_ARG_REUSE: Macro argument reuse 's' - possible side-effects?
#727: FILE: lib/yaml/yaml-emitter.c:65:
+#define IS_BREAK_AT(s, offset)						\
+	(CHECK_AT((s), '\r', (offset)) || /* CR (#xD)*/			\
+	 CHECK_AT((s), '\n', (offset)) || /* LF (#xA) */		\
+	 (CHECK_AT((s), '\xC2', (offset)) &&				\
+	  CHECK_AT((s), '\x85', (offset) + 1)) || /* NEL (#x85) */	\
+	 (CHECK_AT((s), '\xE2', (offset)) &&				\
+	  CHECK_AT((s), '\x80', (offset) + 1) &&			\
+	  CHECK_AT((s), '\xA8', (offset) + 2)) ||   /* LS (#x2028) */	\
+	 (CHECK_AT((s), '\xE2', (offset)) &&				\
+	  CHECK_AT((s), '\x80', (offset) + 1) &&			\
+	    CHECK_AT((s), '\xA9', (offset) + 2)))  /* PS (#x2029) */

-:727: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'offset' - possible side-effects?
#727: FILE: lib/yaml/yaml-emitter.c:65:
+#define IS_BREAK_AT(s, offset)						\
+	(CHECK_AT((s), '\r', (offset)) || /* CR (#xD)*/			\
+	 CHECK_AT((s), '\n', (offset)) || /* LF (#xA) */		\
+	 (CHECK_AT((s), '\xC2', (offset)) &&				\
+	  CHECK_AT((s), '\x85', (offset) + 1)) || /* NEL (#x85) */	\
+	 (CHECK_AT((s), '\xE2', (offset)) &&				\
+	  CHECK_AT((s), '\x80', (offset) + 1) &&			\
+	  CHECK_AT((s), '\xA8', (offset) + 2)) ||   /* LS (#x2028) */	\
+	 (CHECK_AT((s), '\xE2', (offset)) &&				\
+	  CHECK_AT((s), '\x80', (offset) + 1) &&			\
+	    CHECK_AT((s), '\xA9', (offset) + 2)))  /* PS (#x2029) */

-:740: CHECK:MACRO_ARG_REUSE: Macro argument reuse 's' - possible side-effects?
#740: FILE: lib/yaml/yaml-emitter.c:78:
+#define IS_CRLF_AT(s, offset)						\
+	(CHECK_AT((s), '\r', (offset)) && CHECK_AT((s), '\n', (offset) + 1))

-:740: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'offset' - possible side-effects?
#740: FILE: lib/yaml/yaml-emitter.c:78:
+#define IS_CRLF_AT(s, offset)						\
+	(CHECK_AT((s), '\r', (offset)) && CHECK_AT((s), '\n', (offset) + 1))

-:744: CHECK:MACRO_ARG_REUSE: Macro argument reuse 's' - possible side-effects?
#744: FILE: lib/yaml/yaml-emitter.c:82:
+#define IS_BREAKZ_AT(s, offset)						\
+	(IS_BREAK_AT((s), (offset)) || IS_Z_AT((s), (offset)))

-:744: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'offset' - possible side-effects?
#744: FILE: lib/yaml/yaml-emitter.c:82:
+#define IS_BREAKZ_AT(s, offset)						\
+	(IS_BREAK_AT((s), (offset)) || IS_Z_AT((s), (offset)))

-:748: CHECK:MACRO_ARG_REUSE: Macro argument reuse 's' - possible side-effects?
#748: FILE: lib/yaml/yaml-emitter.c:86:
+#define IS_SPACEZ_AT(s, offset)						\
+	(IS_SPACE_AT((s), (offset)) || IS_BREAKZ_AT((s), (offset)))

-:748: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'offset' - possible side-effects?
#748: FILE: lib/yaml/yaml-emitter.c:86:
+#define IS_SPACEZ_AT(s, offset)						\
+	(IS_SPACE_AT((s), (offset)) || IS_BREAKZ_AT((s), (offset)))

-:752: CHECK:MACRO_ARG_REUSE: Macro argument reuse 's' - possible side-effects?
#752: FILE: lib/yaml/yaml-emitter.c:90:
+#define IS_BLANKZ_AT(s, offset)						\
+	(IS_BLANK_AT((s), (offset)) || IS_BREAKZ_AT((s), (offset)))

-:752: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'offset' - possible side-effects?
#752: FILE: lib/yaml/yaml-emitter.c:90:
+#define IS_BLANKZ_AT(s, offset)						\
+	(IS_BLANK_AT((s), (offset)) || IS_BREAKZ_AT((s), (offset)))

-:770: CHECK:MACRO_ARG_REUSE: Macro argument reuse 's' - possible side-effects?
#770: FILE: lib/yaml/yaml-emitter.c:108:
+#define ADVANCE(s)	((s).pos += utf8_width((&s)))

-:774: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'stack' - possible side-effects?
#774: FILE: lib/yaml/yaml-emitter.c:112:
+#define EMPTY(context, stack) ((stack).start == (stack).top)

-:776: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'stack' - possible side-effects?
#776: FILE: lib/yaml/yaml-emitter.c:114:
+#define PUSH(context, stack, value)					\
+	(((stack).top != (stack).end ||					\
+	  !yaml_stack_extend((void **)&(stack).start,			\
+			     (void **)&(stack).top, (void **)&(stack).end)) ? \
+	 (*((stack).top++) = value, 0) :				\
+	 ((context)->errno = -ENOMEM))

-:2160: WARNING:AVOID_BUG: Avoid crashing the kernel - try using WARN_ON & recovery code rather than BUG() or BUG_ON()
#2160: FILE: lib/yaml/yaml-emitter.c:1498:
+		BUG();

-:2843: WARNING:UNNECESSARY_ELSE: else is not generally useful after a break or return
#2843: FILE: lib/yaml/yaml-emitter.c:2181:
+		return emit_node(emitter, event, 0, 0, 1, 1);
+	} else {

-:2944: WARNING:AVOID_BUG: Avoid crashing the kernel - try using WARN_ON & recovery code rather than BUG() or BUG_ON()
#2944: FILE: lib/yaml/yaml-emitter.c:2282:
+		BUG();

-:3017: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'stack' - possible side-effects?
#3017: FILE: lib/yaml/yaml-emitter.c:2355:
+#define STACK_INIT(context, stack)                                     \
+	(((stack).start = kmalloc(INITIAL_STACK_SIZE * sizeof(*(stack). start),\
+				  gfp)) ?			\
+	((stack).top = (stack).start,					\
+	(stack).end = (stack).start + INITIAL_STACK_SIZE,		\
+	1) : 0)

-:3178: WARNING:CONSTANT_COMPARISON: Comparisons should place the constant on the right side of the test
#3178: FILE: lib/yaml/yaml-emitter.c:2516:
+	emitter->best_indent = (1 < indent && indent < 10) ? indent : 2;

-:3468: WARNING:IF_0: Consider removing the code enclosed by this #if 0 and its #endif
#3468: FILE: lib/yaml/yaml-events.c:115:
+#if 0

-:3509: WARNING:IF_0: Consider removing the code enclosed by this #if 0 and its #endif
#3509: FILE: lib/yaml/yaml-events.c:156:
+#if 0

total: 0 errors, 8 warnings, 22 checks, 3935 lines checked


_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx



[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux