Skip to content

Commit d1185ba

Browse files
Dan CarpenterNipaLocal
Dan Carpenter
authored and
NipaLocal
committed
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 <[email protected]> Reviewed-by: Simon Horman <[email protected]> Reviewed-by: Kalesh AP <[email protected]> Signed-off-by: NipaLocal <nipa@local>
1 parent 3a97dcc commit d1185ba

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
@@ -197,7 +197,7 @@ static int smc_rx_splice(struct pipe_inode_info *pipe, char *src, size_t len,
197197
partial[i].offset = offset;
198198
partial[i].len = size;
199199
partial[i].private = (unsigned long)priv[i];
200-
buf += size / sizeof(*buf);
200+
buf += size;
201201
left -= size;
202202
offset = 0;
203203
}

0 commit comments

Comments
 (0)