Re: [PATCH] rds: send: Replace sg++ with sg = sg_next(sg)

From: Leon Romanovsky
Date: Wed Jul 08 2020 - 01:34:26 EST


On Wed, Jul 08, 2020 at 03:42:52AM +0000, Xu Wang wrote:
> Replace sg++ with sg = sg_next(sg).
>
> Signed-off-by: Xu Wang <vulab@xxxxxxxxxxx>
> ---
> net/rds/send.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/rds/send.c b/net/rds/send.c
> index 68e2bdb08fd0..57d03a6753de 100644
> --- a/net/rds/send.c
> +++ b/net/rds/send.c
> @@ -387,7 +387,7 @@ int rds_send_xmit(struct rds_conn_path *cp)
> ret -= tmp;
> if (cp->cp_xmit_data_off == sg->length) {
> cp->cp_xmit_data_off = 0;
> - sg++;
> + sg = sg_next(sg);

What about rest cases?

â kernel git:(rdma-next) git grep "sg++" net/rds/
net/rds/message.c: sg++;
net/rds/message.c: sg++;
net/rds/message.c: sg++;
net/rds/send.c: sg++;
net/rds/tcp_send.c: sg++;

Thanks

> cp->cp_xmit_sg++;
> BUG_ON(ret != 0 && cp->cp_xmit_sg ==
> rm->data.op_nents);
> --
> 2.17.1
>