2012-05-20 10:57:58

by Jeffrin Jose

[permalink] [raw]
Subject: [PATCH]ipc:fixed spacing issues in coding style.

Fixed spacing issues related to different operators
like * and : found by checkpatch.pl tool in ipc/sem.c

Signed-off-by: Jeffrin Jose <[email protected]>
---
ipc/sem.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ipc/sem.c b/ipc/sem.c
index 10386b8..9301595 100644
--- a/ipc/sem.c
+++ b/ipc/sem.c
@@ -964,7 +964,7 @@ static int semctl_nolock(struct ipc_namespace *ns, int semid,
up_read(&sem_ids(ns).rw_mutex);
if (copy_to_user (arg.__buf, &seminfo, sizeof(struct seminfo)))
return -EFAULT;
- return (max_id < 0) ? 0: max_id;
+ return (max_id < 0) ? 0 : max_id;
}
case IPC_STAT:
case SEM_STAT:
@@ -1372,7 +1372,7 @@ static struct sem_undo *find_alloc_undo(struct ipc_namespace *ns, int semid)
spin_lock(&ulp->lock);
un = lookup_undo(ulp, semid);
spin_unlock(&ulp->lock);
- if (likely(un!=NULL))
+ if (likely(un != NULL))
goto out;
rcu_read_unlock();

@@ -1732,7 +1732,7 @@ void exit_sem(struct task_struct *tsk)

/* perform adjustments registered in un */
for (i = 0; i < sma->sem_nsems; i++) {
- struct sem * semaphore = &sma->sem_base[i];
+ struct sem *semaphore = &sma->sem_base[i];
if (un->semadj[i]) {
semaphore->semval += un->semadj[i];
/*
--
1.7.10


2012-05-20 15:45:08

by Paul E. McKenney

[permalink] [raw]
Subject: Re: [PATCH]ipc:fixed spacing issues in coding style.

On Sun, May 20, 2012 at 04:31:13PM +0530, Jeffrin Jose wrote:
> Fixed spacing issues related to different operators
> like * and : found by checkpatch.pl tool in ipc/sem.c
>
> Signed-off-by: Jeffrin Jose <[email protected]>

Looks good to me!

Reviewed-by: Paul E. McKenney <[email protected]>

> ---
> ipc/sem.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/ipc/sem.c b/ipc/sem.c
> index 10386b8..9301595 100644
> --- a/ipc/sem.c
> +++ b/ipc/sem.c
> @@ -964,7 +964,7 @@ static int semctl_nolock(struct ipc_namespace *ns, int semid,
> up_read(&sem_ids(ns).rw_mutex);
> if (copy_to_user (arg.__buf, &seminfo, sizeof(struct seminfo)))
> return -EFAULT;
> - return (max_id < 0) ? 0: max_id;
> + return (max_id < 0) ? 0 : max_id;
> }
> case IPC_STAT:
> case SEM_STAT:
> @@ -1372,7 +1372,7 @@ static struct sem_undo *find_alloc_undo(struct ipc_namespace *ns, int semid)
> spin_lock(&ulp->lock);
> un = lookup_undo(ulp, semid);
> spin_unlock(&ulp->lock);
> - if (likely(un!=NULL))
> + if (likely(un != NULL))
> goto out;
> rcu_read_unlock();
>
> @@ -1732,7 +1732,7 @@ void exit_sem(struct task_struct *tsk)
>
> /* perform adjustments registered in un */
> for (i = 0; i < sma->sem_nsems; i++) {
> - struct sem * semaphore = &sma->sem_base[i];
> + struct sem *semaphore = &sma->sem_base[i];
> if (un->semadj[i]) {
> semaphore->semval += un->semadj[i];
> /*
> --
> 1.7.10
>

2012-05-20 19:04:55

by Josh Triplett

[permalink] [raw]
Subject: Re: [PATCH]ipc:fixed spacing issues in coding style.

On Sun, May 20, 2012 at 04:31:13PM +0530, Jeffrin Jose wrote:
> Fixed spacing issues related to different operators
> like * and : found by checkpatch.pl tool in ipc/sem.c
>
> Signed-off-by: Jeffrin Jose <[email protected]>

All three of the spacing fixes in this patch look correct.
Reviewed-by: Josh Triplett <[email protected]>

However, I see one instance of another type of spacing issue in the
patch context:

> --- a/ipc/sem.c
> +++ b/ipc/sem.c
> @@ -964,7 +964,7 @@ static int semctl_nolock(struct ipc_namespace *ns, int semid,
> up_read(&sem_ids(ns).rw_mutex);
> if (copy_to_user (arg.__buf, &seminfo, sizeof(struct seminfo)))

copy_to_user should not have a space before its open parenthesis.

- Josh Triplett