LKML Archive on lore.kernel.org
 help / Atom feed
* [PATCH 0/3] net: remove unneeded variable for return value
@ 2018-08-07 11:20 zhong jiang
  2018-08-07 11:20 ` [PATCH 1/3] net:svc_rdma_transport: remove unneeded variable 'ret' in rdma_listen_handler zhong jiang
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: zhong jiang @ 2018-08-07 11:20 UTC (permalink / raw)
  To: davem, anna.schumaker; +Cc: netdev, linux-kernel


zhong jiang (3):
  net:svc_rdma_transport: remove unneeded variable 'ret' in
    rdma_listen_handler
  net:af_iucv: get rid of the unneeded variable 'err' in
    afiucv_pm_freeze
  net:mod: remove unneeded variable 'ret' in init_p9

 net/9p/mod.c                             | 4 +---
 net/iucv/af_iucv.c                       | 3 +--
 net/sunrpc/xprtrdma/svc_rdma_transport.c | 3 +--
 3 files changed, 3 insertions(+), 7 deletions(-)

-- 
1.7.12.4


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

* [PATCH 1/3] net:svc_rdma_transport: remove unneeded variable 'ret' in rdma_listen_handler
  2018-08-07 11:20 [PATCH 0/3] net: remove unneeded variable for return value zhong jiang
@ 2018-08-07 11:20 ` zhong jiang
  2018-08-07 14:49   ` Anna Schumaker
  2018-08-07 11:20 ` [PATCH 2/3] net:af_iucv: get rid of the unneeded variable 'err' in afiucv_pm_freeze zhong jiang
  2018-08-07 11:20 ` [PATCH 3/3] net:mod: remove unneeded variable 'ret' in init_p9 zhong jiang
  2 siblings, 1 reply; 8+ messages in thread
From: zhong jiang @ 2018-08-07 11:20 UTC (permalink / raw)
  To: davem, anna.schumaker; +Cc: netdev, linux-kernel

The ret is not modified after initalization, So just remove the variable
and return 0.

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
 net/sunrpc/xprtrdma/svc_rdma_transport.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c
index 547b2cd..2848caf 100644
--- a/net/sunrpc/xprtrdma/svc_rdma_transport.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c
@@ -296,7 +296,6 @@ static int rdma_listen_handler(struct rdma_cm_id *cma_id,
 			       struct rdma_cm_event *event)
 {
 	struct sockaddr *sap = (struct sockaddr *)&cma_id->route.addr.src_addr;
-	int ret = 0;
 
 	trace_svcrdma_cm_event(event, sap);
 
@@ -315,7 +314,7 @@ static int rdma_listen_handler(struct rdma_cm_id *cma_id,
 		break;
 	}
 
-	return ret;
+	return 0;
 }
 
 static int rdma_cma_handler(struct rdma_cm_id *cma_id,
-- 
1.7.12.4


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

* [PATCH 2/3] net:af_iucv: get rid of the unneeded variable 'err' in afiucv_pm_freeze
  2018-08-07 11:20 [PATCH 0/3] net: remove unneeded variable for return value zhong jiang
  2018-08-07 11:20 ` [PATCH 1/3] net:svc_rdma_transport: remove unneeded variable 'ret' in rdma_listen_handler zhong jiang
@ 2018-08-07 11:20 ` zhong jiang
  2018-08-08 16:41   ` David Miller
  2018-08-07 11:20 ` [PATCH 3/3] net:mod: remove unneeded variable 'ret' in init_p9 zhong jiang
  2 siblings, 1 reply; 8+ messages in thread
From: zhong jiang @ 2018-08-07 11:20 UTC (permalink / raw)
  To: davem, anna.schumaker; +Cc: netdev, linux-kernel

We will not use the variable 'err' after initalization, So remove it and
return 0.

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
 net/iucv/af_iucv.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c
index 92ee91e..a21d8ed 100644
--- a/net/iucv/af_iucv.c
+++ b/net/iucv/af_iucv.c
@@ -150,7 +150,6 @@ static int afiucv_pm_freeze(struct device *dev)
 {
 	struct iucv_sock *iucv;
 	struct sock *sk;
-	int err = 0;
 
 #ifdef CONFIG_PM_DEBUG
 	printk(KERN_WARNING "afiucv_pm_freeze\n");
@@ -175,7 +174,7 @@ static int afiucv_pm_freeze(struct device *dev)
 		skb_queue_purge(&iucv->backlog_skb_q);
 	}
 	read_unlock(&iucv_sk_list.lock);
-	return err;
+	return 0;
 }
 
 /**
-- 
1.7.12.4


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

* [PATCH 3/3] net:mod: remove unneeded variable 'ret' in init_p9
  2018-08-07 11:20 [PATCH 0/3] net: remove unneeded variable for return value zhong jiang
  2018-08-07 11:20 ` [PATCH 1/3] net:svc_rdma_transport: remove unneeded variable 'ret' in rdma_listen_handler zhong jiang
  2018-08-07 11:20 ` [PATCH 2/3] net:af_iucv: get rid of the unneeded variable 'err' in afiucv_pm_freeze zhong jiang
@ 2018-08-07 11:20 ` zhong jiang
  2018-08-08 16:41   ` David Miller
  2 siblings, 1 reply; 8+ messages in thread
From: zhong jiang @ 2018-08-07 11:20 UTC (permalink / raw)
  To: davem, anna.schumaker; +Cc: netdev, linux-kernel

The ret is modified after initalization, so just remove it and
return 0.

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
 net/9p/mod.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/net/9p/mod.c b/net/9p/mod.c
index eb9777f..253ba82 100644
--- a/net/9p/mod.c
+++ b/net/9p/mod.c
@@ -171,13 +171,11 @@ void v9fs_put_trans(struct p9_trans_module *m)
  */
 static int __init init_p9(void)
 {
-	int ret = 0;
-
 	p9_error_init();
 	pr_info("Installing 9P2000 support\n");
 	p9_trans_fd_init();
 
-	return ret;
+	return 0;
 }
 
 /**
-- 
1.7.12.4


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

* Re: [PATCH 1/3] net:svc_rdma_transport: remove unneeded variable 'ret' in rdma_listen_handler
  2018-08-07 11:20 ` [PATCH 1/3] net:svc_rdma_transport: remove unneeded variable 'ret' in rdma_listen_handler zhong jiang
@ 2018-08-07 14:49   ` Anna Schumaker
  2018-08-09 20:06     ` J. Bruce Fields
  0 siblings, 1 reply; 8+ messages in thread
From: Anna Schumaker @ 2018-08-07 14:49 UTC (permalink / raw)
  To: zhong jiang, davem, J. Bruce Fields; +Cc: netdev, linux-kernel

(Adding Bruce since he takes nfs / sunrpc server patches)

On 08/07/2018 07:20 AM, zhong jiang wrote:
> The ret is not modified after initalization, So just remove the variable
> and return 0.
> 
> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
> ---
>  net/sunrpc/xprtrdma/svc_rdma_transport.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c
> index 547b2cd..2848caf 100644
> --- a/net/sunrpc/xprtrdma/svc_rdma_transport.c
> +++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c
> @@ -296,7 +296,6 @@ static int rdma_listen_handler(struct rdma_cm_id *cma_id,
>  			       struct rdma_cm_event *event)
>  {
>  	struct sockaddr *sap = (struct sockaddr *)&cma_id->route.addr.src_addr;
> -	int ret = 0;
>  
>  	trace_svcrdma_cm_event(event, sap);
>  
> @@ -315,7 +314,7 @@ static int rdma_listen_handler(struct rdma_cm_id *cma_id,
>  		break;
>  	}
>  
> -	return ret;
> +	return 0;
>  }
>  
>  static int rdma_cma_handler(struct rdma_cm_id *cma_id,
> 

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

* Re: [PATCH 2/3] net:af_iucv: get rid of the unneeded variable 'err' in afiucv_pm_freeze
  2018-08-07 11:20 ` [PATCH 2/3] net:af_iucv: get rid of the unneeded variable 'err' in afiucv_pm_freeze zhong jiang
@ 2018-08-08 16:41   ` David Miller
  0 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2018-08-08 16:41 UTC (permalink / raw)
  To: zhongjiang; +Cc: anna.schumaker, netdev, linux-kernel

From: zhong jiang <zhongjiang@huawei.com>
Date: Tue, 7 Aug 2018 19:20:08 +0800

> We will not use the variable 'err' after initalization, So remove it and
> return 0.
> 
> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
>
Applied to net-next.

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

* Re: [PATCH 3/3] net:mod: remove unneeded variable 'ret' in init_p9
  2018-08-07 11:20 ` [PATCH 3/3] net:mod: remove unneeded variable 'ret' in init_p9 zhong jiang
@ 2018-08-08 16:41   ` David Miller
  0 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2018-08-08 16:41 UTC (permalink / raw)
  To: zhongjiang; +Cc: anna.schumaker, netdev, linux-kernel

From: zhong jiang <zhongjiang@huawei.com>
Date: Tue, 7 Aug 2018 19:20:09 +0800

> The ret is modified after initalization, so just remove it and
> return 0.
> 
> Signed-off-by: zhong jiang <zhongjiang@huawei.com>

Applied to net-next

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

* Re: [PATCH 1/3] net:svc_rdma_transport: remove unneeded variable 'ret' in rdma_listen_handler
  2018-08-07 14:49   ` Anna Schumaker
@ 2018-08-09 20:06     ` J. Bruce Fields
  0 siblings, 0 replies; 8+ messages in thread
From: J. Bruce Fields @ 2018-08-09 20:06 UTC (permalink / raw)
  To: Anna Schumaker; +Cc: zhong jiang, davem, netdev, linux-kernel

On Tue, Aug 07, 2018 at 10:49:11AM -0400, Anna Schumaker wrote:
> (Adding Bruce since he takes nfs / sunrpc server patches)

Applied, thanks.--b.

> 
> On 08/07/2018 07:20 AM, zhong jiang wrote:
> > The ret is not modified after initalization, So just remove the variable
> > and return 0.
> > 
> > Signed-off-by: zhong jiang <zhongjiang@huawei.com>
> > ---
> >  net/sunrpc/xprtrdma/svc_rdma_transport.c | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> > 
> > diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c
> > index 547b2cd..2848caf 100644
> > --- a/net/sunrpc/xprtrdma/svc_rdma_transport.c
> > +++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c
> > @@ -296,7 +296,6 @@ static int rdma_listen_handler(struct rdma_cm_id *cma_id,
> >  			       struct rdma_cm_event *event)
> >  {
> >  	struct sockaddr *sap = (struct sockaddr *)&cma_id->route.addr.src_addr;
> > -	int ret = 0;
> >  
> >  	trace_svcrdma_cm_event(event, sap);
> >  
> > @@ -315,7 +314,7 @@ static int rdma_listen_handler(struct rdma_cm_id *cma_id,
> >  		break;
> >  	}
> >  
> > -	return ret;
> > +	return 0;
> >  }
> >  
> >  static int rdma_cma_handler(struct rdma_cm_id *cma_id,
> > 

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

end of thread, back to index

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-07 11:20 [PATCH 0/3] net: remove unneeded variable for return value zhong jiang
2018-08-07 11:20 ` [PATCH 1/3] net:svc_rdma_transport: remove unneeded variable 'ret' in rdma_listen_handler zhong jiang
2018-08-07 14:49   ` Anna Schumaker
2018-08-09 20:06     ` J. Bruce Fields
2018-08-07 11:20 ` [PATCH 2/3] net:af_iucv: get rid of the unneeded variable 'err' in afiucv_pm_freeze zhong jiang
2018-08-08 16:41   ` David Miller
2018-08-07 11:20 ` [PATCH 3/3] net:mod: remove unneeded variable 'ret' in init_p9 zhong jiang
2018-08-08 16:41   ` David Miller

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org linux-kernel@archiver.kernel.org
	public-inbox-index lkml


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox