]> granicus.if.org Git - strace/commitdiff
Fix a few spacing style issues
authorDmitry V. Levin <ldv@altlinux.org>
Sat, 17 Jun 2017 22:23:09 +0000 (22:23 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sat, 17 Jun 2017 22:54:08 +0000 (22:54 +0000)
Reported by kernel's checkpatch.pl script.

103 files changed:
aio.c
block.c
bpf.c
btrfs.c
clone.c
configure.ac
defs.h
desc.c
dirent.c
dirent64.c
dm.c
evdev.c
fetch_struct_statfs.c
file_ioctl.c
gcc_compat.h
io.c
ioctlsort.c
kcmp.c
kexec.c
linux/aarch64/arch_regs.c
linux/arm/get_scno.c
linux/bfin/get_syscall_args.c
linux/personality.h
linux/sh64/arch_regs.h
linux/x86_64/get_scno.c
linux/x86_64/set_error.c
mem.c
msghdr.c
numa.c
open.c
or1k_atomic.c
perf.c
perf_event_struct.h
qualify.c
quota.c
resource.c
signal.c
socketutils.c
statx.h
strace.c
syscall.c
sysctl.c
test/clone.c
test/seccomp.c
test/threaded_execve.c
tests/add_key.c
tests/aio.c
tests/btrfs.c
tests/errno2name.c
tests/futex.c
tests/getcpu.c
tests/ioctl.c
tests/ioctl_sg_io_v3.c
tests/ioctl_sg_io_v4.c
tests/ioctl_sock_gifconf.c
tests/ioctl_uffdio.c
tests/ioctl_v4l2.c
tests/ip_mreq.c
tests/ipc_msgbuf.c
tests/ipc_sem.c
tests/ksysent.c
tests/mmsg_name.c
tests/mq.c
tests/mq_sendrecv.c
tests/msg_control.c
tests/net-y-unix.c
tests/net-yy-inet.c
tests/net-yy-unix.c
tests/nsyscalls.c
tests/perf_event_open.c
tests/ppoll.c
tests/print_quoted_string.c
tests/print_time.c
tests/process_vm_readv_writev.c
tests/pselect6.c
tests/ptrace.c
tests/quotactl-xfs.c
tests/readahead.c
tests/reboot.c
tests/request_key.c
tests/rt_sigqueueinfo.c
tests/rt_tgsigqueueinfo.c
tests/sched_get_priority_mxx.c
tests/seccomp-filter-v.c
tests/semop.c
tests/sigaction.c
tests/signal2name.c
tests/signal_receive.c
tests/stack-fcall.c
tests/statx.c
tests/times-fail.c
tests/times.c
tests/unix-pair-sendto-recvfrom.c
tests/waitid.c
tests/xselect.c
time.c
uid.c
unwind.c
util.c
v4l2.c
wait.c
xlat.c
xlat/nl_netfilter_subsys_ids.in

diff --git a/aio.c b/aio.c
index 5565d0c7289e6f419cb9dfd29b39dcd809f1fda6..7adb20df758a9d4ce7e88c85ae528aeef5778d00 100644 (file)
--- a/aio.c
+++ b/aio.c
@@ -167,9 +167,9 @@ print_iocbp(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
        struct iocb cb;
 
        if (elem_size < sizeof(kernel_ulong_t)) {
-               addr = * (unsigned int *) elem_buf;
+               addr = *(unsigned int *) elem_buf;
        } else {
-               addr = * (kernel_ulong_t *) elem_buf;
+               addr = *(kernel_ulong_t *) elem_buf;
        }
 
        tprints("{");
diff --git a/block.c b/block.c
index 4d1a965b40b59d83210047f2e308e9f2b7e944ac..c77b92ac66321e5660f60e6b6364933eba7e852c 100644 (file)
--- a/block.c
+++ b/block.c
@@ -67,7 +67,7 @@ typedef struct blk_user_trace_setup {
 #include MPERS_DEFS
 
 #ifndef BLKPG
-# define BLKPG      _IO(0x12,105)
+# define BLKPG      _IO(0x12, 105)
 #endif
 
 /*
@@ -80,40 +80,40 @@ typedef struct blk_user_trace_setup {
 # define BLKTRACESETUP _IOWR(0x12, 115, struct_blk_user_trace_setup)
 #endif
 #ifndef BLKTRACESTART
-# define BLKTRACESTART _IO(0x12,116)
+# define BLKTRACESTART _IO(0x12, 116)
 #endif
 #ifndef BLKTRACESTOP
-# define BLKTRACESTOP _IO(0x12,117)
+# define BLKTRACESTOP _IO(0x12, 117)
 #endif
 #ifndef BLKTRACETEARDOWN
-# define BLKTRACETEARDOWN _IO(0x12,118)
+# define BLKTRACETEARDOWN _IO(0x12, 118)
 #endif
 #ifndef BLKDISCARD
-# define BLKDISCARD _IO(0x12,119)
+# define BLKDISCARD _IO(0x12, 119)
 #endif
 #ifndef BLKIOMIN
-# define BLKIOMIN _IO(0x12,120)
+# define BLKIOMIN _IO(0x12, 120)
 #endif
 #ifndef BLKIOOPT
-# define BLKIOOPT _IO(0x12,121)
+# define BLKIOOPT _IO(0x12, 121)
 #endif
 #ifndef BLKALIGNOFF
-# define BLKALIGNOFF _IO(0x12,122)
+# define BLKALIGNOFF _IO(0x12, 122)
 #endif
 #ifndef BLKPBSZGET
-# define BLKPBSZGET _IO(0x12,123)
+# define BLKPBSZGET _IO(0x12, 123)
 #endif
 #ifndef BLKDISCARDZEROES
-# define BLKDISCARDZEROES _IO(0x12,124)
+# define BLKDISCARDZEROES _IO(0x12, 124)
 #endif
 #ifndef BLKSECDISCARD
-# define BLKSECDISCARD _IO(0x12,125)
+# define BLKSECDISCARD _IO(0x12, 125)
 #endif
 #ifndef BLKROTATIONAL
-# define BLKROTATIONAL _IO(0x12,126)
+# define BLKROTATIONAL _IO(0x12, 126)
 #endif
 #ifndef BLKZEROOUT
-# define BLKZEROOUT _IO(0x12,127)
+# define BLKZEROOUT _IO(0x12, 127)
 #endif
 
 #include "xlat/blkpg_ops.h"
diff --git a/bpf.c b/bpf.c
index 2c709e174415fe442918a3517facefdbdff74543..de909d300c1ac27619a4f830ce0a92a3970962b9 100644 (file)
--- a/bpf.c
+++ b/bpf.c
@@ -182,7 +182,7 @@ bpf_prog_load(struct tcb *const tcp, const kernel_ulong_t addr,
 
 static int
 bpf_obj_manage(struct tcb *const tcp, const kernel_ulong_t addr,
-               unsigned int size)
+              unsigned int size)
 {
        struct {
                uint64_t ATTRIBUTE_ALIGNED(8) pathname;
@@ -243,14 +243,14 @@ bpf_prog_attach_detach(struct tcb *const tcp, const kernel_ulong_t addr,
 
 static int
 bpf_prog_attach(struct tcb *const tcp, const kernel_ulong_t addr,
-               unsigned int size)
+               unsigned int size)
 {
        return bpf_prog_attach_detach(tcp, addr, size, true);
 }
 
 static int
 bpf_prog_detach(struct tcb *const tcp, const kernel_ulong_t addr,
-               unsigned int size)
+               unsigned int size)
 {
        return bpf_prog_attach_detach(tcp, addr, size, false);
 }
diff --git a/btrfs.c b/btrfs.c
index 141cafa323ae4fcb9269ecc5f9eb162ac58d8471..e730c7aac7a1e435de481419539524690304b7db 100644 (file)
--- a/btrfs.c
+++ b/btrfs.c
@@ -367,7 +367,7 @@ btrfs_print_ino_path_container(struct tcb *tcp,
 static bool
 print_uint64(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
 {
-       tprintf("%" PRIu64, * (uint64_t *) elem_buf);
+       tprintf("%" PRIu64, *(uint64_t *) elem_buf);
 
        return true;
 }
@@ -488,7 +488,7 @@ static bool
 print_objectid_callback(struct tcb *tcp, void *elem_buf,
                        size_t elem_size, void *data)
 {
-       btrfs_print_objectid(* (uint64_t *) elem_buf);
+       btrfs_print_objectid(*(uint64_t *) elem_buf);
 
        return true;
 }
@@ -679,12 +679,12 @@ MPERS_PRINTER_DECL(int, btrfs_ioctl,
                                   (uint64_t) args.start.srcdevid,
                                   (uint64_t) args.start.cont_reading_from_srcdev_mode);
 
-                               str = (const char*) args.start.srcdev_name;
+                               str = (const char *) args.start.srcdev_name;
                                print_quoted_string(str,
                                                sizeof(args.start.srcdev_name),
                                                QUOTE_0_TERMINATED);
                                tprints(", tgtdev_name=");
-                               str = (const char*) args.start.tgtdev_name;
+                               str = (const char *) args.start.tgtdev_name;
                                print_quoted_string(str,
                                                sizeof(args.start.tgtdev_name),
                                                QUOTE_0_TERMINATED);
diff --git a/clone.c b/clone.c
index a1c799a698625ea0a70bbf943eb58ca4ce091d27..a5f2b242e86926fec3e43faa14c4f5026ea4f1da 100644 (file)
--- a/clone.c
+++ b/clone.c
@@ -109,7 +109,7 @@ SYS_FUNC(clone)
                                tcp->u_arg[ARG_STACKSIZE]);
 #endif
                tprints("flags=");
-               if (!printflags64(clone_flags, flags &CSIGNAL, NULL))
+               if (!printflags64(clone_flags, flags & ~CSIGNAL, NULL))
                        sep = "";
                if ((flags & CSIGNAL) != 0)
                        tprintf("%s%s", sep, signame(flags & CSIGNAL));
index dc49d3974f4a6223f624637b7e59501282981f22..b4cf4cb2b491acd260205e736029ac849da8f0ec 100644 (file)
@@ -488,8 +488,8 @@ AC_CHECK_HEADERS([linux/btrfs.h], [
                struct btrfs_ioctl_search_args_v2.buf_size
                ]),,, [ #include <stdio.h>
 #include <linux/btrfs.h>])
-        AC_CHECK_DECLS(m4_normalize([BTRFS_COMPRESS_NONE, BTRFS_COMPRESS_ZLIB,
-                               BTRFS_COMPRESS_LZO]),,,[ #include <stdio.h>
+       AC_CHECK_DECLS(m4_normalize([BTRFS_COMPRESS_NONE, BTRFS_COMPRESS_ZLIB,
+                               BTRFS_COMPRESS_LZO]),,,[ #include <stdio.h>
 #include <linux/btrfs.h>])])
 
 AC_CHECK_DECLS([sys_errlist])
@@ -683,7 +683,7 @@ AC_CACHE_CHECK([for SIGRTMIN], [st_cv_SIGRTMIN],
               [[st_cv_SIGRTMIN="$(echo SIGRTMIN |
                        $CPP $CPPFLAGS -P -imacros asm/signal.h - |
                        grep '^[0-9]')"
-                test -n "$st_cv_SIGRTMIN" || st_cv_SIGRTMIN=no]])
+                test -n "$st_cv_SIGRTMIN" || st_cv_SIGRTMIN=no]])
 if test "x$st_cv_SIGRTMIN" != xno; then
        AC_DEFINE_UNQUOTED([ASM_SIGRTMIN], [$st_cv_SIGRTMIN],
                           [SIGRTMIN defined in <asm/signal.h>])
@@ -692,7 +692,7 @@ AC_CACHE_CHECK([for SA_RESTORER], [st_cv_SA_RESTORER],
               [st_cv_SA_RESTORER="$(echo SA_RESTORER |
                        $CPP $CPPFLAGS -P -imacros asm/signal.h - |
                        grep ^0x)"
-               test -n "$st_cv_SA_RESTORER" || st_cv_SA_RESTORER=no])
+               test -n "$st_cv_SA_RESTORER" || st_cv_SA_RESTORER=no])
 if test "x$st_cv_SA_RESTORER" != xno; then
        AC_DEFINE_UNQUOTED([ASM_SA_RESTORER], [$st_cv_SA_RESTORER],
                           [SA_RESTORER defined in <asm/signal.h>])
@@ -720,15 +720,15 @@ libunwind_CPPFLAGS=
 libunwind_LDFLAGS=
 libunwind_LIBS=
 AC_ARG_WITH([libunwind],
-            [AS_HELP_STRING([--with-libunwind],
-                            [use libunwind to implement stack tracing support])],
-            [case "${withval}" in
-             yes|no|check) ;;
-             *) with_libunwind=yes
-                libunwind_CPPFLAGS="-I${withval}/include"
-                libunwind_LDFLAGS="-L${withval}/lib" ;;
-             esac],
-            [with_libunwind=check]
+           [AS_HELP_STRING([--with-libunwind],
+                           [use libunwind to implement stack tracing support])],
+           [case "${withval}" in
+            yes|no|check) ;;
+            *) with_libunwind=yes
+               libunwind_CPPFLAGS="-I${withval}/include"
+               libunwind_LDFLAGS="-L${withval}/lib" ;;
+            esac],
+           [with_libunwind=check]
 )
 
 use_libunwind=no
@@ -737,56 +737,56 @@ AS_IF([test "x$with_libunwind" != xno],
        CPPFLAGS="$CPPFLAGS $libunwind_CPPFLAGS"
 
        AC_CHECK_HEADERS([libunwind-ptrace.h],
-         [saved_LDFLAGS="$LDFLAGS"
-          LDFLAGS="$LDFLAGS $libunwind_LDFLAGS"
-
-          AC_CHECK_LIB([unwind], [backtrace],
-            [libunwind_LIBS="-lunwind $libunwind_LIBS"
-
-             AC_MSG_CHECKING([for unw_create_addr_space in libunwind-generic])
-             saved_LIBS="$LIBS"
-             LIBS="-lunwind-generic $libunwind_LIBS $LIBS"
-
-             AC_LINK_IFELSE(
-               [AC_LANG_PROGRAM([[#include <libunwind-ptrace.h>]],
-                                [[return !unw_create_addr_space(0, 0)]])
-               ],
-               [AC_MSG_RESULT([yes])
-                libunwind_LIBS="-lunwind-generic $libunwind_LIBS"
-
-                AC_CHECK_LIB([unwind-ptrace], [_UPT_create],
-                  [libunwind_LIBS="-lunwind-ptrace $libunwind_LIBS"
-                   use_libunwind=yes
-                  ],
-                  [if test "x$with_libunwind" != xcheck; then
-                     AC_MSG_FAILURE([failed to find _UPT_create in libunwind-ptrace])
-                   fi
-                  ],
-                  [$libunwind_LIBS]
-                )
-               ],
-               [AC_MSG_RESULT([no])
-                if test "x$with_libunwind" != xcheck; then
-                  AC_MSG_FAILURE([failed to find unw_create_addr_space in libunwind-generic])
-                fi
-               ]
-             )
-
-             LIBS="$saved_LIBS"
-            ],
-            [if test "x$with_libunwind" != xcheck; then
-               AC_MSG_FAILURE([failed to find libunwind])
-             fi
-            ],
-            [$libunwind_LIBS]
-          )
-
-          LDFLAGS="$saved_LDFLAGS"
-         ],
-         [if test "x$with_libunwind" != xcheck; then
-            AC_MSG_FAILURE([failed to find libunwind-ptrace.h])
-          fi
-         ]
+        [saved_LDFLAGS="$LDFLAGS"
+         LDFLAGS="$LDFLAGS $libunwind_LDFLAGS"
+
+         AC_CHECK_LIB([unwind], [backtrace],
+           [libunwind_LIBS="-lunwind $libunwind_LIBS"
+
+            AC_MSG_CHECKING([for unw_create_addr_space in libunwind-generic])
+            saved_LIBS="$LIBS"
+            LIBS="-lunwind-generic $libunwind_LIBS $LIBS"
+
+            AC_LINK_IFELSE(
+              [AC_LANG_PROGRAM([[#include <libunwind-ptrace.h>]],
+                               [[return !unw_create_addr_space(0, 0)]])
+              ],
+              [AC_MSG_RESULT([yes])
+               libunwind_LIBS="-lunwind-generic $libunwind_LIBS"
+
+               AC_CHECK_LIB([unwind-ptrace], [_UPT_create],
+                 [libunwind_LIBS="-lunwind-ptrace $libunwind_LIBS"
+                  use_libunwind=yes
+                 ],
+                 [if test "x$with_libunwind" != xcheck; then
+                    AC_MSG_FAILURE([failed to find _UPT_create in libunwind-ptrace])
+                  fi
+                 ],
+                 [$libunwind_LIBS]
+               )
+              ],
+              [AC_MSG_RESULT([no])
+               if test "x$with_libunwind" != xcheck; then
+                 AC_MSG_FAILURE([failed to find unw_create_addr_space in libunwind-generic])
+               fi
+              ]
+            )
+
+            LIBS="$saved_LIBS"
+           ],
+           [if test "x$with_libunwind" != xcheck; then
+              AC_MSG_FAILURE([failed to find libunwind])
+            fi
+           ],
+           [$libunwind_LIBS]
+         )
+
+         LDFLAGS="$saved_LDFLAGS"
+        ],
+        [if test "x$with_libunwind" != xcheck; then
+           AC_MSG_FAILURE([failed to find libunwind-ptrace.h])
+         fi
+        ]
        )
 
        CPPFLAGS="$saved_CPPFLAGS"
diff --git a/defs.h b/defs.h
index 487e51bd2c75658bac1f7fa9cdac59da25ce00c4..d32e5cafe24a4f256c84cf92a71efc525ad04001 100644 (file)
--- a/defs.h
+++ b/defs.h
@@ -106,7 +106,7 @@ extern char *stpcpy(char *dst, const char *src);
  *
  * Make sure that all entries in all syscallent.h files have nargs <= MAX_ARGS!
  * linux/<ARCH>/syscallent*.h:
- *     all have nargs <= 6 except mips o32 which has nargs <= 7.
+ *     all have nargs <= 6 except mips o32 which has nargs <= 7.
  */
 #ifndef MAX_ARGS
 # ifdef LINUX_MIPSO32
@@ -234,11 +234,11 @@ struct tcb {
        struct timeval etime;   /* Syscall entry time */
 
 #ifdef USE_LIBUNWIND
-       struct UPT_infolibunwind_ui;
-       struct mmap_cache_tmmap_cache;
+       struct UPT_info *libunwind_ui;
+       struct mmap_cache_t *mmap_cache;
        unsigned int mmap_cache_size;
        unsigned int mmap_cache_generation;
-       struct queue_tqueue;
+       struct queue_t *queue;
 #endif
 };
 
@@ -383,7 +383,7 @@ extern unsigned ptrace_setoptions;
 extern unsigned max_strlen;
 extern unsigned os_release;
 #undef KERNEL_VERSION
-#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
+#define KERNEL_VERSION(a, b, c) (((a) << 16) + ((b) << 8) + (c))
 
 void error_msg(const char *fmt, ...) ATTRIBUTE_FORMAT((printf, 1, 2));
 void perror_msg(const char *fmt, ...) ATTRIBUTE_FORMAT((printf, 1, 2));
@@ -533,10 +533,10 @@ str_strip_prefix_len(const char *str, const char *prefix, size_t prefix_len)
 #define STR_STRIP_PREFIX(str, prefix)  \
        str_strip_prefix_len((str), (prefix), sizeof(prefix) - 1)
 
-#define QUOTE_0_TERMINATED                      0x01
-#define QUOTE_OMIT_LEADING_TRAILING_QUOTES      0x02
-#define QUOTE_OMIT_TRAILING_0                   0x08
-#define QUOTE_FORCE_HEX                         0x10
+#define QUOTE_0_TERMINATED                     0x01
+#define QUOTE_OMIT_LEADING_TRAILING_QUOTES     0x02
+#define QUOTE_OMIT_TRAILING_0                  0x08
+#define QUOTE_FORCE_HEX                                0x10
 
 extern int string_quote(const char *, char *, unsigned int, unsigned int);
 extern int print_quoted_string(const char *, unsigned int, unsigned int);
@@ -545,10 +545,10 @@ extern int print_quoted_string(const char *, unsigned int, unsigned int);
  * b refers to the higher numbered u_arg
  */
 #ifdef WORDS_BIGENDIAN
-# define ULONG_LONG(a,b) \
+# define ULONG_LONG(a, b) \
        ((unsigned long long)(unsigned)(b) | ((unsigned long long)(a)<<32))
 #else
-# define ULONG_LONG(a,b) \
+# define ULONG_LONG(a, b) \
        ((unsigned long long)(unsigned)(a) | ((unsigned long long)(b)<<32))
 #endif
 extern int getllval(struct tcb *, unsigned long long *, int);
diff --git a/desc.c b/desc.c
index d52afc43d2f7df176d965f87840983661a0f2712..52e58c86e95610952d3bdc554078e30e8b9ebadf 100644 (file)
--- a/desc.c
+++ b/desc.c
@@ -164,8 +164,7 @@ decode_select(struct tcb *const tcp, const kernel_ulong_t *const args,
                                                );
                                                first = 0;
                                                sep = ", ";
-                                       }
-                                       else {
+                                       } else {
                                                outptr += sprintf(outptr, " %u", j);
                                        }
                                }
index d413ed62b6b0f7670265b37a739ce372506c2da9..71963ec3e5607d1ba8bfae911b29a98bc81e3afb 100644 (file)
--- a/dirent.c
+++ b/dirent.c
@@ -133,7 +133,7 @@ SYS_FUNC(getdents)
                                d->d_reclen);
 
                        if (print_quoted_string(d->d_name, d_name_len,
-                                               QUOTE_0_TERMINATED) > 0) {
+                                               QUOTE_0_TERMINATED) > 0) {
                                tprints("...");
                        }
 
index e2a4253695ae731739b03303a5f338b69590db71..d54cb9e7bb7f896f3519916a4d99447816d31706 100644 (file)
@@ -106,7 +106,7 @@ SYS_FUNC(getdents64)
 
                        tprints(", d_name=");
                        if (print_quoted_string(d->d_name, d_name_len,
-                                               QUOTE_0_TERMINATED) > 0) {
+                                               QUOTE_0_TERMINATED) > 0) {
                                tprints("...");
                        }
 
diff --git a/dm.c b/dm.c
index 26dcb22601ed602e12292d5d0071cf50b1eaad4b..2413626461363a79f0d3bbb1a5b1e3cb5dbde1d7 100644 (file)
--- a/dm.c
+++ b/dm.c
@@ -374,7 +374,7 @@ misplaced:
 
 static void
 dm_decode_dm_target_msg(struct tcb *const tcp, const kernel_ulong_t addr,
-                       const struct dm_ioctl *const ioc)
+                       const struct dm_ioctl *const ioc)
 {
        if (ioc->data_start == ioc->data_size)
                return;
diff --git a/evdev.c b/evdev.c
index 6874551572151aa522e3ed6f71ef225350720a20..983bf1488681dc8f3ab01c412c66e87688d4370f 100644 (file)
--- a/evdev.c
+++ b/evdev.c
@@ -517,7 +517,7 @@ evdev_write_ioctl(struct tcb *const tcp, const unsigned int code,
 MPERS_PRINTER_DECL(int, evdev_ioctl, struct tcb *const tcp,
                   const unsigned int code, const kernel_ulong_t arg)
 {
-       switch(_IOC_DIR(code)) {
+       switch (_IOC_DIR(code)) {
                case _IOC_READ:
                        if (entering(tcp))
                                return 0;
index 454e5b4ec0ce33cf5a2fea272dd86cb91b28c7db..4fba0f75d790a328e1ea8e0b1661a8fc3524df82 100644 (file)
@@ -84,7 +84,7 @@ MPERS_PRINTER_DECL(bool, fetch_struct_statfs64,
 {
        struct_statfs64 b;
 
-        if (sizeof(b) != size
+       if (sizeof(b) != size
 #ifdef COMPAT_STATFS64_PADDED_SIZE
            && sizeof(b) != COMPAT_STATFS64_PADDED_SIZE
 #endif
index fec2f69b0bbd447125b3d8882e44976005e0c935..cc2378f63d1826b686f469516cc9d517f20eec09 100644 (file)
 #endif
 
 #ifndef FICLONE
-# define FICLONE         _IOW(0x94, 9, int)
+# define FICLONE       _IOW(0x94, 9, int)
 #endif
 
 #ifndef FICLONERANGE
-# define FICLONERANGE    _IOW(0x94, 13, struct file_clone_range)
+# define FICLONERANGE  _IOW(0x94, 13, struct file_clone_range)
 struct file_clone_range {
        int64_t src_fd;
        uint64_t src_offset;
@@ -50,7 +50,7 @@ struct file_clone_range {
 #endif
 
 #ifndef FIDEDUPERANGE
-# define FIDEDUPERANGE   _IOWR(0x94, 54, struct file_dedupe_range)
+# define FIDEDUPERANGE _IOWR(0x94, 54, struct file_dedupe_range)
 struct file_dedupe_range_info {
        int64_t dest_fd;        /* in - destination file */
        uint64_t dest_offset;   /* in - start of extent in destination */
index 08e8117342428c8821f8fc5f0eede5668c0f9fab..956aff1767c48cf8dc4ab42f220499bb0bed8475 100644 (file)
@@ -84,7 +84,7 @@
 #if GNUC_PREREQ(4, 1)
 # define ALIGNOF(t_)   __alignof__(t_)
 #else
-# define ALIGNOF(t_)   (sizeof(struct {char x_; t_ y_;}) - sizeof(t_))
+# define ALIGNOF(t_)   (sizeof(struct { char x_; t_ y_; }) - sizeof(t_))
 #endif
 
 #if GNUC_PREREQ(4, 3)
diff --git a/io.c b/io.c
index ba3ed4d5b579373dccc65cb13593331c3a75014a..9ce1cf554311f9817f084256c2953495643a73c3 100644 (file)
--- a/io.c
+++ b/io.c
@@ -70,7 +70,7 @@ print_iovec(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
        kernel_ulong_t iov_buf[2], len;
        struct print_iovec_config *c = data;
 
-        if (elem_size < sizeof(iov_buf)) {
+       if (elem_size < sizeof(iov_buf)) {
                iov_buf[0] = ((unsigned int *) elem_buf)[0];
                iov_buf[1] = ((unsigned int *) elem_buf)[1];
                iov = iov_buf;
@@ -118,8 +118,9 @@ tprint_iov_upto(struct tcb *const tcp, const kernel_ulong_t len,
                const kernel_ulong_t data_size)
 {
        kernel_ulong_t iov[2];
-       struct print_iovec_config config =
-               { .decode_iov = decode_iov, .data_size = data_size };
+       struct print_iovec_config config = {
+               .decode_iov = decode_iov, .data_size = data_size
+       };
 
        print_array(tcp, addr, len, iov, current_wordsize * 2,
                    umoven_or_printaddr_ignore_syserror, print_iovec, &config);
index 9bab978da15466cf93afafb3c8843e6c8b2d93fb..932c66713028524f4c398f680774a5974473c951 100644 (file)
@@ -56,7 +56,7 @@ is_prefix(const char *s1, const char *s2)
 }
 
 static int
-compare_name_info(const void* a, const void* b)
+compare_name_info(const void *a, const void *b)
 {
        int rc;
 
@@ -93,7 +93,7 @@ code(const struct ioctlent *e)
 }
 
 static int
-compare_code_name(const void* a, const void* b)
+compare_code_name(const void *a, const void *b)
 {
        unsigned int code1 = code((struct ioctlent *) a);
        unsigned int code2 = code((struct ioctlent *) b);
diff --git a/kcmp.c b/kcmp.c
index 8c0994bc77d03fe8c706c463618261e088b0a515..962952bd957fd7864a92f00b51a6e236f35ec6a0 100644 (file)
--- a/kcmp.c
+++ b/kcmp.c
@@ -40,7 +40,7 @@ SYS_FUNC(kcmp)
        tprintf("%d, %d, ", pid1, pid2);
        printxval(kcmp_types, type, "KCMP_???");
 
-       switch(type) {
+       switch (type) {
                case KCMP_FILE:
                        tprintf(", %u, %u", (unsigned) idx1, (unsigned) idx2);
                        break;
diff --git a/kexec.c b/kexec.c
index c11113d1f2f9a2dcfc5f39eeac6ed79ca65c36c8..8157cc904b7fedacf86b217582993779bcc408f3 100644 (file)
--- a/kexec.c
+++ b/kexec.c
@@ -44,7 +44,7 @@ print_seg(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
        const kernel_ulong_t *seg;
        kernel_ulong_t seg_buf[4];
 
-        if (elem_size < sizeof(seg_buf)) {
+       if (elem_size < sizeof(seg_buf)) {
                unsigned int i;
 
                for (i = 0; i < ARRAY_SIZE(seg_buf); ++i)
index 4ccb1f5bf6057dc396c8fe4b498c9641356978b2..5d805fb394205e7ec94277fe7bed3f285561d6aa 100644 (file)
@@ -1,31 +1,31 @@
 struct arm_pt_regs {
-        uint32_t uregs[18];
+       uint32_t uregs[18];
 };
-#define ARM_cpsr       uregs[16]
-#define ARM_pc         uregs[15]
-#define ARM_lr         uregs[14]
-#define ARM_sp         uregs[13]
-#define ARM_ip         uregs[12]
-#define ARM_fp         uregs[11]
-#define ARM_r10        uregs[10]
-#define ARM_r9         uregs[9]
-#define ARM_r8         uregs[8]
-#define ARM_r7         uregs[7]
-#define ARM_r6         uregs[6]
-#define ARM_r5         uregs[5]
-#define ARM_r4         uregs[4]
-#define ARM_r3         uregs[3]
-#define ARM_r2         uregs[2]
-#define ARM_r1         uregs[1]
-#define ARM_r0         uregs[0]
-#define ARM_ORIG_r0    uregs[17]
+#define ARM_cpsr       uregs[16]
+#define ARM_pc         uregs[15]
+#define ARM_lr         uregs[14]
+#define ARM_sp         uregs[13]
+#define ARM_ip         uregs[12]
+#define ARM_fp         uregs[11]
+#define ARM_r10                uregs[10]
+#define ARM_r9         uregs[9]
+#define ARM_r8         uregs[8]
+#define ARM_r7         uregs[7]
+#define ARM_r6         uregs[6]
+#define ARM_r5         uregs[5]
+#define ARM_r4         uregs[4]
+#define ARM_r3         uregs[3]
+#define ARM_r2         uregs[2]
+#define ARM_r1         uregs[1]
+#define ARM_r0         uregs[0]
+#define ARM_ORIG_r0    uregs[17]
 
 static union {
        struct user_pt_regs aarch64_r;
        struct arm_pt_regs  arm_r;
 } arm_regs_union;
-#define aarch64_regs arm_regs_union.aarch64_r
-#define arm_regs     arm_regs_union.arm_r
+#define aarch64_regs   arm_regs_union.aarch64_r
+#define arm_regs       arm_regs_union.arm_r
 
 uint64_t *const aarch64_sp_ptr = (uint64_t *) &aarch64_regs.sp;
 uint32_t *const arm_sp_ptr = &arm_regs.ARM_sp;
index 344078231f363fa207b614d48969634fd1197a6e..5f68069239e71887262b1d93aabea6825471ba90 100644 (file)
@@ -58,7 +58,7 @@ arch_get_scno(struct tcb *tcp)
                /* Fixup the syscall number */
                scno &= 0x000fffff;
        } else {
-       scno_in_r7:
+scno_in_r7:
                scno = arm_regs.ARM_r7;
        }
 #else /* __ARM_EABI__ || !ENABLE_ARM_OABI */
index 13d58bd7e45fdda06b438c05bdfde70737d34b88..69613d4e7fbf52cf2ba42b58b9d425f9d433cc93 100644 (file)
@@ -2,8 +2,9 @@
 static int
 get_syscall_args(struct tcb *tcp)
 {
-       static const int argreg[MAX_ARGS] =
-               { PT_R0, PT_R1, PT_R2, PT_R3, PT_R4, PT_R5 };
+       static const int argreg[MAX_ARGS] = {
+               PT_R0, PT_R1, PT_R2, PT_R3, PT_R4, PT_R5
+       };
        unsigned int i;
 
        for (i = 0; i < tcp->s_ent->nargs; ++i)
index 9971703ff114ca09b7b0eb33aa61a0ca121b2f93..09b35c650d337a49f0d578882ed41cb247648127 100644 (file)
@@ -8,8 +8,8 @@
  * These occupy the top three bytes.
  */
 enum {
-       UNAME26 =               0x0020000,
-       ADDR_NO_RANDOMIZE =     0x0040000,      /* disable randomization of VA space */
+       UNAME26 =               0x0020000,
+       ADDR_NO_RANDOMIZE =     0x0040000,      /* disable randomization of VA space */
        FDPIC_FUNCPTRS =        0x0080000,      /* userspace function ptrs point to descriptors
                                                 * (signal handling)
                                                 */
@@ -19,8 +19,8 @@ enum {
        ADDR_LIMIT_32BIT =      0x0800000,
        SHORT_INODE =           0x1000000,
        WHOLE_SECONDS =         0x2000000,
-       STICKY_TIMEOUTS =       0x4000000,
-       ADDR_LIMIT_3GB =        0x8000000,
+       STICKY_TIMEOUTS =       0x4000000,
+       ADDR_LIMIT_3GB =        0x8000000,
 };
 
 /*
index 7f64b4970e98ae292f76b28f093633742780b388..670cdb669ef5393bbd0e9aae01612a8f4342eaf8 100644 (file)
@@ -1,15 +1,15 @@
 /* SH64 Linux - this code assumes the following kernel API for system calls:
-        PC           Offset 0
-        System Call  Offset 16 (actually, (syscall no.) | (0x1n << 16),
-                     where n = no. of parameters.
-        Other regs   Offset 24+
+       PC           Offset 0
+       System Call  Offset 16 (actually, (syscall no.) | (0x1n << 16),
+                    where n = no. of parameters.
+       Other regs   Offset 24+
 
-        On entry:    R2-7 = parameters 1-6 (as many as necessary)
-        On return:   R9   = result.
+       On entry:    R2-7 = parameters 1-6 (as many as necessary)
+       On return:   R9   = result.
 */
 
 /* Offset for peeks of registers */
-#define REG_OFFSET         (24)
-#define REG_GENERAL(x)     (8*(x)+REG_OFFSET)
-#define REG_PC             (0*8)
-#define REG_SYSCALL        (2*8)
+#define REG_OFFSET     (24)
+#define REG_GENERAL(x) (8*(x)+REG_OFFSET)
+#define REG_PC         (0*8)
+#define REG_SYSCALL    (2*8)
index 2354fb200910470b1347c84a996b6419df785aff..687f8435c7a12109de17eb05e72944f61362b196 100644 (file)
@@ -57,7 +57,7 @@ arch_get_scno(struct tcb *tcp)
         * solely by looking at __X32_SYSCALL_BIT:
         * arch/x86/include/asm/compat.h::is_x32_task():
         * if (task_pt_regs(current)->orig_ax & __X32_SYSCALL_BIT)
-        *         return true;
+        *      return true;
         */
        if (x86_io.iov_len == sizeof(i386_regs)) {
                scno = i386_regs.orig_eax;
@@ -93,7 +93,9 @@ arch_get_scno(struct tcb *tcp)
         */
        scno = x86_64_regs.orig_rax;
        switch (x86_64_regs.cs) {
-               case 0x23: currpers = 1; break;
+               case 0x23:
+                       currpers = 1;
+                       break;
                case 0x33:
                        if (x86_64_regs.ds == 0x2b) {
                                currpers = 2;
@@ -123,9 +125,13 @@ arch_get_scno(struct tcb *tcp)
                perror_msg("ptrace_peektext failed");
        switch (call & 0xffff) {
                /* x86-64: syscall = 0x0f 0x05 */
-               case 0x050f: currpers = 0; break;
+               case 0x050f:
+                       currpers = 0;
+                       break;
                /* i386: int 0x80 = 0xcd 0x80 */
-               case 0x80cd: currpers = 1; break;
+               case 0x80cd:
+                       currpers = 1;
+                       break;
                default:
                        currpers = current_personality;
                        error_msg("Unknown syscall opcode (0x%04X) while "
index 123c8951743e0e3e95285a5aa0304904f90d9278..6c31bd86f47b3f82163f9da634cd6fc3d279ff0e 100644 (file)
@@ -10,13 +10,13 @@ static int
 arch_set_error(struct tcb *tcp)
 {
 #ifdef HAVE_GETREGS_OLD
-       x86_64_regs.rax = - (long long) tcp->u_error;
+       x86_64_regs.rax = -(long long) tcp->u_error;
        return upoke(tcp->pid, 8 * RAX, x86_64_regs.rax);
 #else
        if (x86_io.iov_len == sizeof(i386_regs))
                return i386_set_error(tcp);
 
-       x86_64_regs.rax = - (long long) tcp->u_error;
+       x86_64_regs.rax = -(long long) tcp->u_error;
        return set_regs(tcp->pid);
 #endif
 }
diff --git a/mem.c b/mem.c
index fb29ec14647cd5f621609b8d30d90d0d6cc6732f..00f5610d1ce09a34374d94eff74cecc1c1bd06a1 100644 (file)
--- a/mem.c
+++ b/mem.c
@@ -331,7 +331,7 @@ SYS_FUNC(remap_file_pages)
 static bool
 print_protmap_entry(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
 {
-       tprintf("%#08x", * (unsigned int *) elem_buf);
+       tprintf("%#08x", *(unsigned int *) elem_buf);
 
        return true;
 }
index b699f26b027ae5d09147f0014fe01e7e7e0dd456..d26386659732332575111745f25e89b3b3765eaf 100644 (file)
--- a/msghdr.c
+++ b/msghdr.c
@@ -329,7 +329,7 @@ decode_msg_control(struct tcb *const tcp, const kernel_ulong_t addr,
 
                print_cmsg_type_data(tcp, cmsg_level, cmsg_type,
                                     (const void *) (u.ptr + cmsg_size),
-                                    len > cmsg_size ? len - cmsg_size: 0);
+                                    len > cmsg_size ? len - cmsg_size : 0);
                tprints("}");
 
                if (len < cmsg_size) {
diff --git a/numa.c b/numa.c
index a4b28f4ad6117ec494f5c344ac9d882375f29806..7564d873361344ddfb65327f4aac0f630791a415 100644 (file)
--- a/numa.c
+++ b/numa.c
@@ -34,10 +34,10 @@ print_node(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
 {
        if (elem_size < sizeof(kernel_ulong_t)) {
                tprintf("%#0*x", (int) elem_size * 2 + 2,
-                       * (unsigned int *) elem_buf);
+                       *(unsigned int *) elem_buf);
        } else {
                tprintf("%#0*" PRI_klx, (int) elem_size * 2 + 2,
-                       * (kernel_ulong_t *) elem_buf);
+                       *(kernel_ulong_t *) elem_buf);
        }
 
        return true;
@@ -127,9 +127,9 @@ print_addr(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
        kernel_ulong_t addr;
 
        if (elem_size < sizeof(addr)) {
-               addr = * (unsigned int *) elem_buf;
+               addr = *(unsigned int *) elem_buf;
        } else {
-               addr = * (kernel_ulong_t *) elem_buf;
+               addr = *(kernel_ulong_t *) elem_buf;
        }
 
        printaddr(addr);
@@ -140,7 +140,7 @@ print_addr(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
 static bool
 print_status(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
 {
-       const int status = * (int *) elem_buf;
+       const int status = *(int *) elem_buf;
 
        if (status < 0 && (unsigned) -status < nerrnos)
                tprintf("-%s", errnoent[-status]);
@@ -153,7 +153,7 @@ print_status(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
 static bool
 print_int(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
 {
-       tprintf("%d", * (int *) elem_buf);
+       tprintf("%d", *(int *) elem_buf);
 
        return true;
 }
diff --git a/open.c b/open.c
index 222965b84694dfffd3ef95e011df2ee390517352..28222666d6e60111109e161dfe4caa61f734bd42 100644 (file)
--- a/open.c
+++ b/open.c
@@ -42,7 +42,7 @@
 #define O_ACCMODE 03
 
 #ifdef O_LARGEFILE
-# if O_LARGEFILE == 0          /* biarch platforms in 64-bit mode */
+# if O_LARGEFILE == 0          /* biarch platforms in 64-bit mode */
 #  undef O_LARGEFILE
 #  ifdef SPARC64
 #   define O_LARGEFILE 0x40000
@@ -56,7 +56,7 @@
 #include "xlat/open_mode_flags.h"
 
 #ifndef AT_FDCWD
-# define AT_FDCWD                -100
+# define AT_FDCWD      -100
 #endif
 
 /* The fd is an "int", so when decoding x86 on x86_64, we need to force sign
index fb6aff3d3d431e176861ea86ee426c67bf4bc349..738cc2eb776018cf815153413738231776353f47 100644 (file)
 
 #ifdef OR1K
 
-#define OR1K_ATOMIC_SWAP        1
-#define OR1K_ATOMIC_CMPXCHG     2
-#define OR1K_ATOMIC_XCHG        3
-#define OR1K_ATOMIC_ADD         4
-#define OR1K_ATOMIC_DECPOS      5
-#define OR1K_ATOMIC_AND         6
-#define OR1K_ATOMIC_OR          7
-#define OR1K_ATOMIC_UMAX        8
-#define OR1K_ATOMIC_UMIN        9
+#define OR1K_ATOMIC_SWAP       1
+#define OR1K_ATOMIC_CMPXCHG    2
+#define OR1K_ATOMIC_XCHG       3
+#define OR1K_ATOMIC_ADD                4
+#define OR1K_ATOMIC_DECPOS     5
+#define OR1K_ATOMIC_AND                6
+#define OR1K_ATOMIC_OR         7
+#define OR1K_ATOMIC_UMAX       8
+#define OR1K_ATOMIC_UMIN       9
 
 #include "xlat/atomic_ops.h"
 
 SYS_FUNC(or1k_atomic)
 {
        printxval64(atomic_ops, tcp->u_arg[0], "???");
-       switch(tcp->u_arg[0]) {
+       switch (tcp->u_arg[0]) {
        case OR1K_ATOMIC_SWAP:
                tprintf(", 0x%lx, 0x%lx", tcp->u_arg[1], tcp->u_arg[2]);
                break;
diff --git a/perf.c b/perf.c
index 98f2ae1a7fcb8a7e50daaf3fecbaf55e43b4ed40..6af0f42a1b09610164f86998602cb9401ee1c4cd 100644 (file)
--- a/perf.c
+++ b/perf.c
@@ -168,7 +168,7 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr)
 
                if (use_new_size > 0)
                        printxval(perf_attr_size, new_size,
-                                 "PERF_ATTR_SIZE_???");
+                                 "PERF_ATTR_SIZE_???");
                else
                        tprints("???");
        }
@@ -176,17 +176,17 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr)
        switch (attr->type) {
        case PERF_TYPE_HARDWARE:
                PRINT_XLAT(", config=", perf_hw_id, attr->config,
-                          "PERF_COUNT_HW_???");
+                          "PERF_COUNT_HW_???");
                break;
        case PERF_TYPE_SOFTWARE:
                PRINT_XLAT(", config=", perf_sw_ids, attr->config,
-                          "PERF_COUNT_SW_???");
+                          "PERF_COUNT_SW_???");
                break;
        case PERF_TYPE_TRACEPOINT:
                /*
                 * "The value to use in config can be obtained from under
-                * debugfs tracing/events/../../id if ftrace is enabled in the
-                 * kernel."
+                * debugfs tracing/events/../../id if ftrace is enabled
+                * in the kernel."
                 */
                tprintf(", config=%" PRIu64, attr->config);
                break;
@@ -196,9 +196,9 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr)
                 * (perf_hw_cache_op_result_id << 16)
                 */
                PRINT_XLAT(", config=", perf_hw_cache_id, attr->config & 0xFF,
-                          "PERF_COUNT_HW_CACHE_???");
+                          "PERF_COUNT_HW_CACHE_???");
                PRINT_XLAT("|", perf_hw_cache_op_id, (attr->config >> 8) & 0xFF,
-                          "PERF_COUNT_HW_CACHE_OP_???");
+                          "PERF_COUNT_HW_CACHE_OP_???");
                /*
                 * Current code (see set_ext_hw_attr in arch/x86/events/core.c,
                 * tile_map_cache_event in arch/tile/kernel/perf_event.c,
@@ -215,8 +215,8 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr)
                 * that cache result is 8 bits in size.
                 */
                PRINT_XLAT("<<8|", perf_hw_cache_op_result_id,
-                          (attr->config >> 16) & 0xFF,
-                          "PERF_COUNT_HW_CACHE_RESULT_???");
+                          (attr->config >> 16) & 0xFF,
+                          "PERF_COUNT_HW_CACHE_RESULT_???");
                tprints("<<16");
                if (attr->config >> 24) {
                        tprintf("|%#" PRIx64 "<<24", attr->config >> 24);
@@ -262,60 +262,60 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr)
                "PERF_FORMAT_???");
 
        tprintf(", disabled=%u"
-               ", inherit=%u"
-               ", pinned=%u"
-               ", exclusive=%u"
-               ", exclusive_user=%u"
-               ", exclude_kernel=%u"
-               ", exclude_hv=%u"
-               ", exclude_idle=%u"
-               ", mmap=%u"
-               ", comm=%u"
-               ", freq=%u"
-               ", inherit_stat=%u"
-               ", enable_on_exec=%u"
-               ", task=%u"
-               ", watermark=%u"
-               ", precise_ip=%u",
-               attr->disabled,
-               attr->inherit,
-               attr->pinned,
-               attr->exclusive,
-               attr->exclude_user,
-               attr->exclude_kernel,
-               attr->exclude_hv,
-               attr->exclude_idle,
-               attr->mmap,
-               attr->comm,
-               attr->freq,
-               attr->inherit_stat,
-               attr->enable_on_exec,
-               attr->task,
-               attr->watermark,
-               attr->precise_ip);
+               ", inherit=%u"
+               ", pinned=%u"
+               ", exclusive=%u"
+               ", exclusive_user=%u"
+               ", exclude_kernel=%u"
+               ", exclude_hv=%u"
+               ", exclude_idle=%u"
+               ", mmap=%u"
+               ", comm=%u"
+               ", freq=%u"
+               ", inherit_stat=%u"
+               ", enable_on_exec=%u"
+               ", task=%u"
+               ", watermark=%u"
+               ", precise_ip=%u",
+               attr->disabled,
+               attr->inherit,
+               attr->pinned,
+               attr->exclusive,
+               attr->exclude_user,
+               attr->exclude_kernel,
+               attr->exclude_hv,
+               attr->exclude_idle,
+               attr->mmap,
+               attr->comm,
+               attr->freq,
+               attr->inherit_stat,
+               attr->enable_on_exec,
+               attr->task,
+               attr->watermark,
+               attr->precise_ip);
        tprints_comment(precise_ip_desc[attr->precise_ip]);
        tprintf(", mmap_data=%u"
-               ", sample_id_all=%u"
-               ", exclude_host=%u"
-               ", exclude_guest=%u"
-               ", exclude_callchain_kernel=%u"
-               ", exclude_callchain_user=%u"
-               ", mmap2=%u"
-               ", comm_exec=%u"
-               ", use_clockid=%u"
-               ", context_switch=%u"
-               ", write_backward=%u",
-               attr->mmap_data,
-               attr->sample_id_all,
-               attr->exclude_host,
-               attr->exclude_guest,
-               attr->exclude_callchain_kernel,
-               attr->exclude_callchain_user,
-               attr->mmap2,
-               attr->comm_exec,
-               attr->use_clockid,
-               attr->context_switch,
-               attr->write_backward);
+               ", sample_id_all=%u"
+               ", exclude_host=%u"
+               ", exclude_guest=%u"
+               ", exclude_callchain_kernel=%u"
+               ", exclude_callchain_user=%u"
+               ", mmap2=%u"
+               ", comm_exec=%u"
+               ", use_clockid=%u"
+               ", context_switch=%u"
+               ", write_backward=%u",
+               attr->mmap_data,
+               attr->sample_id_all,
+               attr->exclude_host,
+               attr->exclude_guest,
+               attr->exclude_callchain_kernel,
+               attr->exclude_callchain_user,
+               attr->mmap2,
+               attr->comm_exec,
+               attr->use_clockid,
+               attr->context_switch,
+               attr->write_backward);
 
        /*
         * Print it only in case it is non-zero, since it may contain flags we
@@ -323,7 +323,7 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr)
         */
        if (attr->__reserved_1) {
                tprintf(", __reserved_1=%#" PRIx64,
-                       (uint64_t) attr->__reserved_1);
+                       (uint64_t) attr->__reserved_1);
                tprints_comment("Bits 63..28");
        }
 
@@ -335,10 +335,10 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr)
        if (attr->type == PERF_TYPE_BREAKPOINT)
                /* Any combination of R/W with X is deemed invalid */
                PRINT_XLAT(", bp_type=", hw_breakpoint_type, attr->bp_type,
-                          (attr->bp_type <=
-                                  (HW_BREAKPOINT_X | HW_BREAKPOINT_RW)) ?
-                                          "HW_BREAKPOINT_INVALID" :
-                                          "HW_BREAKPOINT_???");
+                          (attr->bp_type <=
+                                  (HW_BREAKPOINT_X | HW_BREAKPOINT_RW)) ?
+                                          "HW_BREAKPOINT_INVALID" :
+                                          "HW_BREAKPOINT_???");
 
        if (attr->type == PERF_TYPE_BREAKPOINT)
                tprintf(", bp_addr=%#" PRIx64, attr->bp_addr);
@@ -360,7 +360,7 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr)
        if (attr->sample_type & PERF_SAMPLE_BRANCH_STACK) {
                tprints(", branch_sample_type=");
                printflags64(perf_branch_sample_type, attr->branch_sample_type,
-                            "PERF_SAMPLE_BRANCH_???");
+                            "PERF_SAMPLE_BRANCH_???");
        }
 
        _PERF_CHECK_FIELD(sample_regs_user);
@@ -379,7 +379,7 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr)
         */
        if (attr->sample_type & PERF_SAMPLE_STACK_USER)
                tprintf(", sample_stack_user=%#" PRIx32,
-                       attr->sample_stack_user);
+                       attr->sample_stack_user);
 
        if (attr->use_clockid) {
                _PERF_CHECK_FIELD(clockid);
index 161f6383b0dc1fa6745211b2570cd4d015015cfa..b5a15bb5bcc8964edf153f049aacf1d6808a2f17 100644 (file)
@@ -13,34 +13,34 @@ struct perf_event_attr {
        };
        uint64_t sample_type;
        uint64_t read_format;
-       uint64_t disabled                 :1,
-                inherit                  :1,
-                pinned                   :1,
-                exclusive                :1,
-                exclude_user             :1,
-                exclude_kernel           :1,
-                exclude_hv               :1,
-                exclude_idle             :1,
-                mmap                     :1,
-                comm                     :1,
-                freq                     :1,
-                inherit_stat             :1,
-                enable_on_exec           :1,
-                task                     :1,
-                watermark                :1,
-                precise_ip               :2,
-                mmap_data                :1,
-                sample_id_all            :1,
-                exclude_host             :1,
-                exclude_guest            :1,
-                exclude_callchain_kernel :1,
-                exclude_callchain_user   :1,
-                mmap2                    :1,
-                comm_exec                :1,
-                use_clockid              :1,
-                context_switch           :1,
-                write_backward           :1,
-                __reserved_1             :36;
+       uint64_t disabled                       :1,
+                inherit                        :1,
+                pinned                         :1,
+                exclusive                      :1,
+                exclude_user                   :1,
+                exclude_kernel                 :1,
+                exclude_hv                     :1,
+                exclude_idle                   :1,
+                mmap                           :1,
+                comm                           :1,
+                freq                           :1,
+                inherit_stat                   :1,
+                enable_on_exec                 :1,
+                task                           :1,
+                watermark                      :1,
+                precise_ip                     :2,
+                mmap_data                      :1,
+                sample_id_all                  :1,
+                exclude_host                   :1,
+                exclude_guest                  :1,
+                exclude_callchain_kernel       :1,
+                exclude_callchain_user         :1,
+                mmap2                          :1,
+                comm_exec                      :1,
+                use_clockid                    :1,
+                context_switch                 :1,
+                write_backward                 :1,
+                __reserved_1                   :36;
        union {
                uint32_t wakeup_events;
                uint32_t wakeup_watermark;
index de1141d666da61e19f8be787fb9ed1398e2944ea..3df4805a46ae317f639f9096f5975e2dfce4597c 100644 (file)
--- a/qualify.c
+++ b/qualify.c
@@ -436,7 +436,7 @@ parse_inject_token(const char *const token, struct inject_opts *const fopts,
 
        if ((val = STR_STRIP_PREFIX(token, "when=")) != token) {
                /*
-                *      == 1+1
+                *      == 1+1
                 * F    == F+0
                 * F+   == F+1
                 * F+S
diff --git a/quota.c b/quota.c
index 19f391f763cb0ca34bafe9eb01cec8793b25c997..ef151662ac9a277ed917ed985244e30b0e01b139 100644 (file)
--- a/quota.c
+++ b/quota.c
@@ -55,8 +55,7 @@
  * leads to problems when it is used on 32-bit tracee which does not have such
  * padding.
  */
-struct if_dqblk
-{
+struct if_dqblk {
        uint64_t dqb_bhardlimit;
        uint64_t dqb_bsoftlimit;
        uint64_t dqb_curspace;
@@ -81,8 +80,7 @@ struct if_nextdqblk {
        uint32_t dqb_id;
 };
 
-struct xfs_dqblk
-{
+struct xfs_dqblk {
        int8_t  d_version;              /* version of this structure */
        int8_t  d_flags;                /* XFS_{USER,PROJ,GROUP}_QUOTA */
        uint16_t d_fieldmask;           /* field specifier */
@@ -107,23 +105,20 @@ struct xfs_dqblk
        char    d_padding4[8];          /* yet more padding */
 };
 
-struct if_dqinfo
-{
+struct if_dqinfo {
        uint64_t dqi_bgrace;
        uint64_t dqi_igrace;
        uint32_t dqi_flags;
        uint32_t dqi_valid;
 };
 
-typedef struct fs_qfilestat
-{
+typedef struct fs_qfilestat {
        uint64_t qfs_ino;       /* inode number */
        uint64_t qfs_nblks;     /* number of BBs 512-byte-blks */
        uint32_t qfs_nextents;  /* number of extents */
 } fs_qfilestat_t;
 
-struct xfs_dqstats
-{
+struct xfs_dqstats {
        int8_t  qs_version;             /* version number for future changes */
        uint16_t qs_flags;              /* XFS_QUOTA_{U,P,G}DQ_{ACCT,ENFD} */
        int8_t  qs_pad;                 /* unused */
index ab3675287c3a0aa525e23ddb41387f3e7975f307..27d653e690105d4ddee0da63c348611466d23be4 100644 (file)
@@ -120,8 +120,7 @@ SYS_FUNC(getrlimit)
        if (entering(tcp)) {
                printxval(resources, tcp->u_arg[0], "RLIMIT_???");
                tprints(", ");
-       }
-       else {
+       } else {
                decode_rlimit(tcp, tcp->u_arg[1]);
        }
        return 0;
@@ -157,8 +156,7 @@ SYS_FUNC(getrusage)
        if (entering(tcp)) {
                printxval(usagewho, tcp->u_arg[0], "RUSAGE_???");
                tprints(", ");
-       }
-       else
+       } else
                printrusage(tcp, tcp->u_arg[1]);
        return 0;
 }
@@ -169,8 +167,7 @@ SYS_FUNC(osf_getrusage)
        if (entering(tcp)) {
                printxval(usagewho, tcp->u_arg[0], "RUSAGE_???");
                tprints(", ");
-       }
-       else
+       } else
                printrusage32(tcp, tcp->u_arg[1]);
        return 0;
 }
index 79054c709e44ced129c49f32417f9c97ff9fc4f5..b14124e98330bb822e60c4f508f02d55d4f12a59 100644 (file)
--- a/signal.c
+++ b/signal.c
@@ -289,8 +289,7 @@ SYS_FUNC(ssetmask)
 {
        if (entering(tcp)) {
                tprint_old_sigmask_val("", (unsigned) tcp->u_arg[0]);
-       }
-       else if (!syserror(tcp)) {
+       } else if (!syserror(tcp)) {
                tcp->auxstr = sprint_old_sigmask_val("old mask ",
                                                     (unsigned) tcp->u_rval);
                return RVAL_HEX | RVAL_STR;
@@ -433,8 +432,7 @@ SYS_FUNC(osf_sigprocmask)
        if (entering(tcp)) {
                printxval(sigprocmaskcmds, tcp->u_arg[0], "SIG_???");
                tprintsigmask_val(", ", tcp->u_arg[1]);
-       }
-       else if (!syserror(tcp)) {
+       } else if (!syserror(tcp)) {
                tcp->auxstr = sprintsigmask_val("old mask ", tcp->u_rval);
                return RVAL_HEX | RVAL_STR;
        }
@@ -451,8 +449,7 @@ SYS_FUNC(sigprocmask)
                tprints(", ");
                print_sigset_addr_len(tcp, tcp->u_arg[1], current_wordsize);
                tprints(", ");
-       }
-       else {
+       } else {
                print_sigset_addr_len(tcp, tcp->u_arg[2], current_wordsize);
        }
        return 0;
@@ -493,8 +490,7 @@ SYS_FUNC(rt_sigprocmask)
                tprints(", ");
                print_sigset_addr_len(tcp, tcp->u_arg[1], tcp->u_arg[3]);
                tprints(", ");
-       }
-       else {
+       } else {
                print_sigset_addr_len(tcp, tcp->u_arg[2], tcp->u_arg[3]);
                tprintf(", %" PRI_klu, tcp->u_arg[3]);
        }
@@ -502,8 +498,7 @@ SYS_FUNC(rt_sigprocmask)
 }
 
 /* Structure describing the action to be taken when a signal arrives.  */
-struct new_sigaction
-{
+struct new_sigaction {
        /* sa_handler may be a libc #define, need to use other name: */
 #ifdef MIPS
        unsigned int sa_flags;
@@ -519,8 +514,7 @@ struct new_sigaction
        unsigned long sa_mask[NSIG / sizeof(long)];
 };
 /* Same for i386-on-x86_64 and similar cases */
-struct new_sigaction32
-{
+struct new_sigaction32 {
        uint32_t sa_handler__;
        uint32_t sa_flags;
 #if HAVE_SA_RESTORER
index 6486e2757b67adaa5396285aed226f32c7c64c3b..b93c98febeecd5e7871996719ab9913a4972695b 100644 (file)
@@ -147,7 +147,7 @@ inet_parse_response(const void *const data, const int data_len,
        if (diag_msg->idiag_inode != inode)
                return 0;
 
-       switch(diag_msg->idiag_family) {
+       switch (diag_msg->idiag_family) {
                case AF_INET:
                        addr_size = sizeof(struct in_addr);
                        text_size = INET_ADDRSTRLEN;
@@ -536,7 +536,7 @@ get_sockaddr_by_inode(struct tcb *const tcp, const int fd,
 /* Given an inode number of a socket, print out its protocol details.  */
 bool
 print_sockaddr_by_inode(struct tcb *const tcp, const int fd,
-                       const unsigned long inode)
+                       const unsigned long inode)
 {
        return print_sockaddr_by_inode_cached(inode) ? true :
                print_sockaddr_by_inode_uncached(inode, getfdproto(tcp, fd));
diff --git a/statx.h b/statx.h
index 203728704534b2f52606f09c5d1424c495e132be..bd5b0477992ef405fd4a749f7756b06d4b5c19c1 100644 (file)
--- a/statx.h
+++ b/statx.h
@@ -40,7 +40,7 @@ typedef struct {
        uint32_t stx_mask; /* What results were written [uncond] */
        uint32_t stx_blksize; /* Preferred general I/O size [uncond] */
        uint64_t stx_attributes; /* Flags conveying information about the file
-                                   [uncond] */
+                                   [uncond] */
 
        uint32_t stx_nlink; /* Number of hard links */
        uint32_t stx_uid; /* User ID of owner */
@@ -52,7 +52,7 @@ typedef struct {
        uint64_t stx_size; /* File size */
        uint64_t stx_blocks; /* Number of 512-byte blocks allocated */
        uint64_t stx_attributes_mask; /* Mask to show what's supported in
-                                        stx_attributes */
+                                        stx_attributes */
 
        struct_statx_timestamp stx_atime; /* Last access time */
        struct_statx_timestamp stx_btime; /* File creation time */
index 916d66b365d2b6aeabaf33dab81d49e5994dc94e..614ab9ec4c350a0aab8094b9b931efb6ce77a01d 100644 (file)
--- a/strace.c
+++ b/strace.c
@@ -89,12 +89,12 @@ static bool print_pid_pfx;
 
 /* -I n */
 enum {
-    INTR_NOT_SET        = 0,
-    INTR_ANYWHERE       = 1, /* don't block/ignore any signals */
-    INTR_WHILE_WAIT     = 2, /* block fatal signals while decoding syscall. default */
-    INTR_NEVER          = 3, /* block fatal signals. default if '-o FILE PROG' */
-    INTR_BLOCK_TSTP_TOO = 4, /* block fatal signals and SIGTSTP (^Z) */
-    NUM_INTR_OPTS
+       INTR_NOT_SET        = 0,
+       INTR_ANYWHERE       = 1, /* don't block/ignore any signals */
+       INTR_WHILE_WAIT     = 2, /* block fatal signals while decoding syscall. default */
+       INTR_NEVER          = 3, /* block fatal signals. default if '-o FILE PROG' */
+       INTR_BLOCK_TSTP_TOO = 4, /* block fatal signals and SIGTSTP (^Z) */
+       NUM_INTR_OPTS
 };
 static int opt_intr;
 /* We play with signal mask only if this mode is active: */
@@ -690,12 +690,10 @@ printleader(struct tcb *tcp)
                        tprintf("%6ld.%06ld ",
                                (long) dtv.tv_sec, (long) dtv.tv_usec);
                        otv = tv;
-               }
-               else if (tflag > 2) {
+               } else if (tflag > 2) {
                        tprintf("%ld.%06ld ",
                                (long) tv.tv_sec, (long) tv.tv_usec);
-               }
-               else {
+               } else {
                        time_t local = tv.tv_sec;
                        strftime(str, sizeof(str), "%T", localtime(&local));
                        if (tflag > 1)
@@ -919,8 +917,7 @@ detach(struct tcb *tcp)
                        goto wait_loop;
                if (errno != ESRCH)
                        perror_msg("detach: ptrace(PTRACE_INTERRUPT,%u)", tcp->pid);
-       }
-       else {
+       } else {
                error = my_tkill(tcp->pid, SIGSTOP);
                if (!error)
                        goto wait_loop;
@@ -1032,7 +1029,7 @@ process_opt_p_list(char *opt)
                 * pidof uses space as delim, pgrep uses newline. :(
                 */
                int pid;
-               char *delim = opt + strcspn(opt, ", \n\t");
+               char *delim = opt + strcspn(opt, "\n\t ,");
                char c = *delim;
 
                *delim = '\0';
@@ -1231,8 +1228,7 @@ exec_or_die(void)
                if (setreuid(run_uid, params->run_euid) < 0) {
                        perror_msg_and_die("setreuid");
                }
-       }
-       else if (geteuid() != 0)
+       } else if (geteuid() != 0)
                if (setreuid(run_uid, run_uid) < 0) {
                        perror_msg_and_die("setreuid");
                }
@@ -1364,15 +1360,13 @@ startup_child(char **argv)
                        if (colon) {
                                n = colon - path;
                                m = n + 1;
-                       }
-                       else
+                       } else
                                m = n = strlen(path);
                        if (n == 0) {
                                if (!getcwd(pathname, PATH_MAX))
                                        continue;
                                len = strlen(pathname);
-                       }
-                       else if (n > sizeof(pathname) - 1)
+                       } else if (n > sizeof(pathname) - 1)
                                continue;
                        else {
                                strncpy(pathname, path, n);
@@ -1466,8 +1460,7 @@ startup_child(char **argv)
                            | TCB_SKIP_DETACH_ON_FIRST_EXEC
                            | (NOMMU_SYSTEM ? 0 : (TCB_HIDE_LOG | post_attach_sigstop));
                newoutf(tcp);
-       }
-       else {
+       } else {
                /* With -D, we are *child* here, the tracee is our parent. */
                strace_child = strace_tracer_pid;
                strace_tracer_pid = getpid();
@@ -1582,12 +1575,12 @@ get_os_release(void)
                        error_msg_and_die("Bad OS release string: '%s'", u.release);
                /* Note: this open-codes KERNEL_VERSION(): */
                rel = (rel << 8) | atoi(p);
-               if (rel >= KERNEL_VERSION(1,0,0))
+               if (rel >= KERNEL_VERSION(1, 0, 0))
                        break;
                while (*p >= '0' && *p <= '9')
                        p++;
                if (*p != '.') {
-                       if (rel >= KERNEL_VERSION(0,1,0)) {
+                       if (rel >= KERNEL_VERSION(0, 1, 0)) {
                                /* "X.Y-something" means "X.Y.0" */
                                rel <<= 8;
                                break;
@@ -1847,8 +1840,7 @@ init(int argc, char *argv[])
                }
                run_uid = pent->pw_uid;
                run_gid = pent->pw_gid;
-       }
-       else {
+       } else {
                run_uid = getuid();
                run_gid = getgid();
        }
@@ -1885,8 +1877,7 @@ init(int argc, char *argv[])
                        if (followfork >= 2)
                                error_msg_and_help("piping the output and -ff are mutually exclusive");
                        shared_log = strace_popen(outfname + 1);
-               }
-               else if (followfork < 2)
+               } else if (followfork < 2)
                        shared_log = strace_fopen(outfname);
        } else {
                /* -ff without -o FILE is the same as single -f */
@@ -2563,7 +2554,7 @@ dispatch_event(enum trace_event ret, int *pstatus, siginfo_t *si)
                 * PTRACE_GETEVENTMSG returns old pid starting from Linux 3.0.
                 * On 2.6 and earlier, it can return garbage.
                 */
-               if (os_release >= KERNEL_VERSION(3,0,0))
+               if (os_release >= KERNEL_VERSION(3, 0, 0))
                        current_tcp = maybe_switch_tcbs(current_tcp, current_tcp->pid);
 
                if (detach_on_execve) {
index c78436b952235fdca5f6959ff1b9d987ba249370..02626c73e8fd6ec1185d4dacf4f0fb61af42b6e3 100644 (file)
--- a/syscall.c
+++ b/syscall.c
@@ -872,8 +872,7 @@ syscall_exiting_trace(struct tcb *tcp, struct timeval tv, int res)
                }
                if (syscall_tampered(tcp))
                        tprints(" (INJECTED)");
-       }
-       else if (!(sys_res & RVAL_NONE) && u_error) {
+       } else if (!(sys_res & RVAL_NONE) && u_error) {
                const char *u_error_str;
 
                switch (u_error) {
@@ -944,8 +943,7 @@ syscall_exiting_trace(struct tcb *tcp, struct timeval tv, int res)
                        tprints(" (INJECTED)");
                if ((sys_res & RVAL_STR) && tcp->auxstr)
                        tprintf(" (%s)", tcp->auxstr);
-       }
-       else {
+       } else {
                if (sys_res & RVAL_NONE)
                        tprints("= ?");
                else {
@@ -983,8 +981,7 @@ syscall_exiting_trace(struct tcb *tcp, struct timeval tv, int res)
                                if (show_fd_path) {
                                        tprints("= ");
                                        printfd(tcp, tcp->u_rval);
-                               }
-                               else
+                               } else
                                        tprintf("= %" PRI_kld, tcp->u_rval);
                                break;
                        default:
@@ -1325,5 +1322,5 @@ syscall_name(kernel_ulong_t scno)
        if (current_personality == X32_PERSONALITY_NUMBER)
                scno &= ~__X32_SYSCALL_BIT;
 #endif
-       return scno_is_valid(scno) ? sysent[scno].sys_name: NULL;
+       return scno_is_valid(scno) ? sysent[scno].sys_name : NULL;
 }
index 645941559637782116a53724e85bfda07535992e..176973a3cd24ac7d8c58820e470addf70a263ccd 100644 (file)
--- a/sysctl.c
+++ b/sysctl.c
@@ -155,7 +155,7 @@ SYS_FUNC(sysctl)
                default:
                        goto out;
                }
-       out:
+out:
                max_cnt = info.nlen;
                if (abbrev(tcp) && max_cnt > max_strlen)
                        max_cnt = max_strlen;
index bdce8b19b65fd8df697bd2061764acf91d3bf3f1..dd898a059c0cae2d50208258a19a93c995f2dc1f 100644 (file)
@@ -6,7 +6,7 @@
 #include <sched.h>
 #include <unistd.h>
 
-int child(voidarg)
+int child(void *arg)
 {
        write(1, "clone\n", 6);
        return 0;
index fac43b15fea5795aba373ed348db642eec764a1b..cc4f3ee979f8ddee68bd14323ab258c06c3bb7d7 100644 (file)
@@ -32,7 +32,7 @@
 
 static const struct sock_filter filter[] = {
        /* load architecture */
-       BPF_STMT(BPF_LD | BPF_W | BPF_ABS, (offsetof (struct seccomp_data, arch))),
+       BPF_STMT(BPF_LD | BPF_W | BPF_ABS, offsetof(struct seccomp_data, arch)),
        /* jump forward 1 instruction if architecture matches */
        BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, SECCOMP_ARCH, 1, 0),
        /* kill process */
index ca601735f0f7ddd447867c0474c72d5c35725816..f2b2bce4c9b69045e6660118cc374517d4aff7df 100644 (file)
@@ -56,10 +56,10 @@ extern int __clone2(int (*fn) (void *), void *child_stack_base,
 #define clone2 __clone2
 #elif defined(__metag__)
 #define clone2(func, stack_base, size, flags, arg...) \
-        clone(func, stack_base, flags, arg)
+       clone(func, stack_base, flags, arg)
 #else
 #define clone2(func, stack_base, size, flags, arg...) \
-        clone(func, (stack_base) + (size), flags, arg)
+       clone(func, (stack_base) + (size), flags, arg)
 #endif
 /* Direct calls to syscalls, avoiding libc wrappers */
 #define syscall_tgkill(pid, tid, sig) syscall(__NR_tgkill, (pid), (tid), (sig))
@@ -74,7 +74,8 @@ static int
 thread1(void *unused)
 {
        write(1, "1", 1);
-       for(;;) pause();
+       for (;;)
+               pause();
        return 0;
 }
 
@@ -89,7 +90,8 @@ thread2(void *unused)
        execl("/proc/self/exe", "exe", "exe", buf, NULL);
        /* So fall back to resolved name */
        execl(my_name, "exe", "exe", buf, NULL);
-       for(;;) pause();
+       for (;;)
+               pause();
        return 0;
 }
 
@@ -119,9 +121,14 @@ thread_leader(void)
 
        /* Various states leader can be while other thread execve's: */
        switch (leader_final_action % 3) {
-               case 0: syscall_exit(42); /* leader is dead */
-               case 1: for(;;) pause(); /* leader is in syscall */
-               default: for(;;) continue; /* leader is in userspace */
+               case 0:
+                       syscall_exit(42); /* leader is dead */
+               case 1:
+                       for (;;)
+                               pause(); /* leader is in syscall */
+               default:
+                       for (;;)
+                               continue; /* leader is in userspace */
        }
 }
 
@@ -143,5 +150,5 @@ main(int argc, char **argv)
        alarm(argv[1] ? atoi(argv[1]) : 1);
        thread_leader();
 
-        return 0;
+       return 0;
 }
index d2696f9bc310b500f5d56539a04df6dc9cb6a6c7..1de0cc3b5351b9b63b8c49737ef50aba8b360238 100644 (file)
@@ -70,8 +70,7 @@ main(void)
 {
        static const char unterminated1[] = { '\1', '\2', '\3', '\4', '\5' };
        static const char unterminated2[] = { '\6', '\7', '\10', '\11', '\12' };
-       static const char unterminated3[] =
-               { '\16', '\17', '\20', '\21', '\22' };
+       static const char unterminated3[] = { '\16', '\17', '\20', '\21', '\22' };
 
        char *bogus_type = tail_memdup(unterminated1, sizeof(unterminated1));
        char *bogus_desc = tail_memdup(unterminated2, sizeof(unterminated2));
index 677a02b533fec557612cc8cbb21262f266abe066..77b6c05d903663f2bf71c54696410ba1553a90ab 100644 (file)
@@ -240,9 +240,9 @@ main(void)
                perror_msg_and_skip("io_submit");
        printf("io_submit(%#lx, %u, ["
               "{data=%#" PRI__x64 ", pread, reqprio=11, fildes=0, "
-                      "buf=%p, nbytes=%u, offset=%" PRI__d64 "}, "
+               "buf=%p, nbytes=%u, offset=%" PRI__d64 "}, "
               "{data=%#" PRI__x64 ", pread, reqprio=22, fildes=0, "
-                      "buf=%p, nbytes=%u, offset=%" PRI__d64 "}"
+               "buf=%p, nbytes=%u, offset=%" PRI__d64 "}"
               "]) = %s\n",
               *ctx, nr,
               cb[0].aio_data, data0, sizeof_data0, cb[0].aio_offset,
@@ -317,18 +317,18 @@ main(void)
        printf("io_submit(%#lx, %ld, ["
               "{data=%#" PRI__x64 ", key=%u, %hu /* SUB_??? */, fildes=%d}, "
               "{key=%u, pwrite, reqprio=%hd, fildes=%d, str=NULL"
-                      ", nbytes=%" PRI__u64 ", offset=%" PRI__d64
+               ", nbytes=%" PRI__u64 ", offset=%" PRI__d64
 # ifdef IOCB_FLAG_RESFD
-                      ", resfd=%d, flags=%#x"
+               ", resfd=%d, flags=%#x"
 # endif
-                      "}, "
+               "}, "
               "{key=%u, pwrite, reqprio=%hd, fildes=%d, buf=%#" PRI__x64
-                      ", nbytes=%" PRI__u64 ", offset=%" PRI__d64 "}, "
+               ", nbytes=%" PRI__u64 ", offset=%" PRI__d64 "}, "
               "{key=%u, pwrite, reqprio=%hd, fildes=%d"
-                      ", str=\"\\0\\1\\2\\3%.28s\"..."
-                      ", nbytes=%" PRI__u64 ", offset=%" PRI__d64 "}, "
+               ", str=\"\\0\\1\\2\\3%.28s\"..."
+               ", nbytes=%" PRI__u64 ", offset=%" PRI__d64 "}, "
               "{key=%u, pwritev, reqprio=%hd, fildes=%d, buf=%#" PRI__x64
-                      ", nbytes=%" PRI__u64 ", offset=%" PRI__d64 "}"
+               ", nbytes=%" PRI__u64 ", offset=%" PRI__d64 "}"
               ", {NULL}, {%#lx}, %p]) = %s\n",
               *ctx, 1057L,
               cbv2[0].aio_data, cbv2[0].aio_key,
@@ -351,11 +351,11 @@ main(void)
                perror_msg_and_skip("io_submit");
        printf("io_submit(%#lx, %u, ["
               "{data=%#" PRI__x64 ", preadv, reqprio=%hd, fildes=0, "
-                      "iovec=[{iov_base=%p, iov_len=%u}"
-                      ", {iov_base=%p, iov_len=%u}], offset=%" PRI__d64 "}, "
+               "iovec=[{iov_base=%p, iov_len=%u}"
+               ", {iov_base=%p, iov_len=%u}], offset=%" PRI__d64 "}, "
               "{data=%#" PRI__x64 ", preadv, reqprio=%hd, fildes=0, "
-                      "iovec=[{iov_base=%p, iov_len=%u}"
-                      ", {iov_base=%p, iov_len=%u}], offset=%" PRI__d64 "}"
+               "iovec=[{iov_base=%p, iov_len=%u}"
+               ", {iov_base=%p, iov_len=%u}], offset=%" PRI__d64 "}"
               "]) = %s\n",
               *ctx, nr,
               cbv[0].aio_data, cbv[0].aio_reqprio,
index ff5feaad8d3eb83d5825bfdeb248c2cf9c1052d1..710d76307030e903edee9050be36a8c88b44e284 100644 (file)
@@ -75,10 +75,10 @@ const char uuid_reference_string[] = "01234567-89ab-cdef-fedc-ba9876543210";
 struct btrfs_ioctl_quota_rescan_args {
        uint64_t flags, progress, reserved[6];
 };
-# define BTRFS_IOC_QUOTA_RESCAN _IOW(BTRFS_IOCTL_MAGIC, 44, \
-                                       struct btrfs_ioctl_quota_rescan_args)
-# define BTRFS_IOC_QUOTA_RESCAN_STATUS _IOR(BTRFS_IOCTL_MAGIC, 45, \
-                                       struct btrfs_ioctl_quota_rescan_args)
+# define BTRFS_IOC_QUOTA_RESCAN                        \
+       _IOW(BTRFS_IOCTL_MAGIC, 44, struct btrfs_ioctl_quota_rescan_args)
+# define BTRFS_IOC_QUOTA_RESCAN_STATUS         \
+       _IOR(BTRFS_IOCTL_MAGIC, 45, struct btrfs_ioctl_quota_rescan_args)
 #endif
 
 #ifndef BTRFS_IOC_QUOTA_RESCAN_WAIT
@@ -86,30 +86,30 @@ struct btrfs_ioctl_quota_rescan_args {
 #endif
 
 #ifndef BTRFS_IOC_GET_FEATURES
-# define BTRFS_IOC_GET_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, \
-                                   struct btrfs_ioctl_feature_flags)
-# define BTRFS_IOC_SET_FEATURES _IOW(BTRFS_IOCTL_MAGIC, 57, \
-                                   struct btrfs_ioctl_feature_flags[2])
-# define BTRFS_IOC_GET_SUPPORTED_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, \
-                                   struct btrfs_ioctl_feature_flags[3])
+# define BTRFS_IOC_GET_FEATURES                        \
+       _IOR(BTRFS_IOCTL_MAGIC, 57, struct btrfs_ioctl_feature_flags)
+# define BTRFS_IOC_SET_FEATURES                        \
+       _IOW(BTRFS_IOCTL_MAGIC, 57, struct btrfs_ioctl_feature_flags[2])
+# define BTRFS_IOC_GET_SUPPORTED_FEATURES      \
+       _IOR(BTRFS_IOCTL_MAGIC, 57, struct btrfs_ioctl_feature_flags[3])
 #endif
 
 #ifndef HAVE_STRUCT_BTRFS_IOCTL_FEATURE_FLAGS_COMPAT_FLAGS
 struct btrfs_ioctl_feature_flags {
-        uint64_t compat_flags;
-        uint64_t compat_ro_flags;
-        uint64_t incompat_flags;
+       uint64_t compat_flags;
+       uint64_t compat_ro_flags;
+       uint64_t incompat_flags;
 };
 #endif
 
 #ifndef HAVE_STRUCT_BTRFS_IOCTL_DEFRAG_RANGE_ARGS_START
 struct btrfs_ioctl_defrag_range_args {
-        uint64_t start;
-        uint64_t len;
-        uint64_t flags;
-        uint32_t extent_thresh;
-        uint32_t compress_type;
-        uint32_t unused[4];
+       uint64_t start;
+       uint64_t len;
+       uint64_t flags;
+       uint32_t extent_thresh;
+       uint32_t compress_type;
+       uint32_t unused[4];
 };
 #endif
 
@@ -140,14 +140,14 @@ struct file_dedupe_range {
 #endif
 
 #ifndef BTRFS_IOC_TREE_SEARCH_V2
-# define BTRFS_IOC_TREE_SEARCH_V2 _IOWR(BTRFS_IOCTL_MAGIC, 17, \
-                                           struct btrfs_ioctl_search_args_v2)
+# define BTRFS_IOC_TREE_SEARCH_V2      \
+       _IOWR(BTRFS_IOCTL_MAGIC, 17, struct btrfs_ioctl_search_args_v2)
 struct btrfs_ioctl_search_args_v2 {
        struct btrfs_ioctl_search_key key; /* in/out - search parameters */
        uint64_t buf_size;                 /* in - size of buffer
                                            * out - on EOVERFLOW: needed size
                                            *       to store item */
-        uint64_t buf[0];                  /* out - found items */
+       uint64_t buf[0];                   /* out - found items */
 };
 #endif
 
index 4a176993b0c2e2c59a6929e7a1985b09c55be105..d481e2e8b1b25b045e26878318493cf06cabfc5a 100644 (file)
@@ -476,6 +476,7 @@ errno2name(void)
 #ifdef EXFULL
        CASE(EXFULL);
 #endif
-       default: perror_msg_and_fail("unknown errno %d", errno);
+       default:
+               perror_msg_and_fail("unknown errno %d", errno);
        }
 }
index 9a9ab664574346f0187e40be2ec378c9ad403da1..b75ab3398e9edab1255d8506c895c83daac81083 100644 (file)
@@ -254,7 +254,7 @@ main(int argc, char *argv[])
               zero_extend_signed_to_ull(tmout->tv_nsec), sprintrc(rc));
 
        CHECK_FUTEX_ENOSYS(uaddr,
-               FUTEX_CLOCK_REALTIME | FUTEX_PRIVATE_FLAG | FUTEX_WAIT ,
+               FUTEX_CLOCK_REALTIME | FUTEX_PRIVATE_FLAG | FUTEX_WAIT,
                VAL, tmout, uaddr2, 0, (rc == -1) && (errno == EAGAIN));
        printf("futex(%p, FUTEX_WAIT_PRIVATE|FUTEX_CLOCK_REALTIME, %u"
               ", {tv_sec=%lld, tv_nsec=%llu}) = %s\n",
@@ -612,7 +612,7 @@ main(int argc, char *argv[])
 
        CHECK_FUTEX_ENOSYS(uaddr + 1, FUTEX_PRIVATE_FLAG | FUTEX_UNLOCK_PI, VAL,
                tmout, uaddr2 + 1, VAL3, (rc == -1) && (errno == EFAULT));
-       printf("futex(%p, FUTEX_UNLOCK_PI_PRIVATE) = %s\n", uaddr +1,
+       printf("futex(%p, FUTEX_UNLOCK_PI_PRIVATE) = %s\n", uaddr + 1,
                sprintrc(rc));
 
        CHECK_INVALID_CLOCKRT(FUTEX_UNLOCK_PI, 0);
index 3cb49cb2933a22bef7866511ed983209790f00a1..2b1575353b2fb24d9dc35cb5a2419238e775c036 100644 (file)
@@ -41,16 +41,16 @@ int
 main(void)
 {
        unsigned *bogus_cpu =
-               (unsigned *) tail_alloc(sizeof(* bogus_cpu)) + 1;
+               (unsigned *) tail_alloc(sizeof(*bogus_cpu)) + 1;
        unsigned *bogus_node =
-               (unsigned *) tail_alloc(sizeof(* bogus_node)) + 1;
+               (unsigned *) tail_alloc(sizeof(*bogus_node)) + 1;
        unsigned *bogus_tcache =
-               (unsigned *) tail_alloc(sizeof(* bogus_tcache)) + 1;
+               (unsigned *) tail_alloc(sizeof(*bogus_tcache)) + 1;
 
        long res;
        TAIL_ALLOC_OBJECT_CONST_PTR(unsigned, cpu);
        TAIL_ALLOC_OBJECT_CONST_PTR(unsigned, node);
-       long * tcache = tail_alloc(128);
+       long *tcache = tail_alloc(128);
 
        res = syscall(__NR_getcpu, NULL, NULL, NULL);
        printf("getcpu(NULL, NULL, NULL) = %s\n", sprintrc(res));
index 5dc0864fd8afeb3ccc15e811fd3918f113c1901c..3c666b0d64ccb9e98aa55fe90722f98bb22ecb74 100644 (file)
@@ -54,7 +54,7 @@
  && defined EV_KEY
 
 int
-main(void )
+main(void)
 {
        uint64_t data = 0;
 
index 3808b20990181854ba85b62d64c72a0cec9c22ee..3385bca91ea992d76e9d875e3557a9fef5896c60 100644 (file)
@@ -198,12 +198,12 @@ main(void)
               sg_io->iovec_count,
               sg_io->dxfer_len,
               sg_io->timeout,
-              * (unsigned char *) (iov[0].iov_base + 0),
-              * (unsigned char *) (iov[0].iov_base + 1),
+              *(unsigned char *) (iov[0].iov_base + 0),
+              *(unsigned char *) (iov[0].iov_base + 1),
               (unsigned int) iov[0].iov_len,
-              * (unsigned char *) (iov[1].iov_base + 0),
-              * (unsigned char *) (iov[1].iov_base + 1),
-              * (unsigned char *) (iov[1].iov_base + 2),
+              *(unsigned char *) (iov[1].iov_base + 0),
+              *(unsigned char *) (iov[1].iov_base + 1),
+              *(unsigned char *) (iov[1].iov_base + 2),
               (unsigned int) iov[1].iov_len,
               sg_io->status,
               sg_io->masked_status,
@@ -248,12 +248,12 @@ main(void)
               sg_io->iovec_count,
               sg_io->dxfer_len,
               sg_io->timeout,
-              * (unsigned char *) (iov[0].iov_base + 0),
-              * (unsigned char *) (iov[0].iov_base + 1),
+              *(unsigned char *) (iov[0].iov_base + 0),
+              *(unsigned char *) (iov[0].iov_base + 1),
               (unsigned int) iov[0].iov_len,
-              * (unsigned char *) (iov[1].iov_base + 0),
-              * (unsigned char *) (iov[1].iov_base + 1),
-              * (unsigned char *) (iov[1].iov_base + 2),
+              *(unsigned char *) (iov[1].iov_base + 0),
+              *(unsigned char *) (iov[1].iov_base + 1),
+              *(unsigned char *) (iov[1].iov_base + 2),
               (unsigned int) iov[1].iov_len,
               sg_io->status,
               sg_io->masked_status,
@@ -300,10 +300,10 @@ main(void)
               sg_io->iovec_count,
               sg_io->dxfer_len,
               sg_io->timeout,
-              * (unsigned char *) (sg_io->dxferp + 0),
-              * (unsigned char *) (sg_io->dxferp + 1),
-              * (unsigned char *) (sg_io->dxferp + 2),
-              * (unsigned char *) (sg_io->dxferp + 3),
+              *(unsigned char *) (sg_io->dxferp + 0),
+              *(unsigned char *) (sg_io->dxferp + 1),
+              *(unsigned char *) (sg_io->dxferp + 2),
+              *(unsigned char *) (sg_io->dxferp + 3),
               sg_io->status,
               sg_io->masked_status,
               sg_io->msg_status,
@@ -348,11 +348,11 @@ main(void)
               sg_io->iovec_count,
               sg_io->dxfer_len,
               sg_io->timeout,
-              * (unsigned char *) (sg_io->dxferp + 0),
-              * (unsigned char *) (sg_io->dxferp + 1),
-              * (unsigned char *) (sg_io->dxferp + 2),
-              * (unsigned char *) (sg_io->dxferp + 0),
-              * (unsigned char *) (sg_io->dxferp + 1),
+              *(unsigned char *) (sg_io->dxferp + 0),
+              *(unsigned char *) (sg_io->dxferp + 1),
+              *(unsigned char *) (sg_io->dxferp + 2),
+              *(unsigned char *) (sg_io->dxferp + 0),
+              *(unsigned char *) (sg_io->dxferp + 1),
               sg_io->status,
               sg_io->masked_status,
               sg_io->msg_status,
@@ -394,9 +394,9 @@ main(void)
               sg_io->iovec_count,
               sg_io->dxfer_len,
               sg_io->timeout,
-              * (unsigned char *) (sg_io->dxferp + 0),
-              * (unsigned char *) (sg_io->dxferp + 1),
-              * (unsigned char *) (sg_io->dxferp + 2),
+              *(unsigned char *) (sg_io->dxferp + 0),
+              *(unsigned char *) (sg_io->dxferp + 1),
+              *(unsigned char *) (sg_io->dxferp + 2),
               sg_io->status,
               sg_io->masked_status,
               sg_io->msg_status,
index 9c1e9fa065f98878058d9612382b00884e631422..d2f7b72c58812f330a521ceb9b976ff34c8cbc03 100644 (file)
@@ -189,9 +189,9 @@ main(void)
               ", dout_resid=%d"
               ", generated_tag=%#" PRI__x64 "}) = -1 EBADF (%m)\n",
               sg_io->request_len,
-              * (unsigned char *) ((unsigned long) sg_io->request + 0),
-              * (unsigned char *) ((unsigned long) sg_io->request + 1),
-              * (unsigned char *) ((unsigned long) sg_io->request + 2),
+              *(unsigned char *) ((unsigned long) sg_io->request + 0),
+              *(unsigned char *) ((unsigned long) sg_io->request + 1),
+              *(unsigned char *) ((unsigned long) sg_io->request + 2),
               sg_io->request_tag,
               sg_io->request_attr,
               sg_io->request_priority,
@@ -201,22 +201,22 @@ main(void)
               sg_io->dout_xfer_len,
               sg_io->din_iovec_count,
               sg_io->din_xfer_len,
-              * (unsigned char *) (iov[0].iov_base + 0),
-              * (unsigned char *) (iov[0].iov_base + 1),
+              *(unsigned char *) (iov[0].iov_base + 0),
+              *(unsigned char *) (iov[0].iov_base + 1),
               (unsigned int) iov[0].iov_len,
-              * (unsigned char *) (iov[1].iov_base + 0),
-              * (unsigned char *) (iov[1].iov_base + 1),
-              * (unsigned char *) (iov[1].iov_base + 2),
+              *(unsigned char *) (iov[1].iov_base + 0),
+              *(unsigned char *) (iov[1].iov_base + 1),
+              *(unsigned char *) (iov[1].iov_base + 2),
               (unsigned int) iov[1].iov_len,
               sg_io->timeout,
               sg_io->usr_ptr,
               sg_io->response_len,
-              * (unsigned char *) ((unsigned long) sg_io->response + 0),
-              * (unsigned char *) ((unsigned long) sg_io->response + 1),
-              * (unsigned char *) ((unsigned long) sg_io->din_xferp + 0),
-              * (unsigned char *) ((unsigned long) sg_io->din_xferp + 1),
-              * (unsigned char *) ((unsigned long) sg_io->din_xferp + 2),
-              * (unsigned char *) ((unsigned long) sg_io->din_xferp + 3),
+              *(unsigned char *) ((unsigned long) sg_io->response + 0),
+              *(unsigned char *) ((unsigned long) sg_io->response + 1),
+              *(unsigned char *) ((unsigned long) sg_io->din_xferp + 0),
+              *(unsigned char *) ((unsigned long) sg_io->din_xferp + 1),
+              *(unsigned char *) ((unsigned long) sg_io->din_xferp + 2),
+              *(unsigned char *) ((unsigned long) sg_io->din_xferp + 3),
               sg_io->driver_status,
               sg_io->transport_status,
               sg_io->device_status,
index f81faef46505f5a57e95433f70b5556e385ca45f..efa55a3a14b67444fbcf1d3cbcb66a532c6e3f95 100644 (file)
@@ -105,7 +105,7 @@ print_ifconf(struct ifconf *ifc, int in_len, char *in_buf, long rc)
 static void
 gifconf_ioctl(int fd, struct ifconf *ifc, bool ifc_valid)
 {
-       const char * errstr;
+       const char *errstr;
        int in_len;
        char *in_buf;
        long rc;
index c98e4a0f0fd1bf45bde6e6708fe4fb8177302698..817e3c72c0b8c98c0920bfe8e410465c20da3774 100644 (file)
@@ -71,7 +71,7 @@ main(void)
        api_struct->features = 0;
        rc = ioctl(fd, UFFDIO_API, api_struct);
        printf("ioctl(%d, UFFDIO_API, {api=0xaa, features=0, "
-              "features.out=%#" PRIx64 ", " "ioctls=1<<_UFFDIO_REGISTER|"
+              "features.out=%#" PRIx64 ", ioctls=1<<_UFFDIO_REGISTER|"
               "1<<_UFFDIO_UNREGISTER|1<<_UFFDIO_API",
               fd, (uint64_t)api_struct->features);
        api_struct->ioctls &= ~(1ull<<_UFFDIO_REGISTER|
index f4ab65090ec8b7ab5afd3e004bf093736d8e4184..cc5dee6acce92a22188172165da581c45dbe3be2 100644 (file)
@@ -85,7 +85,7 @@ init_v4l2_format(struct v4l2_format *const f,
                f->fmt.pix_mp.pixelformat = magic;
                f->fmt.pix_mp.field = V4L2_FIELD_NONE;
                f->fmt.pix_mp.colorspace = V4L2_COLORSPACE_JPEG;
-               struct v4l2_plane_pix_formatcur_pix =
+               struct v4l2_plane_pix_format *cur_pix =
                       f->fmt.pix_mp.plane_fmt;
                for (i = 0;
                     i < ARRAY_SIZE(f->fmt.pix_mp.plane_fmt);
@@ -119,7 +119,7 @@ init_v4l2_format(struct v4l2_format *const f,
                f->fmt.win.clips[1].c.width = 0x9e3a6fb3;
                f->fmt.win.clips[1].c.height = 0x05617b76;
 
-               f->fmt.win.bitmap = (void*) -2UL;
+               f->fmt.win.bitmap = (void *) -2UL;
 #ifdef HAVE_STRUCT_V4L2_WINDOW_GLOBAL_ALPHA
                f->fmt.win.global_alpha = 0xce;
 #endif
@@ -168,8 +168,8 @@ init_v4l2_format(struct v4l2_format *const f,
 
 static void
 dprint_ioctl_v4l2(struct v4l2_format *const f,
-                 const charrequest, const unsigned int buf_type,
-                 const charbuf_type_string)
+                 const char *request, const unsigned int buf_type,
+                 const char *buf_type_string)
 {
        switch (buf_type) {
        case V4L2_BUF_TYPE_VIDEO_CAPTURE:
@@ -323,7 +323,7 @@ dprint_ioctl_v4l2(struct v4l2_format *const f,
        dprint_ioctl_v4l2((v4l2_format), (request), (buf_type), #buf_type)
 
 int
-main(void )
+main(void)
 {
        const unsigned int size = get_page_size();
        void *const page = tail_alloc(size);
@@ -688,7 +688,7 @@ main(void )
 
        TAIL_ALLOC_OBJECT_CONST_PTR(struct v4l2_tuner, p_tuner);
        p_tuner->index = 0x4fb6df39;
-       strcpy((char*)p_tuner->name, "cum tacent clamant");
+       strcpy((char *) p_tuner->name, "cum tacent clamant");
        p_tuner->type = V4L2_TUNER_RADIO;
        p_tuner->capability = V4L2_TUNER_CAP_LOW;
        p_tuner->rangelow = 0xa673bc29;
index e437ec435f190fe22bbdcdbe4a4bf4a2ecb70e9b..4bfe00f3c8c16b47f6899ea048e9bfec5dec0723 100644 (file)
@@ -101,7 +101,7 @@ main(void)
                                short_any[i].optval, 1);
                printf("setsockopt(0, %s, %s, \"\\%hho\", 1) = %s\n",
                       short_any[i].str_level, short_any[i].str_optname,
-                      * (unsigned char *) short_any[i].optval,
+                      *(unsigned char *) short_any[i].optval,
                       sprintrc(rc));
 
                rc = setsockopt(0, short_any[i].level, short_any[i].optname,
index 1c34494d83f8e777ae196b1a3524a9aaed5c7feb..9d149fa56cf0268ef3472019559e735968b73908 100644 (file)
@@ -45,7 +45,7 @@ cleanup(void)
 }
 
 int
-main (void)
+main(void)
 {
        const long mtype = 0xdefaced;
        struct {
index 0b730c1101b89386b91eed60a55077137f35d557..c8832726597e06c45ead1c062fe92b1486bfa74b 100644 (file)
 #include "xlat/resource_flags.h"
 
 union semun {
-       int              val;    /* Value for SETVAL */
-       struct semid_ds *buf;    /* Buffer for IPC_STAT, IPC_SET */
-       unsigned short  *array;  /* Array for GETALL, SETALL */
-       struct seminfo  *__buf;  /* Buffer for IPC_INFO
+       int              val;    /* Value for SETVAL */
+       struct semid_ds *buf;    /* Buffer for IPC_STAT, IPC_SET */
+       unsigned short  *array;  /* Array for GETALL, SETALL */
+       struct seminfo  *__buf;  /* Buffer for IPC_INFO
                                    (Linux-specific) */
 };
 
index f5986643bf11c21ef6491db45917e6c215d3d8e8..860e21e41e194943d26466c356f4d9f5a3d0f6c9 100644 (file)
@@ -53,7 +53,7 @@
 #define SI 0
 #define SE 0
 #define CST 0
-#define SEN(arg) 0,0
+#define SEN(arg) 0, 0
 
 static const struct_sysent syscallent[] = {
 #include "syscallent.h"
index a7a55c55a5549bc062bdb614fe9fbb141a4781f3..ac8dcde7ec573085237e0e0dc29cf726acbdef64 100644 (file)
@@ -77,7 +77,7 @@ print_msghdr(const struct msghdr *const msg, const int user_msg_namelen)
        }
        printf("%d, msg_iov=[{iov_base=\"%c\", iov_len=1}]"
               ", msg_iovlen=1, msg_controllen=0, msg_flags=0}",
-              (int) msg->msg_namelen, * (char *) msg->msg_iov[0].iov_base);
+              (int) msg->msg_namelen, *(char *) msg->msg_iov[0].iov_base);
 }
 
 static void
index ee2d059db5da8f6a9d9c0b6d5cdb78f7e488a69c..cf1b7308f5944ff27eb3d893f271ee8f51bcf9ff 100644 (file)
@@ -39,7 +39,7 @@
 # include <sys/stat.h>
 
 int
-main (void)
+main(void)
 {
        struct mq_attr attr;
        (void) close(0);
index f4f9e67d81641b4a379e4b62e73ac0098ab11f78..f6f6bd29948babdbbda9888e76d6ecb3dd5ac4bb 100644 (file)
@@ -437,7 +437,7 @@ main(void)
        bogus_attrs[1] = 2;
        bogus_attrs[2] = MSG_SIZE;
        fd = rc = syscall(__NR_mq_open, mq_name,
-                         O_CREAT|O_RDWR|O_NONBLOCK, S_IRWXU, bogus_attrs);
+                         O_CREAT|O_RDWR|O_NONBLOCK, S_IRWXU, bogus_attrs);
        errstr = sprintrc(rc);
        if (rc < 0)
                perror_msg_and_skip("mq_open");
index fab519a8df0ba96403dd6ebd57fd9f61fa23c9be..5b6b25a5d16f29ea23c7d4b3838efa8de732174b 100644 (file)
@@ -536,7 +536,7 @@ test_sol_socket(struct msghdr *const mh, void *const page)
 
 static void
 test_ip_pktinfo(struct msghdr *const mh, void *const page,
-               const int cmsg_type, const char *const cmsg_type_str)
+               const int cmsg_type, const char *const cmsg_type_str)
 {
        const unsigned int len = CMSG_SPACE(sizeof(struct in_pktinfo));
        struct cmsghdr *const cmsg = get_cmsghdr(page, len);
@@ -601,7 +601,7 @@ test_ip_uint(struct msghdr *const mh, void *const page,
 
 static void
 test_ip_uint8_t(struct msghdr *const mh, void *const page,
-               const int cmsg_type, const char *const cmsg_type_str)
+               const int cmsg_type, const char *const cmsg_type_str)
 {
        const unsigned int len = CMSG_SPACE(1);
        struct cmsghdr *const cmsg = get_cmsghdr(page, len);
@@ -683,7 +683,7 @@ struct sock_ee {
 
 static void
 test_ip_recverr(struct msghdr *const mh, void *const page,
-               const int cmsg_type, const char *const cmsg_type_str)
+               const int cmsg_type, const char *const cmsg_type_str)
 {
        const unsigned int len = CMSG_SPACE(sizeof(struct sock_ee));
        struct cmsghdr *const cmsg = get_cmsghdr(page, len);
index df56ad640a54a0924280b06bdae65fcb4bade2ce..fbdf590063a5e90d6d94f982b2c14a7908d260fd 100644 (file)
@@ -182,7 +182,7 @@ main(void)
                perror_msg_and_fail("accept");
        accept_inode = inode_of_sockfd(accept_fd);
        const char * const sun_path1 =
-               ((struct sockaddr_un *) accept_sa) -> sun_path + 1;
+               ((struct sockaddr_un *) accept_sa)->sun_path + 1;
        printf("accept(%d<socket:[%lu]>, {sa_family=AF_UNIX"
               ", sun_path=@\"%s\"}, [%d->%d]) = %d<socket:[%lu]>\n",
               listen_fd, listen_inode, sun_path1,
index af1262eec2d9f5b4c782f09dd196405ebe107115..c043920d13c186a32539c08a91250906d6395d35 100644 (file)
@@ -74,7 +74,7 @@ main(void)
        if (getsockname(listen_fd, listen_sa, len))
                perror_msg_and_fail("getsockname");
        const unsigned int listen_port =
-               ntohs(((struct sockaddr_in *) listen_sa) -> sin_port);
+               ntohs(((struct sockaddr_in *) listen_sa)->sin_port);
        printf("getsockname(%d<TCP:[127.0.0.1:%u]>, {sa_family=AF_INET"
               ", sin_port=htons(%u), sin_addr=inet_addr(\"127.0.0.1\")}"
               ", [%u]) = 0\n",
@@ -109,7 +109,7 @@ main(void)
        if (accept_fd < 0)
                perror_msg_and_fail("accept");
        const unsigned int connect_port =
-               ntohs(((struct sockaddr_in *) accept_sa) -> sin_port);
+               ntohs(((struct sockaddr_in *) accept_sa)->sin_port);
        printf("accept(%d<TCP:[127.0.0.1:%u]>, {sa_family=AF_INET"
               ", sin_port=htons(%u), sin_addr=inet_addr(\"127.0.0.1\")}"
               ", [%u]) = %d<TCP:[127.0.0.1:%u->127.0.0.1:%u]>\n",
index f27cdc0794255e40b1032c9dc02a863f4f92f817..21822db9f7a9d2aabe9bf32fd2a5d93794c39857 100644 (file)
@@ -185,7 +185,7 @@ main(void)
                perror_msg_and_fail("accept");
        accept_inode = inode_of_sockfd(accept_fd);
        const char * const sun_path1 =
-               ((struct sockaddr_un *) accept_sa) -> sun_path + 1;
+               ((struct sockaddr_un *) accept_sa)->sun_path + 1;
        printf("accept(%d<UNIX:[%lu,\"%s\"]>, {sa_family=AF_UNIX"
               ", sun_path=@\"%s\"}, [%d->%d]) = %d<UNIX:[%lu->%lu,\"%s\"]>\n",
               listen_fd, listen_inode, TEST_SOCKET, sun_path1,
index 7fda5ba1bc7770ae3c03276cf4a8b1a732f3b84f..d6b989c48b846411d8d04099fa4ff17037834de4 100644 (file)
@@ -54,7 +54,7 @@
 #define SI 0
 #define SE 0
 #define CST 0
-#define SEN(arg) 0,0
+#define SEN(arg) 0, 0
 
 static const struct_sysent syscallent[] = {
 #include "syscallent.h"
index b57c9cf368f13c0b18f2f178476341a7f17ba7c8..74ff9527e20fb2cb614e884c9bfa77799889a850 100644 (file)
@@ -75,34 +75,34 @@ struct u64_val_str {
 
 /* In order to avoid endianness-specific hackery. */
 struct pea_flags {
-       uint64_t disabled                 :1,
-                inherit                  :1,
-                pinned                   :1,
-                exclusive                :1,
-                exclude_user             :1,
-                exclude_kernel           :1,
-                exclude_hv               :1,
-                exclude_idle             :1,
-                mmap                     :1,
-                comm                     :1,
-                freq                     :1,
-                inherit_stat             :1,
-                enable_on_exec           :1,
-                task                     :1,
-                watermark                :1,
-                precise_ip               :2,
-                mmap_data                :1,
-                sample_id_all            :1,
-                exclude_host             :1,
-                exclude_guest            :1,
-                exclude_callchain_kernel :1,
-                exclude_callchain_user   :1,
-                mmap2                    :1,
-                comm_exec                :1,
-                use_clockid              :1,
-                context_switch           :1,
-                write_backward           :1,
-                __reserved_1             :36;
+       uint64_t disabled                       :1,
+                inherit                        :1,
+                pinned                         :1,
+                exclusive                      :1,
+                exclude_user                   :1,
+                exclude_kernel                 :1,
+                exclude_hv                     :1,
+                exclude_idle                   :1,
+                mmap                           :1,
+                comm                           :1,
+                freq                           :1,
+                inherit_stat                   :1,
+                enable_on_exec                 :1,
+                task                           :1,
+                watermark                      :1,
+                precise_ip                     :2,
+                mmap_data                      :1,
+                sample_id_all                  :1,
+                exclude_host                   :1,
+                exclude_guest                  :1,
+                exclude_callchain_kernel       :1,
+                exclude_callchain_user         :1,
+                mmap2                          :1,
+                comm_exec                      :1,
+                use_clockid                    :1,
+                context_switch                 :1,
+                write_backward                 :1,
+                __reserved_1                   :36;
 };
 
 static const char *
@@ -458,7 +458,7 @@ print_event_attr(struct perf_event_attr *attr_ptr, size_t size,
 
        /* End of version 4 of the structure */
        if (size <= 104) {
-               cutoff =104;
+               cutoff = 104;
                goto end;
        }
 
@@ -471,7 +471,7 @@ print_event_attr(struct perf_event_attr *attr_ptr, size_t size,
        printf(", aux_watermark=%" PRIu32, (uint32_t) val);
 
        if (size <= 108) {
-               cutoff =108;
+               cutoff = 108;
                goto end;
        }
 
@@ -484,7 +484,7 @@ print_event_attr(struct perf_event_attr *attr_ptr, size_t size,
        printf(", sample_max_stack=%" PRIu16, (uint16_t) val);
 
        if (size <= 110) {
-               cutoff =110;
+               cutoff = 110;
                goto end;
        }
 
@@ -718,7 +718,7 @@ main(void)
 
        for (i = 0; i < ARRAY_SIZE(args); i++) {
                rc = syscall(__NR_perf_event_open, args[i].attr, args[i].pid,
-                            args[i].cpu, args[i].group_fd, args[i].flags);
+                            args[i].cpu, args[i].group_fd, args[i].flags);
                printf("perf_event_open(%s, %d, %d, %d, %s) = %s\n",
                       printaddr(args[i].attr), args[i].pid, args[i].cpu,
                       args[i].group_fd, args[i].flags_str, sprintrc(rc));
@@ -793,19 +793,19 @@ main(void)
                        attr->size = 0;
 
                rc = syscall(__NR_perf_event_open, attr, args[args_idx].pid,
-                            args[args_idx].cpu, args[args_idx].group_fd,
-                            args[args_idx].flags);
+                            args[args_idx].cpu, args[args_idx].group_fd,
+                            args[args_idx].flags);
 
                printf("perf_event_open(");
                print_event_attr(attr, i ? ((i == 1) ? 0 : size) : size + 8,
-                                attr_types[type_idx].str,
-                                attr_configs[type_idx][config_idx].str,
-                                sample_types[sample_type_idx].str,
-                                read_formats[read_format_idx].str,
-                                ip_desc_str,
-                                bp_types[bp_type_idx].str,
-                                branch_sample_types[branch_sample_type_idx].str,
-                                clockids[clockid_idx].str, size);
+                                attr_types[type_idx].str,
+                                attr_configs[type_idx][config_idx].str,
+                                sample_types[sample_type_idx].str,
+                                read_formats[read_format_idx].str,
+                                ip_desc_str,
+                                bp_types[bp_type_idx].str,
+                                branch_sample_types[branch_sample_type_idx].str,
+                                clockids[clockid_idx].str, size);
                printf(", %d, %d, %d, %s) = %s\n", args[args_idx].pid,
                       args[args_idx].cpu, args[args_idx].group_fd,
                       args[args_idx].flags_str, sprintrc(rc));
index 85a7e0c006ba7b7747a96736bf8dcd8f60dbe2ba..6224183923aa47240d46bbbdbaa190ce869a2f64 100644 (file)
@@ -138,9 +138,10 @@ main(void)
 #if VERBOSE
               pipe_fd[2], pipe_fd[3],
 #endif
-              (unsigned) ARRAY_SIZE(fds1), USR2_CHLD_str,
-              (unsigned) sigset_size, rc, pipe_fd[1], POLLWRNORM_str,
-              pipe_fd[3], (unsigned ) ts->tv_sec, (unsigned) ts->tv_nsec);
+              (unsigned int) ARRAY_SIZE(fds1), USR2_CHLD_str,
+              (unsigned int) sigset_size, rc, pipe_fd[1], POLLWRNORM_str,
+              pipe_fd[3], (unsigned int) ts->tv_sec,
+              (unsigned int) ts->tv_nsec);
 
        ts->tv_sec = 0;
        ts->tv_nsec = 999;
index 3ad86024c228cc2ee598f5bdf17bae75331e7e8f..732fe3deb7e5f1b96f3b848873b2ee5a135877f3 100644 (file)
@@ -18,7 +18,7 @@ print_quoted_string(const char *instr)
 void
 print_quoted_memory(const char *instr, const size_t len)
 {
-       const unsigned char *str = (const unsigned char*) instr;
+       const unsigned char *str = (const unsigned char *) instr;
        size_t i;
 
        for (i = 0; i < len; ++i) {
index 429232960313f6e4bb710954e19b0e0f8d8a245c..e25924283f395eb4f2c9b852f2359d8ef6dbaea4 100644 (file)
@@ -58,8 +58,6 @@ print_time_t_ex(const time_t t, const unsigned long long part_sec,
 
        if (comment)
                fputs(" */", stdout);
-
-       return;
 }
 
 void
index 2a089395abcd25d75918957d2e096fd62568e293..c0f9c312ca084dd6a3888fb67ce6265f56c9b1b7 100644 (file)
@@ -51,7 +51,7 @@ enum { MAX_SEGM_COUNT = 2, MAX_STR_LEN = 5 };
 struct print_iov_arg {
        uint32_t count;
        uint32_t valid    :1,
-                string   :1,
+                string   :1,
                 addr_term:1,
                 check_rc :1;
        uint32_t str_segms;
@@ -247,14 +247,15 @@ main(void)
                2, {SEGM1_BASE, SEGM2_BASE}, {SIZE_1, SIZE_2} };
        struct print_iov_arg rmt_arg     = { ARRAY_SIZE(rmt_iovec), 1 };
 
-       struct print_iov_arg bogus_arg_cut =
-               { ARRAY_SIZE(bogus_iovec) - 2, 1, 0, 1 };
-       struct print_iov_arg lcl_arg_cut =
-               { ARRAY_SIZE(lcl_iovec) - 2, 1, 1, 1, 0, 2,
-                       {SEGM1_BASE + SIZE_11 + SIZE_12, SEGM2_BASE},
-                       {SIZE_13, SIZE_2} };
-       struct print_iov_arg rmt_arg_cut =
-               { ARRAY_SIZE(rmt_iovec) - 2, 1 };
+       struct print_iov_arg bogus_arg_cut = {
+               ARRAY_SIZE(bogus_iovec) - 2, 1, 0, 1
+       };
+       struct print_iov_arg lcl_arg_cut = {
+               ARRAY_SIZE(lcl_iovec) - 2, 1, 1, 1, 0, 2,
+               { SEGM1_BASE + SIZE_11 + SIZE_12, SEGM2_BASE },
+               {SIZE_13, SIZE_2}
+       };
+       struct print_iov_arg rmt_arg_cut = { ARRAY_SIZE(rmt_iovec) - 2, 1 };
 
 
        fill_memory_ex(data1_out, SIZE_1, SEGM1_BASE, SIZE_1);
index f5939f3bb2bad4aff6685a78bdd096c74740b63a..07298081843e49f4a8ca18e1266a909c17e87ec8 100644 (file)
@@ -109,7 +109,7 @@ int main(int ac, char **av)
         * but with a pointer to a large chunk of valid memory.
         */
        FD_ZERO(set[0]);
-       FD_SET(fds[1],set[0]);
+       FD_SET(fds[1], set[0]);
        assert(pselect(-1, NULL, set[0], NULL, NULL, &mask) == -1);
        printf("pselect6(-1, NULL, %p, NULL, NULL, {[HUP CHLD], %u}) "
               "= -1 EINVAL (%m)\n", set[0], NSIG_BYTES);
@@ -118,7 +118,7 @@ int main(int ac, char **av)
         * Another variant, with nfds exceeding FD_SETSIZE limit.
         */
        FD_ZERO(set[0]);
-       FD_SET(fds[0],set[0]);
+       FD_SET(fds[0], set[0]);
        FD_ZERO(set[1]);
        tm.ts.tv_sec = 0;
        tm.ts.tv_nsec = 123;
index 9e0ffdc61a595b23a0fda18a4c4dd8d4840b935a..d776dcdd23384147f57c27c29e64d0fd139f3933 100644 (file)
@@ -114,7 +114,7 @@ test_peeksiginfo(unsigned long pid, const unsigned long bad_request)
                        if (errno == EINTR)
                                continue;
                        saved = errno;
-                       kill (pid, SIGKILL);
+                       kill(pid, SIGKILL);
                        errno = saved;
                        perror_msg_and_fail("wait");
                }
@@ -159,7 +159,7 @@ test_peeksiginfo(unsigned long pid, const unsigned long bad_request)
 
                if (do_ptrace(PTRACE_CONT, pid, 0, 0)) {
                        saved = errno;
-                       kill (pid, SIGKILL);
+                       kill(pid, SIGKILL);
                        errno = saved;
                        perror_msg_and_fail("ptrace");
                }
index b2a884b6f68da31a4e82fc3f17b026fc0a91e324..1c7d07e36a58bdc38b9596dc3663d9fa48d48648 100644 (file)
@@ -71,7 +71,7 @@ struct fs_quota_statv {
        struct fs_qfilestatv    qs_pquota;      /* project quota information */
        int32_t         qs_btimelimit;          /* limit for blks timer */
        int32_t         qs_itimelimit;          /* limit for inodes timer */
-       int32_t         qs_rtbtimelimit;        /* limit for rt blks timer */
+       int32_t         qs_rtbtimelimit;        /* limit for rt blks timer */
        uint16_t        qs_bwarnlimit;          /* limit for num warnings */
        uint16_t        qs_iwarnlimit;          /* limit for num warnings */
        uint64_t        qs_pad2[8];             /* for future proofing */
index c243ae40bf61bf65923bb3474216df4e70d03b7b..a3e5cb8d8536a12b641b7f6b72b4d5723de97f1f 100644 (file)
@@ -37,7 +37,7 @@
  * see https://sourceware.org/bugzilla/show_bug.cgi?id=5208
  */
 #  if !(defined __GLIBC_MINOR__ && \
-        (__GLIBC__ << 16) + __GLIBC_MINOR__ >= (2 << 16) + 8)
+       (__GLIBC__ << 16) + __GLIBC_MINOR__ >= (2 << 16) + 8)
 #   undef HAVE_READAHEAD
 #  endif /* glibc < 2.8 */
 /*
@@ -45,7 +45,7 @@
  * see https://sourceware.org/bugzilla/show_bug.cgi?id=21026
  */
 #  if defined LINUX_MIPSN64 && !(defined __GLIBC_MINOR__ && \
-        (__GLIBC__ << 16) + __GLIBC_MINOR__ >= (2 << 16) + 25)
+       (__GLIBC__ << 16) + __GLIBC_MINOR__ >= (2 << 16) + 25)
 #   undef HAVE_READAHEAD
 #  endif /* LINUX_MIPSN64 && glibc < 2.25 */
 # endif /* __GLIBC__ */
index 9b09e647e1da7e9bec648377644fd192763b1c0a..ce651dc7a627d96edef2e9099f1008d9770059e1 100644 (file)
@@ -14,14 +14,14 @@ int
 main(void)
 {
        static const char buf[] = "reboot";
-       long rc = syscall(__NR_reboot, LINUX_REBOOT_MAGIC1, \
-                 INVALID_MAGIC, LINUX_REBOOT_CMD_RESTART2, buf);
+       long rc = syscall(__NR_reboot, LINUX_REBOOT_MAGIC1,
+                         INVALID_MAGIC, LINUX_REBOOT_CMD_RESTART2, buf);
        printf("reboot(LINUX_REBOOT_MAGIC1, %#x /* LINUX_REBOOT_MAGIC_??? */,"
               " LINUX_REBOOT_CMD_RESTART2, \"%s\") = %ld %s (%m)\n",
               INVALID_MAGIC, buf, rc, errno2name());
 
-       rc = syscall(__NR_reboot, LINUX_REBOOT_MAGIC1, \
-            LINUX_REBOOT_MAGIC2, INVALID_CMD);
+       rc = syscall(__NR_reboot, LINUX_REBOOT_MAGIC1,
+                    LINUX_REBOOT_MAGIC2, INVALID_CMD);
        printf("reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2,"
               " %#x /* LINUX_REBOOT_CMD_??? */) = %ld %s (%m)\n",
               INVALID_CMD, rc, errno2name());
index fea977b2d76cdb4568abe244987f27e83e4fb04f..03c7a4294018fd0b18fc08c3def41bdeae326c7d 100644 (file)
@@ -69,8 +69,7 @@ main(void)
 {
        static const char unterminated1[] = { '\1', '\2', '\3', '\4', '\5' };
        static const char unterminated2[] = { '\6', '\7', '\10', '\11', '\12' };
-       static const char unterminated3[] =
-               { '\16', '\17', '\20', '\21', '\22' };
+       static const char unterminated3[] = { '\16', '\17', '\20', '\21', '\22' };
 
        char *bogus_type = tail_memdup(unterminated1, sizeof(unterminated1));
        char *bogus_desc = tail_memdup(unterminated2, sizeof(unterminated2));
index f803d91cb65bdc0aa44ac952bbdada704b9c676c..9681281b9b9c2acf550e198f5113115e86271d30 100644 (file)
@@ -33,7 +33,7 @@
 #include <unistd.h>
 
 int
-main (void)
+main(void)
 {
        struct sigaction sa = {
                .sa_handler = SIG_IGN
index 3b2da2aecaed43d8b3d7a77d3b96f3c7ae5bc37e..3cff35a6a2472bb3f9ffef3be0f70d18a6d47717 100644 (file)
@@ -50,7 +50,7 @@ k_tgsigqueueinfo(const pid_t pid, const int sig, const void *const info)
 }
 
 int
-main (void)
+main(void)
 {
        const struct sigaction sa = {
                .sa_handler = SIG_IGN
@@ -65,7 +65,8 @@ main (void)
        info->si_code = SI_QUEUE;
        info->si_pid = getpid();
        info->si_uid = getuid();
-       info->si_value.sival_ptr = (void *) (unsigned long) 0xdeadbeeffacefeedULL;
+       info->si_value.sival_ptr =
+               (void *) (unsigned long) 0xdeadbeeffacefeedULL;
 
        if (k_tgsigqueueinfo(info->si_pid, SIGUSR1, info))
                (errno == ENOSYS ? perror_msg_and_skip : perror_msg_and_fail)(
index fc14b27c6a1d01e6e2c74e8e10b79ec696c7c2e4..5224ff130206984989909756efbcbb8076e0d88b 100644 (file)
@@ -24,6 +24,6 @@ main(void)
 #else
 
 SKIP_MAIN_UNDEFINED("__NR_sched_get_priority_min"
-                    " && defined __NR_sched_get_priority_max");
+                   " && defined __NR_sched_get_priority_max");
 
 #endif
index fe88ac7b21ac2c82e5628a1df90ee344108f7c00..f65be7d811dab7e1f33ee7b50be79f97fea0a24e 100644 (file)
@@ -146,7 +146,7 @@ main(void)
        for (i = 0; i < BPF_MAXINSNS; ++i) {
                if (i)
                        tprintf(", ");
-               switch(BPF_CLASS(i)) {
+               switch (BPF_CLASS(i)) {
                case BPF_LD:
                        tprintf("BPF_STMT(BPF_LD|BPF_W|BPF_IMM, %#x)", i << 16);
                        break;
index 3d1f38462a37e8aee74c31cbdd879fc90b27f956..2366d3859f794584b155c0922708730792d5148b 100644 (file)
@@ -9,8 +9,7 @@
 #include "xlat.h"
 #include "xlat/semop_flags.h"
 
-union semun
-{
+union semun {
        int val;
        struct semid_ds *buf;
        unsigned short *array;
index 644df794d14b8683acf11b536c5d5e930c9bec7b..7b46944533443357fc3a91ee6dffa89d20f14ae9 100644 (file)
@@ -174,7 +174,7 @@ main(void)
        new_act->flags = SA_RESTORER;
        new_act->restorer = (unsigned long) 0xdeadfacecafef00dULL;
 # define SA_RESTORER_FMT ", sa_flags=SA_RESTORER, sa_restorer=%#lx"
-# define SA_RESTORER_ARGS ,new_act->restorer
+# define SA_RESTORER_ARGS , new_act->restorer
 #else
        new_act->flags = SA_NODEFER;
 # define SA_RESTORER_FMT ", sa_flags=SA_NODEFER"
index e301f4ee42897c19a31d35b6bcd877216646344b..73e93b20c3e6ce026f3bdd226797d88eaca87c24 100644 (file)
@@ -50,6 +50,7 @@ signal2name(int sig)
        CASE(SIGPWR);
        CASE(SIGSTKFLT);
 #endif
-       default: perror_msg_and_fail("unknown signal number %d", sig);
+       default:
+               perror_msg_and_fail("unknown signal number %d", sig);
        }
 }
index 1c4293e5ffa9a0f2dc16561348caced61f30ffcf..01c52e8c69965d7ba56ecf6f52e39c88ab2abb40 100644 (file)
@@ -25,7 +25,7 @@ main(void)
        sigemptyset(&mask);
 
        for (sig = 1; sig <= 31; sig++) {
-               ifsig != SIGKILL && sig != SIGSTOP) {
+               if (sig != SIGKILL && sig != SIGSTOP) {
                        sigaction(sig, &act, NULL);
                        sigaddset(&mask, sig);
                }
@@ -33,7 +33,7 @@ main(void)
        sigprocmask(SIG_UNBLOCK, &mask, NULL);
 
        for (sig = 1; sig <= 31; sig++) {
-               if(sig != SIGKILL && sig != SIGSTOP) {
+               if (sig != SIGKILL && sig != SIGSTOP) {
                        if (kill(pid, sig) != 0)
                                perror_msg_and_fail("kill: %d", sig);
                        sig_print(signal2name(sig), pid, uid);
index 134d54f610e0e493e9f6c329a138e62b8305fa31..fc9ee5f9d6e2e98d4b54e68b9e958f7bf17bf4e5 100644 (file)
@@ -1,6 +1,6 @@
 int f0(int i);
 
-int main(int argc, char** argv)
+int main(int argc, char **argv)
 {
        f0(argc);
        return 0;
index f36fb0e1e529442e3f5bab1243373a5c8b26a27a..816b7eb1e6d1528bba398adc8a3a29a4feaa8540 100644 (file)
@@ -49,7 +49,7 @@ static const char *TEST_SYSCALL_STATX_MASK_STR  = "STATX_ALL";
 
 # define TEST_SYSCALL_INVOKE(sample, pst) \
        syscall(__NR_statx, AT_FDCWD, sample, TEST_SYSCALL_STATX_FLAGS, \
-               TEST_SYSCALL_STATX_MASK, pst)
+               TEST_SYSCALL_STATX_MASK, pst)
 # define PRINT_SYSCALL_HEADER(sample) \
        do { \
                int saved_errno = errno; \
index cb69bd4314de51a4b0a98a5501fa228650cfc855..bc8b4595079911486a5a9335830e534bb4612907 100644 (file)
@@ -5,7 +5,7 @@
 #include <asm/unistd.h>
 
 int
-main (void)
+main(void)
 {
        assert(syscall(__NR_times, 0x42) == -1);
        printf("times(0x42) = -1 EFAULT (%m)\n");
index 2c7b95e586f1f885035dfeff0ea3d4da96401377..c4cce0e8bab7fbfe1d7751d536b948be0845f858 100644 (file)
@@ -49,7 +49,7 @@ enum {
 };
 
 int
-main (void)
+main(void)
 {
        struct timespec ts;
        volatile int dummy = 0;
index cea382c9ef90b0d15a2112362a063368bce4794b..a0c710ac99279e081f05d993e86c69168d6c876a 100644 (file)
@@ -71,7 +71,7 @@ main(int ac, char **av)
                assert(recvfrom(0, av[1], len, MSG_WAITALL, NULL, NULL) == len);
                assert(close(0) == 0);
 
-                int status;
+               int status;
                assert(waitpid(pid, &status, 0) == pid);
                assert(status == 0);
        } else {
index b56feea42fe64020b27dab25d1ab7b1c8168a7a7..26f5b86922bc630fe8f5ebed4511c2d3c81c56c8 100644 (file)
@@ -111,7 +111,8 @@ si_code_2_name(const int code)
 #ifdef CLD_CONTINUED
        CASE(CLD_CONTINUED);
 #endif
-       default: perror_msg_and_fail("unknown si_code %d", code);
+       default:
+               perror_msg_and_fail("unknown si_code %d", code);
        }
 }
 
index e1638c8c155d7990dbbd905cc49f419a55824cb2..6c8cd81eaf03301a858a98463465d051c4307a54 100644 (file)
@@ -136,7 +136,7 @@ int main(void)
         * but with a pointer to a large chunk of valid memory.
         */
        FD_ZERO(set);
-       FD_SET(fds[1],set);
+       FD_SET(fds[1], set);
        assert(syscall(TEST_SYSCALL_NR, -1, NULL, set, NULL, NULL) == -1);
        printf("%s(-1, NULL, %p, NULL, NULL) = -1 EINVAL (%m)\n",
               TEST_SYSCALL_STR, set);
@@ -145,7 +145,7 @@ int main(void)
         * Another variant, with nfds exceeding FD_SETSIZE limit.
         */
        FD_ZERO(set);
-       FD_SET(fds[0],set);
+       FD_SET(fds[0], set);
        tv->tv_sec = 0;
        tv->tv_usec = 123;
        assert(syscall(TEST_SYSCALL_NR, FD_SETSIZE + 1, set, set + 1, NULL, tv) == 0);
diff --git a/time.c b/time.c
index 6cba48c8308982fe0c74959cb2a1932d435cad74..31f44fc65ebb524d308687e0e5116eff312208c2 100644 (file)
--- a/time.c
+++ b/time.c
@@ -198,15 +198,14 @@ printclockname(int clockid)
                if ((clockid & CLOCKFD_MASK) == CLOCKFD)
                        tprintf("FD_TO_CLOCKID(%d)", CLOCKID_TO_FD(clockid));
                else {
-                       if(CPUCLOCK_PERTHREAD(clockid))
+                       if (CPUCLOCK_PERTHREAD(clockid))
                                tprintf("MAKE_THREAD_CPUCLOCK(%d,", CPUCLOCK_PID(clockid));
                        else
                                tprintf("MAKE_PROCESS_CPUCLOCK(%d,", CPUCLOCK_PID(clockid));
                        printxval(cpuclocknames, clockid & CLOCKFD_MASK, "CPUCLOCK_???");
                        tprints(")");
                }
-       }
-       else
+       } else
 #endif
                printxval(clocknames, clockid, "CLOCK_???");
 }
diff --git a/uid.c b/uid.c
index 80d81ce4487c5b9bca0d0cee5dfcbe1d6b2b71eb..0fb810c8b6b9cab6c11356576397b6a2859e891e 100644 (file)
--- a/uid.c
+++ b/uid.c
@@ -34,9 +34,9 @@
 #  error invalid STRACE_UID_SIZE
 # endif
 
-# define SIZEIFY(x)            SIZEIFY_(x,STRACE_UID_SIZE)
-# define SIZEIFY_(x,size)      SIZEIFY__(x,size)
-# define SIZEIFY__(x,size)     x ## size
+# define SIZEIFY(x)            SIZEIFY_(x, STRACE_UID_SIZE)
+# define SIZEIFY_(x, size)     SIZEIFY__(x, size)
+# define SIZEIFY__(x, size)    x ## size
 
 # define printuid      SIZEIFY(printuid)
 # define sys_chown     SIZEIFY(sys_chown)
@@ -159,7 +159,7 @@ printuid(const char *text, const unsigned int uid)
 static bool
 print_gid(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
 {
-       printuid("", (* (uid_t *) elem_buf));
+       printuid("", (*(uid_t *) elem_buf));
 
        return true;
 }
index 5b51930c6906a3246c60dec4781ed18a757bc09d..5279e6dce97320a62d5f16758ff5a77e0ec7ef6d 100644 (file)
--- a/unwind.c
+++ b/unwind.c
@@ -81,13 +81,13 @@ typedef void (*error_action_fn)(void *data,
  * Type used in stacktrace capturing
  */
 struct call_t {
-       struct call_tnext;
-       char *output_line;
+       struct call_t *next;
+       char *output_line;
 };
 
 struct queue_t {
-       struct call_t *tail;
-       struct call_t *head;
+       struct call_t *tail;
+       struct call_t *head;
 };
 
 static void queue_print(struct queue_t *queue);
@@ -140,7 +140,7 @@ unwind_tcb_fin(struct tcb *tcp)
  * e.g. mmap, mprotect, munmap, execve.
  */
 static void
-build_mmap_cache(struct tcbtcp)
+build_mmap_cache(struct tcb *tcp)
 {
        FILE *fp;
        struct mmap_cache_t *cache_head;
@@ -261,7 +261,7 @@ rebuild_cache_if_invalid(struct tcb *tcp, const char *caller)
 }
 
 void
-unwind_cache_invalidate(struct tcbtcp)
+unwind_cache_invalidate(struct tcb *tcp)
 {
 #if SUPPORTED_PERSONALITIES > 1
        if (tcp->currpers != DEFAULT_PERSONALITY) {
@@ -334,8 +334,7 @@ print_stack_frame(struct tcb *tcp,
                                    function_offset,
                                    true_offset);
                        return 0;
-               }
-               else if (ip < cur_mmap_cache->start_addr)
+               } else if (ip < cur_mmap_cache->start_addr)
                        upper = mid - 1;
                else
                        lower = mid + 1;
@@ -346,7 +345,7 @@ print_stack_frame(struct tcb *tcp,
         * after a set_tid_address syscall
         * unw_get_reg returns IP == 0
         */
-       if(ip)
+       if (ip)
                error_action(data, "unexpected_backtracing_error", ip);
        return -1;
 }
@@ -453,24 +452,24 @@ sprint_call_or_error(const char *binary_filename,
                     unsigned long true_offset,
                     const char *error)
 {
-       char *output_line = NULL;
-       int n;
-
-       if (symbol_name)
-               n = asprintf(&output_line, STACK_ENTRY_SYMBOL_FMT);
-       else if (binary_filename)
-               n = asprintf(&output_line, STACK_ENTRY_NOSYMBOL_FMT);
-       else if (error)
-               n = true_offset
-                       ? asprintf(&output_line, STACK_ENTRY_ERROR_WITH_OFFSET_FMT)
-                       : asprintf(&output_line, STACK_ENTRY_ERROR_FMT);
-       else
-               n = asprintf(&output_line, STACK_ENTRY_BUG_FMT, __func__);
-
-       if (n < 0)
-               error_msg_and_die("error in asprintf");
-
-       return output_line;
+       char *output_line = NULL;
+       int n;
+
+       if (symbol_name)
+               n = asprintf(&output_line, STACK_ENTRY_SYMBOL_FMT);
+       else if (binary_filename)
+               n = asprintf(&output_line, STACK_ENTRY_NOSYMBOL_FMT);
+       else if (error)
+               n = true_offset
+                       ? asprintf(&output_line, STACK_ENTRY_ERROR_WITH_OFFSET_FMT)
+                       : asprintf(&output_line, STACK_ENTRY_ERROR_FMT);
+       else
+               n = asprintf(&output_line, STACK_ENTRY_BUG_FMT, __func__);
+
+       if (n < 0)
+               error_msg_and_die("error in asprintf");
+
+       return output_line;
 }
 
 /*
@@ -552,7 +551,7 @@ queue_print(struct queue_t *queue)
  * printing stack
  */
 void
-unwind_print_stacktrace(struct tcbtcp)
+unwind_print_stacktrace(struct tcb *tcp)
 {
 #if SUPPORTED_PERSONALITIES > 1
        if (tcp->currpers != DEFAULT_PERSONALITY) {
@@ -560,14 +559,13 @@ unwind_print_stacktrace(struct tcb* tcp)
                return;
        }
 #endif
-       if (tcp->queue->head) {
-              DPRINTF("tcp=%p, queue=%p", "queueprint", tcp, tcp->queue->head);
-              queue_print(tcp->queue);
-       }
-       else if (rebuild_cache_if_invalid(tcp, __func__)) {
-               DPRINTF("tcp=%p, queue=%p", "stackprint", tcp, tcp->queue->head);
-               stacktrace_walk(tcp, print_call_cb, print_error_cb, NULL);
-       }
+       if (tcp->queue->head) {
+               DPRINTF("tcp=%p, queue=%p", "queueprint", tcp, tcp->queue->head);
+               queue_print(tcp->queue);
+       } else if (rebuild_cache_if_invalid(tcp, __func__)) {
+               DPRINTF("tcp=%p, queue=%p", "stackprint", tcp, tcp->queue->head);
+               stacktrace_walk(tcp, print_call_cb, print_error_cb, NULL);
+       }
 }
 
 /*
diff --git a/util.c b/util.c
index 5aea68b2e62e8f7abb44f7d9fc804c064e9fdcf4..0167e88193a6e9ca41bbcbbd4f8edb6254174dd6 100644 (file)
--- a/util.c
+++ b/util.c
@@ -164,7 +164,7 @@ int
 next_set_bit(const void *bit_array, unsigned cur_bit, unsigned size_bits)
 {
        const unsigned endian = 1;
-       int little_endian = * (char *) (void *) &endian;
+       int little_endian = *(char *) (void *) &endian;
 
        const uint8_t *array = bit_array;
        unsigned pos = cur_bit / 8;
@@ -221,10 +221,10 @@ getllval(struct tcb *tcp, unsigned long long *val, int arg_no)
                arg_no++;
        }
 #else /* SIZEOF_KERNEL_LONG_T == 4 */
-# if defined __ARM_EABI__ || \
-     defined LINUX_MIPSO32 || \
-     defined POWERPC || \
-     defined XTENSA
+# if defined __ARM_EABI__      \
+  || defined LINUX_MIPSO32     \
+  || defined POWERPC           \
+  || defined XTENSA
        /* Align arg_no to the next even number. */
        arg_no = (arg_no + 1) & 0xe;
 # elif defined SH
@@ -899,8 +899,7 @@ dumpstr(struct tcb *const tcp, const kernel_ulong_t addr, const int len)
                        if (i < len) {
                                *dst++ = "0123456789abcdef"[*src >> 4];
                                *dst++ = "0123456789abcdef"[*src & 0xf];
-                       }
-                       else {
+                       } else {
                                *dst++ = ' ';
                                *dst++ = ' ';
                        }
@@ -987,7 +986,7 @@ umoven(struct tcb *const tcp, kernel_ulong_t addr, unsigned int len,
 
 #if ANY_WORDSIZE_LESS_THAN_KERNEL_LONG
        if (current_wordsize < sizeof(addr)
-           && (addr & (~ (kernel_ulong_t) -1U))) {
+           && (addr & (~(kernel_ulong_t) -1U))) {
                return -1;
        }
 #endif
@@ -1135,7 +1134,7 @@ umovestr(struct tcb *const tcp, kernel_ulong_t addr, unsigned int len, char *lad
 
 #if ANY_WORDSIZE_LESS_THAN_KERNEL_LONG
        if (current_wordsize < sizeof(addr)
-           && (addr & (~ (kernel_ulong_t) -1U))) {
+           && (addr & (~(kernel_ulong_t) -1U))) {
                return -1;
        }
 #endif
diff --git a/v4l2.c b/v4l2.c
index ad904426f6bade3003d54add316eb6841d6a9662..12750a66b031f1f180d68dde825dde96fbb93982 100644 (file)
--- a/v4l2.c
+++ b/v4l2.c
@@ -207,7 +207,7 @@ print_v4l2_fmtdesc(struct tcb *const tcp, const kernel_ulong_t arg)
 #include "xlat/v4l2_sliced_flags.h"
 
 static bool
-print_v4l2_clip(struct tcb *tcp, void *elem_buf, size_t elem_size, voiddata)
+print_v4l2_clip(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
 {
        const struct_v4l2_clip *p = elem_buf;
        tprintf(FMT_RECT, ARGS_RECT(p->c));
diff --git a/wait.c b/wait.c
index fc519353bf1f50fc0adc4bdda3aff26bf55d4347..0f1aa00133d31c33cb45d9a57bf104d023f135c4 100644 (file)
--- a/wait.c
+++ b/wait.c
@@ -77,14 +77,12 @@ printstatus(int status)
                        signame(sig & 0x7f),
                        sig & 0x80 ? " | 0x80" : "");
                status &= ~W_STOPCODE(sig);
-       }
-       else if (WIFSIGNALED(status)) {
+       } else if (WIFSIGNALED(status)) {
                tprintf("[{WIFSIGNALED(s) && WTERMSIG(s) == %s%s}",
                        signame(WTERMSIG(status)),
                        WCOREDUMP(status) ? " && WCOREDUMP(s)" : "");
                status &= ~(W_EXITCODE(0, WTERMSIG(status)) | WCOREFLAG);
-       }
-       else if (WIFEXITED(status)) {
+       } else if (WIFEXITED(status)) {
                tprintf("[{WIFEXITED(s) && WEXITSTATUS(s) == %d}",
                        WEXITSTATUS(status));
                exited = 1;
diff --git a/xlat.c b/xlat.c
index 95ba1b0be86c523f224a68aba61b5d9b1531cea6..ad49720dcfe7924e6d64e222f3b5395670d1946e 100644 (file)
--- a/xlat.c
+++ b/xlat.c
@@ -53,7 +53,7 @@ const char *
 xlat_search(const struct xlat *xlat, const size_t nmemb, const uint64_t val)
 {
        const struct xlat *e =
-               bsearch((const void*) &val,
+               bsearch((const void *) &val,
                        xlat, nmemb, sizeof(*xlat), xlat_bsearch_compare);
 
        return e ? e->str : NULL;
index 50d757e34dca71fcb0487c96e06fbef4eb9505ad..3c66eb504dac1bb5632ae20b523f47700f44f11e 100644 (file)
@@ -1,4 +1,4 @@
-NFNL_SUBSYS_NONE               0
+NFNL_SUBSYS_NONE               0
 NFNL_SUBSYS_CTNETLINK          1
 NFNL_SUBSYS_CTNETLINK_EXP      2
 NFNL_SUBSYS_QUEUE              3