netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net:appletalk:ddp:fixed coding style issue again relating to
@ 2012-08-07 14:00 Jeffrin Jose
  2012-08-07 14:25 ` Eric W. Biederman
  2012-08-07 21:46 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Jeffrin Jose @ 2012-08-07 14:00 UTC (permalink / raw)
  To: acme, davem, bhutchings; +Cc: netdev, linux-kernel, Jeffrin Jose

Fixed coding style issue relating to indentation in
net/appletalk/ddp.c found by checkpatch.pl tool

Signed-off-by: Jeffrin Jose <ahiliation@yahoo.co.in>
---
 net/appletalk/ddp.c |   42 +++++++++++++++++++++---------------------
 1 file changed, 21 insertions(+), 21 deletions(-)

diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c
index 4023fca..2cf1054 100644
--- a/net/appletalk/ddp.c
+++ b/net/appletalk/ddp.c
@@ -1797,39 +1797,39 @@ static int atalk_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 	switch (cmd) {
 		/* Protocol layer */
 	case TIOCOUTQ: {
-			long amount = sk->sk_sndbuf - sk_wmem_alloc_get(sk);
+		long amount = sk->sk_sndbuf - sk_wmem_alloc_get(sk);
 
-			if (amount < 0)
-				amount = 0;
-			rc = put_user(amount, (int __user *)argp);
-			break;
+		if (amount < 0)
+			amount = 0;
+		rc = put_user(amount, (int __user *)argp);
+		break;
 		}
 	case TIOCINQ: {
 			/*
 			 * These two are safe on a single CPU system as only
 			 * user tasks fiddle here
 			 */
-			struct sk_buff *skb = skb_peek(&sk->sk_receive_queue);
-			long amount = 0;
+		struct sk_buff *skb = skb_peek(&sk->sk_receive_queue);
+		long amount = 0;
 
-			if (skb)
-				amount = skb->len - sizeof(struct ddpehdr);
+		if (skb)
+			amount = skb->len - sizeof(struct ddpehdr);
 			rc = put_user(amount, (int __user *)argp);
 			break;
 		}
 	case SIOCGSTAMP:
-			rc = sock_get_timestamp(sk, argp);
-			break;
+		rc = sock_get_timestamp(sk, argp);
+		break;
 	case SIOCGSTAMPNS:
-			rc = sock_get_timestampns(sk, argp);
-			break;
+		rc = sock_get_timestampns(sk, argp);
+		break;
 		/* Routing */
 	case SIOCADDRT:
 	case SIOCDELRT:
-			rc = -EPERM;
-			if (capable(CAP_NET_ADMIN))
-				rc = atrtr_ioctl(cmd, argp);
-			break;
+		rc = -EPERM;
+		if (capable(CAP_NET_ADMIN))
+			rc = atrtr_ioctl(cmd, argp);
+		break;
 		/* Interface */
 	case SIOCGIFADDR:
 	case SIOCSIFADDR:
@@ -1838,10 +1838,10 @@ static int atalk_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 	case SIOCDIFADDR:
 	case SIOCSARP:		/* proxy AARP */
 	case SIOCDARP:		/* proxy AARP */
-			rtnl_lock();
-			rc = atif_ioctl(cmd, argp);
-			rtnl_unlock();
-			break;
+		rtnl_lock();
+		rc = atif_ioctl(cmd, argp);
+		rtnl_unlock();
+		break;
 	}
 
 	return rc;
-- 
1.7.10

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] net:appletalk:ddp:fixed coding style issue again relating to
  2012-08-07 14:00 [PATCH] net:appletalk:ddp:fixed coding style issue again relating to Jeffrin Jose
@ 2012-08-07 14:25 ` Eric W. Biederman
  2012-08-07 21:46 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Eric W. Biederman @ 2012-08-07 14:25 UTC (permalink / raw)
  To: Jeffrin Jose; +Cc: acme, davem, bhutchings, netdev, linux-kernel

Jeffrin Jose <ahiliation@yahoo.co.in> writes:

>  	case TIOCINQ: {
>  			/*
>  			 * These two are safe on a single CPU system as only
>  			 * user tasks fiddle here
>  			 */
> -			struct sk_buff *skb = skb_peek(&sk->sk_receive_queue);
> -			long amount = 0;
> +		struct sk_buff *skb = skb_peek(&sk->sk_receive_queue);
> +		long amount = 0;
>  
> -			if (skb)
> -				amount = skb->len - sizeof(struct ddpehdr);
> +		if (skb)
> +			amount = skb->len - sizeof(struct ddpehdr);
>  			rc = put_user(amount, (int __user *)argp);
>  			break;
>  		}

Is putting "rc = put_user(amount, (int __user *)argp);" on the same
indentation level as "amount = skb->len - sizeof(struct ddpehdr);"
really what you want to do?

Eric

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] net:appletalk:ddp:fixed coding style issue again relating to
  2012-08-07 14:00 [PATCH] net:appletalk:ddp:fixed coding style issue again relating to Jeffrin Jose
  2012-08-07 14:25 ` Eric W. Biederman
@ 2012-08-07 21:46 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2012-08-07 21:46 UTC (permalink / raw)
  To: ahiliation; +Cc: acme, bhutchings, netdev, linux-kernel

From: Jeffrin Jose <ahiliation@yahoo.co.in>
Date: Tue,  7 Aug 2012 19:30:20 +0530

> Fixed coding style issue relating to indentation in
> net/appletalk/ddp.c found by checkpatch.pl tool
> 
> Signed-off-by: Jeffrin Jose <ahiliation@yahoo.co.in>

Please just stop trying to fix this code up, it's noise and you
keep making mistakes.

>  	case TIOCOUTQ: {
> -			long amount = sk->sk_sndbuf - sk_wmem_alloc_get(sk);
> +		long amount = sk->sk_sndbuf - sk_wmem_alloc_get(sk);
>  
> -			if (amount < 0)
> -				amount = 0;
> -			rc = put_user(amount, (int __user *)argp);
> -			break;
> +		if (amount < 0)
> +			amount = 0;
> +		rc = put_user(amount, (int __user *)argp);
> +		break;
>  		}

This time you didn't adjust the closing brace, as needed.

I'm not applying this and I seriously discourage you from pursing this
further, it's better you spend your time learning how the kernel works
rather than suffering through this coding style cleanup business.

Thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-08-07 21:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-07 14:00 [PATCH] net:appletalk:ddp:fixed coding style issue again relating to Jeffrin Jose
2012-08-07 14:25 ` Eric W. Biederman
2012-08-07 21:46 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).