Skip to content

Instantly share code, notes, and snippets.

@conor-pwbot
Created January 6, 2023 05:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save conor-pwbot/b653d62917648f0cc98bdad34c79ac22 to your computer and use it in GitHub Desktop.
Save conor-pwbot/b653d62917648f0cc98bdad34c79ac22 to your computer and use it in GitHub Desktop.
CHECK: No space is necessary after a cast
CHECK: Unnecessary parentheses around v->counter
ERROR: "foo * bar" should be "foo *bar"
ERROR: space required after that ',' (ctx:VxV)
ERROR: space required after that ';' (ctx:VxV)
WARNING: Prefer using '"%s...", __func__' to using '__xchg_local', this function's name, in a string
WARNING: Prefer using '"%s...", __func__' to using '__xchg_relaxed', this function's name, in a string
WARNING: Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst
WARNING: line length of 102 exceeds 100 columns
==========
checkpatch - FAILED
WARNING: Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst
#107: FILE: arch/arm/include/asm/cmpxchg.h:29:
+__arch_xchg(unsigned long x, volatile void *ptr, int size)
WARNING: Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst
#134: FILE: arch/arm64/include/asm/cmpxchg.h:66:
+__arch_xchg##sfx(unsigned long x, volatile void *ptr, int size) \
WARNING: Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst
#167: FILE: arch/hexagon/include/asm/cmpxchg.h:23:
+__arch_xchg(unsigned long x, volatile void *ptr, int size)
CHECK: No space is necessary after a cast
#191: FILE: arch/ia64/include/asm/cmpxchg.h:8:
+({(__typeof__(*(ptr))) __arch_xchg((unsigned long) (x), (ptr), sizeof(*(ptr)));})
ERROR: space required after that ';' (ctx:VxV)
#191: FILE: arch/ia64/include/asm/cmpxchg.h:8:
+({(__typeof__(*(ptr))) __arch_xchg((unsigned long) (x), (ptr), sizeof(*(ptr)));})
^
CHECK: No space is necessary after a cast
#213: FILE: arch/ia64/include/uapi/asm/cmpxchg.h:58:
+({(__typeof__(*(ptr))) __arch_xchg((unsigned long) (x), (ptr), sizeof(*(ptr)));})
ERROR: space required after that ';' (ctx:VxV)
#213: FILE: arch/ia64/include/uapi/asm/cmpxchg.h:58:
+({(__typeof__(*(ptr))) __arch_xchg((unsigned long) (x), (ptr), sizeof(*(ptr)));})
^
WARNING: Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst
#226: FILE: arch/loongarch/include/asm/cmpxchg.h:65:
+__arch_xchg(volatile void *ptr, unsigned long x, int size)
ERROR: "foo * bar" should be "foo *bar"
#248: FILE: arch/m68k/include/asm/cmpxchg.h:12:
+static inline unsigned long __arch_xchg(unsigned long x, volatile void * ptr, int size)
WARNING: Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst
#248: FILE: arch/m68k/include/asm/cmpxchg.h:12:
+static inline unsigned long __arch_xchg(unsigned long x, volatile void * ptr, int size)
ERROR: "foo * bar" should be "foo *bar"
#257: FILE: arch/m68k/include/asm/cmpxchg.h:43:
+static inline unsigned long __arch_xchg(unsigned long x, volatile void * ptr, int size)
WARNING: Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst
#257: FILE: arch/m68k/include/asm/cmpxchg.h:43:
+static inline unsigned long __arch_xchg(unsigned long x, volatile void * ptr, int size)
WARNING: line length of 102 exceeds 100 columns
#266: FILE: arch/m68k/include/asm/cmpxchg.h:78:
+#define arch_xchg(ptr,x) ({(__typeof__(*(ptr)))__arch_xchg((unsigned long)(x),(ptr),sizeof(*(ptr)));})
ERROR: space required after that ',' (ctx:VxV)
#266: FILE: arch/m68k/include/asm/cmpxchg.h:78:
+#define arch_xchg(ptr,x) ({(__typeof__(*(ptr)))__arch_xchg((unsigned long)(x),(ptr),sizeof(*(ptr)));})
^
ERROR: space required after that ',' (ctx:VxV)
#266: FILE: arch/m68k/include/asm/cmpxchg.h:78:
+#define arch_xchg(ptr,x) ({(__typeof__(*(ptr)))__arch_xchg((unsigned long)(x),(ptr),sizeof(*(ptr)));})
^
ERROR: space required after that ',' (ctx:VxV)
#266: FILE: arch/m68k/include/asm/cmpxchg.h:78:
+#define arch_xchg(ptr,x) ({(__typeof__(*(ptr)))__arch_xchg((unsigned long)(x),(ptr),sizeof(*(ptr)));})
^
ERROR: space required after that ';' (ctx:VxV)
#266: FILE: arch/m68k/include/asm/cmpxchg.h:78:
+#define arch_xchg(ptr,x) ({(__typeof__(*(ptr)))__arch_xchg((unsigned long)(x),(ptr),sizeof(*(ptr)));})
^
WARNING: Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst
#279: FILE: arch/mips/include/asm/cmpxchg.h:71:
+unsigned long __arch_xchg(volatile void *ptr, unsigned long x, int size)
WARNING: Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst
#303: FILE: arch/openrisc/include/asm/cmpxchg.h:151:
+__arch_xchg(volatile void *ptr, unsigned long with, int size)
WARNING: Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst
#329: FILE: arch/parisc/include/asm/cmpxchg.h:25:
+__arch_xchg(unsigned long x, volatile void *ptr, int size)
WARNING: Prefer using '"%s...", __func__' to using '__xchg_local', this function's name, in a string
#351: FILE: arch/powerpc/include/asm/cmpxchg.h:232:
+ BUILD_BUG_ON_MSG(1, "Unsupported size for __xchg_local");
WARNING: Prefer using '"%s...", __func__' to using '__xchg_relaxed', this function's name, in a string
#360: FILE: arch/powerpc/include/asm/cmpxchg.h:251:
+ BUILD_BUG_ON_MSG(1, "Unsupported size for __xchg_relaxed");
CHECK: Unnecessary parentheses around v->counter
#373: FILE: arch/riscv/include/asm/atomic.h:264:
+ return __arch_xchg(&(v->counter), n, size); \
ERROR: space required after that ',' (ctx:VxV)
#443: FILE: arch/sh/include/asm/cmpxchg.h:49:
+ ((__typeof__(*(ptr)))__arch_xchg((ptr),(unsigned long)(x), sizeof(*(ptr))))
^
ERROR: "foo * bar" should be "foo *bar"
#456: FILE: arch/sparc/include/asm/cmpxchg_32.h:18:
+static inline unsigned long __arch_xchg(unsigned long x, __volatile__ void * ptr, int size)
WARNING: line length of 102 exceeds 100 columns
#465: FILE: arch/sparc/include/asm/cmpxchg_32.h:28:
+#define arch_xchg(ptr,x) ({(__typeof__(*(ptr)))__arch_xchg((unsigned long)(x),(ptr),sizeof(*(ptr)));})
ERROR: space required after that ',' (ctx:VxV)
#465: FILE: arch/sparc/include/asm/cmpxchg_32.h:28:
+#define arch_xchg(ptr,x) ({(__typeof__(*(ptr)))__arch_xchg((unsigned long)(x),(ptr),sizeof(*(ptr)));})
^
ERROR: space required after that ',' (ctx:VxV)
#465: FILE: arch/sparc/include/asm/cmpxchg_32.h:28:
+#define arch_xchg(ptr,x) ({(__typeof__(*(ptr)))__arch_xchg((unsigned long)(x),(ptr),sizeof(*(ptr)));})
^
ERROR: space required after that ',' (ctx:VxV)
#465: FILE: arch/sparc/include/asm/cmpxchg_32.h:28:
+#define arch_xchg(ptr,x) ({(__typeof__(*(ptr)))__arch_xchg((unsigned long)(x),(ptr),sizeof(*(ptr)));})
^
ERROR: space required after that ';' (ctx:VxV)
#465: FILE: arch/sparc/include/asm/cmpxchg_32.h:28:
+#define arch_xchg(ptr,x) ({(__typeof__(*(ptr)))__arch_xchg((unsigned long)(x),(ptr),sizeof(*(ptr)));})
^
ERROR: "foo * bar" should be "foo *bar"
#489: FILE: arch/sparc/include/asm/cmpxchg_64.h:91:
+__arch_xchg(unsigned long x, __volatile__ void * ptr, int size)
ERROR: space required after that ',' (ctx:VxV)
#502: FILE: arch/xtensa/include/asm/cmpxchg.h:173:
+ ((__typeof__(*(ptr)))__arch_xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
^
ERROR: space required after that ',' (ctx:VxV)
#502: FILE: arch/xtensa/include/asm/cmpxchg.h:173:
+ ((__typeof__(*(ptr)))__arch_xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
^
ERROR: "foo * bar" should be "foo *bar"
#511: FILE: arch/xtensa/include/asm/cmpxchg.h:206:
+__arch_xchg(unsigned long x, volatile void * ptr, int size)
WARNING: Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst
#511: FILE: arch/xtensa/include/asm/cmpxchg.h:206:
+__arch_xchg(unsigned long x, volatile void * ptr, int size)
total: 18 errors, 14 warnings, 3 checks, 360 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.
Commit b7d27f8ecf7a ("arch: rename all internal names __xchg to __arch_xchg") has style problems, please review.
NOTE: Ignored message types: ALLOC_SIZEOF_STRUCT CAMELCASE COMMIT_LOG_LONG_LINE GIT_COMMIT_ID MACRO_ARG_REUSE NO_AUTHOR_SIGN_OFF
NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment