Commit 63980c80 authored by Shailesh Pandey's avatar Shailesh Pandey Committed by Linus Torvalds

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.comSigned-off-by: default avatarShailesh Pandey <p.shailesh@samsung.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 99989835
...@@ -89,6 +89,7 @@ void shm_init_ns(struct ipc_namespace *ns) ...@@ -89,6 +89,7 @@ void shm_init_ns(struct ipc_namespace *ns)
static void do_shm_rmid(struct ipc_namespace *ns, struct kern_ipc_perm *ipcp) static void do_shm_rmid(struct ipc_namespace *ns, struct kern_ipc_perm *ipcp)
{ {
struct shmid_kernel *shp; struct shmid_kernel *shp;
shp = container_of(ipcp, struct shmid_kernel, shm_perm); shp = container_of(ipcp, struct shmid_kernel, shm_perm);
if (shp->shm_nattch) { if (shp->shm_nattch) {
...@@ -387,6 +388,7 @@ static int shm_set_policy(struct vm_area_struct *vma, struct mempolicy *new) ...@@ -387,6 +388,7 @@ static int shm_set_policy(struct vm_area_struct *vma, struct mempolicy *new)
struct file *file = vma->vm_file; struct file *file = vma->vm_file;
struct shm_file_data *sfd = shm_file_data(file); struct shm_file_data *sfd = shm_file_data(file);
int err = 0; int err = 0;
if (sfd->vm_ops->set_policy) if (sfd->vm_ops->set_policy)
err = sfd->vm_ops->set_policy(vma, new); err = sfd->vm_ops->set_policy(vma, new);
return err; return err;
...@@ -417,7 +419,7 @@ static int shm_mmap(struct file *file, struct vm_area_struct *vma) ...@@ -417,7 +419,7 @@ static int shm_mmap(struct file *file, struct vm_area_struct *vma)
* In case of remap_file_pages() emulation, the file can represent * In case of remap_file_pages() emulation, the file can represent
* removed IPC ID: propogate shm_lock() error to caller. * removed IPC ID: propogate shm_lock() error to caller.
*/ */
ret =__shm_open(vma); ret = __shm_open(vma);
if (ret) if (ret)
return ret; return ret;
...@@ -468,6 +470,7 @@ static unsigned long shm_get_unmapped_area(struct file *file, ...@@ -468,6 +470,7 @@ static unsigned long shm_get_unmapped_area(struct file *file,
unsigned long flags) unsigned long flags)
{ {
struct shm_file_data *sfd = shm_file_data(file); struct shm_file_data *sfd = shm_file_data(file);
return sfd->file->f_op->get_unmapped_area(sfd->file, addr, len, return sfd->file->f_op->get_unmapped_area(sfd->file, addr, len,
pgoff, flags); pgoff, flags);
} }
...@@ -766,6 +769,7 @@ static void shm_add_rss_swap(struct shmid_kernel *shp, ...@@ -766,6 +769,7 @@ static void shm_add_rss_swap(struct shmid_kernel *shp,
} else { } else {
#ifdef CONFIG_SHMEM #ifdef CONFIG_SHMEM
struct shmem_inode_info *info = SHMEM_I(inode); struct shmem_inode_info *info = SHMEM_I(inode);
spin_lock_irq(&info->lock); spin_lock_irq(&info->lock);
*rss_add += inode->i_mapping->nrpages; *rss_add += inode->i_mapping->nrpages;
*swp_add += info->swapped; *swp_add += info->swapped;
...@@ -1028,6 +1032,7 @@ SYSCALL_DEFINE3(shmctl, int, shmid, int, cmd, struct shmid_ds __user *, buf) ...@@ -1028,6 +1032,7 @@ SYSCALL_DEFINE3(shmctl, int, shmid, int, cmd, struct shmid_ds __user *, buf)
if (!ns_capable(ns->user_ns, CAP_IPC_LOCK)) { if (!ns_capable(ns->user_ns, CAP_IPC_LOCK)) {
kuid_t euid = current_euid(); kuid_t euid = current_euid();
if (!uid_eq(euid, shp->shm_perm.uid) && if (!uid_eq(euid, shp->shm_perm.uid) &&
!uid_eq(euid, shp->shm_perm.cuid)) { !uid_eq(euid, shp->shm_perm.cuid)) {
err = -EPERM; err = -EPERM;
...@@ -1045,6 +1050,7 @@ SYSCALL_DEFINE3(shmctl, int, shmid, int, cmd, struct shmid_ds __user *, buf) ...@@ -1045,6 +1050,7 @@ SYSCALL_DEFINE3(shmctl, int, shmid, int, cmd, struct shmid_ds __user *, buf)
if (cmd == SHM_LOCK) { if (cmd == SHM_LOCK) {
struct user_struct *user = current_user(); struct user_struct *user = current_user();
err = shmem_lock(shm_file, 1, user); err = shmem_lock(shm_file, 1, user);
if (!err && !(shp->shm_perm.mode & SHM_LOCKED)) { if (!err && !(shp->shm_perm.mode & SHM_LOCKED)) {
shp->shm_perm.mode |= SHM_LOCKED; shp->shm_perm.mode |= SHM_LOCKED;
...@@ -1354,9 +1360,10 @@ SYSCALL_DEFINE1(shmdt, char __user *, shmaddr) ...@@ -1354,9 +1360,10 @@ SYSCALL_DEFINE1(shmdt, char __user *, shmaddr)
vma = next; vma = next;
} }
#else /* CONFIG_MMU */ #else /* CONFIG_MMU */
/* under NOMMU conditions, the exact address to be destroyed must be /* under NOMMU conditions, the exact address to be destroyed must be
* given */ * given
*/
if (vma && vma->vm_start == addr && vma->vm_ops == &shm_vm_ops) { if (vma && vma->vm_start == addr && vma->vm_ops == &shm_vm_ops) {
do_munmap(mm, vma->vm_start, vma->vm_end - vma->vm_start); do_munmap(mm, vma->vm_start, vma->vm_end - vma->vm_start);
retval = 0; retval = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment