rds: remove redundant variable 'sg_off'
authorColin Ian King <colin.king@canonical.com>
Sun, 11 Mar 2018 16:27:56 +0000 (17:27 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 12 Mar 2018 15:12:38 +0000 (11:12 -0400)
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>
Acked-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/rds/message.c

index 4462e4c9bd7dc8c27124e3f3809c309b79f915ed..a35f7697198499eece20e1678f5d003d64bf785a 100644 (file)
@@ -357,7 +357,6 @@ struct rds_message *rds_message_map_pages(unsigned long *page_addrs, unsigned in
 
 static 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 @@ static int rds_message_zcopy_from_user(struct rds_message *rm, struct iov_iter *
         * 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)