linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][rds-next] rds: remove redundant variable 'sg_off'
@ 2018-03-11 16:27 Colin King
  2018-03-11 16:48 ` [rds-devel] " Sowmini Varadhan
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Colin King @ 2018-03-11 16:27 UTC (permalink / raw)
  To: Santosh Shilimkar, David S . Miller, netdev, linux-rdma, rds-devel
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Variable sg_off is assigned a value but it is never read, hence it is
redundant and can be removed.

Cleans up clang warning:
net/rds/message.c:373:2: warning: Value stored to 'sg_off' is never read

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 net/rds/message.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/net/rds/message.c b/net/rds/message.c
index 90dcdcfe9f62..9c41bdd9e444 100644
--- a/net/rds/message.c
+++ b/net/rds/message.c
@@ -357,7 +357,6 @@ struct rds_message *rds_message_map_pages(unsigned long *page_addrs, unsigned in
 
 int rds_message_zcopy_from_user(struct rds_message *rm, struct iov_iter *from)
 {
-	unsigned long sg_off;
 	struct scatterlist *sg;
 	int ret = 0;
 	int length = iov_iter_count(from);
@@ -370,7 +369,6 @@ int rds_message_zcopy_from_user(struct rds_message *rm, struct iov_iter *from)
 	 * now allocate and copy in the data payload.
 	 */
 	sg = rm->data.op_sg;
-	sg_off = 0; /* Dear gcc, sg->page will be null from kzalloc. */
 
 	info = kzalloc(sizeof(*info), GFP_KERNEL);
 	if (!info)
-- 
2.15.1

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

* Re: [rds-devel] [PATCH][rds-next] rds: remove redundant variable 'sg_off'
  2018-03-11 16:27 [PATCH][rds-next] rds: remove redundant variable 'sg_off' Colin King
@ 2018-03-11 16:48 ` Sowmini Varadhan
  2018-03-12  6:54 ` santosh.shilimkar
  2018-03-12 15:12 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Sowmini Varadhan @ 2018-03-11 16:48 UTC (permalink / raw)
  To: Colin King
  Cc: Santosh Shilimkar, David S . Miller, netdev, linux-rdma,
	rds-devel, kernel-janitors, linux-kernel

On (03/11/18 17:27), Colin King wrote:
> Variable sg_off is assigned a value but it is never read, hence it is
> redundant and can be removed.
> 

Acked-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>

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

* Re: [PATCH][rds-next] rds: remove redundant variable 'sg_off'
  2018-03-11 16:27 [PATCH][rds-next] rds: remove redundant variable 'sg_off' Colin King
  2018-03-11 16:48 ` [rds-devel] " Sowmini Varadhan
@ 2018-03-12  6:54 ` santosh.shilimkar
  2018-03-12 15:12 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: santosh.shilimkar @ 2018-03-12  6:54 UTC (permalink / raw)
  To: Colin King, David S . Miller, netdev, linux-rdma, rds-devel
  Cc: kernel-janitors, linux-kernel

On 3/11/18 9:27 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Variable sg_off is assigned a value but it is never read, hence it is
> redundant and can be removed.
> 
> Cleans up clang warning:
> net/rds/message.c:373:2: warning: Value stored to 'sg_off' is never read
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   net/rds/message.c | 2 --
>   1 file changed, 2 deletions(-)
> 
Thanks Colin !!

Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>

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

* Re: [PATCH][rds-next] rds: remove redundant variable 'sg_off'
  2018-03-11 16:27 [PATCH][rds-next] rds: remove redundant variable 'sg_off' Colin King
  2018-03-11 16:48 ` [rds-devel] " Sowmini Varadhan
  2018-03-12  6:54 ` santosh.shilimkar
@ 2018-03-12 15:12 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2018-03-12 15:12 UTC (permalink / raw)
  To: colin.king
  Cc: santosh.shilimkar, netdev, linux-rdma, rds-devel,
	kernel-janitors, linux-kernel

From: Colin King <colin.king@canonical.com>
Date: Sun, 11 Mar 2018 17:27:56 +0100

> From: Colin Ian King <colin.king@canonical.com>
> 
> Variable sg_off is assigned a value but it is never read, hence it is
> redundant and can be removed.
> 
> Cleans up clang warning:
> net/rds/message.c:373:2: warning: Value stored to 'sg_off' is never read
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Applied.

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

end of thread, other threads:[~2018-03-12 15:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-11 16:27 [PATCH][rds-next] rds: remove redundant variable 'sg_off' Colin King
2018-03-11 16:48 ` [rds-devel] " Sowmini Varadhan
2018-03-12  6:54 ` santosh.shilimkar
2018-03-12 15:12 ` 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).