Skip to content

Commit 63980c8

Browse files
Shailesh Pandeytorvalds
authored andcommitted
ipc/shm.c: coding style fixes
This patch fixes below warnings: WARNING: Missing a blank line after declarations WARNING: Block comments use a trailing */ on a separate line ERROR: spaces required around that '=' (ctx:WxV) Above warnings were reported by checkpatch.pl Link: http://lkml.kernel.org/r/1478604980-18062-1-git-send-email-p.shailesh@samsung.com Signed-off-by: Shailesh Pandey <p.shailesh@samsung.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 9998983 commit 63980c8

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

ipc/shm.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ void shm_init_ns(struct ipc_namespace *ns)
8989
static void do_shm_rmid(struct ipc_namespace *ns, struct kern_ipc_perm *ipcp)
9090
{
9191
struct shmid_kernel *shp;
92+
9293
shp = container_of(ipcp, struct shmid_kernel, shm_perm);
9394

9495
if (shp->shm_nattch) {
@@ -387,6 +388,7 @@ static int shm_set_policy(struct vm_area_struct *vma, struct mempolicy *new)
387388
struct file *file = vma->vm_file;
388389
struct shm_file_data *sfd = shm_file_data(file);
389390
int err = 0;
391+
390392
if (sfd->vm_ops->set_policy)
391393
err = sfd->vm_ops->set_policy(vma, new);
392394
return err;
@@ -417,7 +419,7 @@ static int shm_mmap(struct file *file, struct vm_area_struct *vma)
417419
* In case of remap_file_pages() emulation, the file can represent
418420
* removed IPC ID: propogate shm_lock() error to caller.
419421
*/
420-
ret =__shm_open(vma);
422+
ret = __shm_open(vma);
421423
if (ret)
422424
return ret;
423425

@@ -468,6 +470,7 @@ static unsigned long shm_get_unmapped_area(struct file *file,
468470
unsigned long flags)
469471
{
470472
struct shm_file_data *sfd = shm_file_data(file);
473+
471474
return sfd->file->f_op->get_unmapped_area(sfd->file, addr, len,
472475
pgoff, flags);
473476
}
@@ -766,6 +769,7 @@ static void shm_add_rss_swap(struct shmid_kernel *shp,
766769
} else {
767770
#ifdef CONFIG_SHMEM
768771
struct shmem_inode_info *info = SHMEM_I(inode);
772+
769773
spin_lock_irq(&info->lock);
770774
*rss_add += inode->i_mapping->nrpages;
771775
*swp_add += info->swapped;
@@ -1028,6 +1032,7 @@ SYSCALL_DEFINE3(shmctl, int, shmid, int, cmd, struct shmid_ds __user *, buf)
10281032

10291033
if (!ns_capable(ns->user_ns, CAP_IPC_LOCK)) {
10301034
kuid_t euid = current_euid();
1035+
10311036
if (!uid_eq(euid, shp->shm_perm.uid) &&
10321037
!uid_eq(euid, shp->shm_perm.cuid)) {
10331038
err = -EPERM;
@@ -1045,6 +1050,7 @@ SYSCALL_DEFINE3(shmctl, int, shmid, int, cmd, struct shmid_ds __user *, buf)
10451050

10461051
if (cmd == SHM_LOCK) {
10471052
struct user_struct *user = current_user();
1053+
10481054
err = shmem_lock(shm_file, 1, user);
10491055
if (!err && !(shp->shm_perm.mode & SHM_LOCKED)) {
10501056
shp->shm_perm.mode |= SHM_LOCKED;
@@ -1354,9 +1360,10 @@ SYSCALL_DEFINE1(shmdt, char __user *, shmaddr)
13541360
vma = next;
13551361
}
13561362

1357-
#else /* CONFIG_MMU */
1363+
#else /* CONFIG_MMU */
13581364
/* under NOMMU conditions, the exact address to be destroyed must be
1359-
* given */
1365+
* given
1366+
*/
13601367
if (vma && vma->vm_start == addr && vma->vm_ops == &shm_vm_ops) {
13611368
do_munmap(mm, vma->vm_start, vma->vm_end - vma->vm_start);
13621369
retval = 0;

0 commit comments

Comments
 (0)