From 368aecc8bf579cd7861536ea8b9cab5893954e59 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Fri, 28 Oct 2016 13:22:17 +1100 Subject: [PATCH] ipc-sem-optimize-perform_atomic_semop-checkpatch-fixes WARNING: Missing a blank line after declarations #132: FILE: ipc/sem.c:747: + int undo = un->semadj[sop->sem_num] - sem_op; + un->semadj[sop->sem_num] = undo; ERROR: spaces required around that '?' (ctx:VxW) #142: FILE: ipc/sem.c:757: + return sop->sem_flg & IPC_NOWAIT? -EAGAIN : 1; ^ total: 1 errors, 1 warnings, 171 lines checked NOTE: For some of the reported defects, checkpatch may be able to mechanically convert to the typical style using --fix or --fix-inplace. ./patches/ipc-sem-optimize-perform_atomic_semop.patch has style problems, please review. NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. Please run checkpatch prior to sending patches Cc: Davidlohr Bueso Signed-off-by: Andrew Morton --- ipc/sem.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ipc/sem.c b/ipc/sem.c index 2b35309574615c..91dd78afdf7fa7 100644 --- a/ipc/sem.c +++ b/ipc/sem.c @@ -744,6 +744,7 @@ static int perform_atomic_semop(struct sem_array *sma, struct sem_queue *q) if (sop->sem_flg & SEM_UNDO) { int undo = un->semadj[sop->sem_num] - sem_op; + un->semadj[sop->sem_num] = undo; } curr->semval += sem_op; @@ -754,7 +755,7 @@ static int perform_atomic_semop(struct sem_array *sma, struct sem_queue *q) would_block: q->blocking = sop; - return sop->sem_flg & IPC_NOWAIT? -EAGAIN : 1; + return sop->sem_flg & IPC_NOWAIT ? -EAGAIN : 1; } static inline void wake_up_sem_queue_prepare(struct sem_queue *q, int error,