Skip to content

Commit

Permalink
ipc-sem-optimize-perform_atomic_semop-checkpatch-fixes
Browse files Browse the repository at this point in the history
WARNING: Missing a blank line after declarations
torvalds#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)
torvalds#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 <dave@stgolabs.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
  • Loading branch information
akpm00 authored and sfrothwell committed Dec 8, 2016
1 parent 8eec12d commit bd875f5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ipc/sem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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,
Expand Down

0 comments on commit bd875f5

Please sign in to comment.