Skip to content

Commit 6c1ea19

Browse files
author
Mete Durlu
committed
net/smc: delete pointless divide by one
JIRA: https://issues.redhat.com/browse/RHEL-99989 commit 10bc976 Author: Dan Carpenter <dan.carpenter@linaro.org> Date: Wed Jan 8 12:26:06 2025 +0300 net/smc: delete pointless divide by one Here "buf" is a void pointer so sizeof(*buf) is one. Doing a divide by one makes the code less readable. Delete it. Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Simon Horman <horms@kernel.org> Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com> Link: https://patch.msgid.link/ee1a790b-f874-4512-b3ae-9c45f99dc640@stanley.mountain Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Mahanta Jambigi <mjambigi@linux.ibm.com> Signed-off-by: Mete Durlu <mdurlu@redhat.com>
1 parent a5ddf5a commit 6c1ea19

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

net/smc/smc_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2155,7 +2155,7 @@ static int smcr_buf_map_link(struct smc_buf_desc *buf_desc, bool is_rmb,
21552155
for_each_sg(buf_desc->sgt[lnk->link_idx].sgl, sg, nents, i) {
21562156
size = min_t(int, PAGE_SIZE - offset, buf_size);
21572157
sg_set_page(sg, vmalloc_to_page(buf), size, offset);
2158-
buf += size / sizeof(*buf);
2158+
buf += size;
21592159
buf_size -= size;
21602160
offset = 0;
21612161
}

net/smc/smc_rx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ static int smc_rx_splice(struct pipe_inode_info *pipe, char *src, size_t len,
196196
partial[i].offset = offset;
197197
partial[i].len = size;
198198
partial[i].private = (unsigned long)priv[i];
199-
buf += size / sizeof(*buf);
199+
buf += size;
200200
left -= size;
201201
offset = 0;
202202
}

0 commit comments

Comments
 (0)