Skip to content

Commit 3ab08fe

Browse files
Davidlohr Buesotorvalds
authored andcommitted
ipc: remove braces for single statements
Deal with checkpatch messages: WARNING: braces {} are not necessary for single statement blocks Signed-off-by: Davidlohr Bueso <davidlohr@hp.com> Cc: Aswin Chandramouleeswaran <aswin@hp.com> Cc: Rik van Riel <riel@redhat.com> Acked-by: Manfred Spraul <manfred@colorfullife.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 8001c85 commit 3ab08fe

4 files changed

Lines changed: 16 additions & 19 deletions

File tree

‎ipc/compat.c‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -288,11 +288,11 @@ static long do_compat_semctl(int first, int second, int third, u32 pad)
288288
break;
289289

290290
case IPC_SET:
291-
if (version == IPC_64) {
291+
if (version == IPC_64)
292292
err = get_compat_semid64_ds(&s64, compat_ptr(pad));
293-
} else {
293+
else
294294
err = get_compat_semid_ds(&s64, compat_ptr(pad));
295-
}
295+
296296
up64 = compat_alloc_user_space(sizeof(s64));
297297
if (copy_to_user(up64, &s64, sizeof(s64)))
298298
err = -EFAULT;
@@ -515,11 +515,11 @@ long compat_sys_msgctl(int first, int second, void __user *uptr)
515515
break;
516516

517517
case IPC_SET:
518-
if (version == IPC_64) {
518+
if (version == IPC_64)
519519
err = get_compat_msqid64(&m64, uptr);
520-
} else {
520+
else
521521
err = get_compat_msqid(&m64, uptr);
522-
}
522+
523523
if (err)
524524
break;
525525
p = compat_alloc_user_space(sizeof(m64));
@@ -702,11 +702,11 @@ long compat_sys_shmctl(int first, int second, void __user *uptr)
702702

703703

704704
case IPC_SET:
705-
if (version == IPC_64) {
705+
if (version == IPC_64)
706706
err = get_compat_shmid64_ds(&s64, uptr);
707-
} else {
707+
else
708708
err = get_compat_shmid_ds(&s64, uptr);
709-
}
709+
710710
if (err)
711711
break;
712712
p = compat_alloc_user_space(sizeof(s64));

‎ipc/mqueue.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1303,11 +1303,11 @@ SYSCALL_DEFINE2(mq_notify, mqd_t, mqdes,
13031303
out_fput:
13041304
fdput(f);
13051305
out:
1306-
if (sock) {
1306+
if (sock)
13071307
netlink_detachskb(sock, nc);
1308-
} else if (nc) {
1308+
else if (nc)
13091309
dev_kfree_skb(nc);
1310-
}
1310+
13111311
return ret;
13121312
}
13131313

‎ipc/sem.c‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -492,9 +492,9 @@ static int newary(struct ipc_namespace *ns, struct ipc_params *params)
492492

493493
size = sizeof(*sma) + nsems * sizeof(struct sem);
494494
sma = ipc_rcu_alloc(size);
495-
if (!sma) {
495+
if (!sma)
496496
return -ENOMEM;
497-
}
497+
498498
memset(sma, 0, size);
499499

500500
sma->sem_perm.mode = (semflg & S_IRWXUGO);
@@ -1967,10 +1967,8 @@ SYSCALL_DEFINE4(semtimedop, int, semid, struct sembuf __user *, tsops,
19671967
* If queue.status != -EINTR we are woken up by another process.
19681968
* Leave without unlink_queue(), but with sem_unlock().
19691969
*/
1970-
1971-
if (error != -EINTR) {
1970+
if (error != -EINTR)
19721971
goto out_unlock_free;
1973-
}
19741972

19751973
/*
19761974
* If an interrupt occurred we have to clean up the queue

‎ipc/util.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,8 @@ void __init ipc_init_proc_interface(const char *path, const char *header,
183183
NULL, /* parent dir */
184184
&sysvipc_proc_fops,
185185
iface);
186-
if (!pde) {
186+
if (!pde)
187187
kfree(iface);
188-
}
189188
}
190189
#endif
191190

0 commit comments

Comments
 (0)