Skip to content

Commit

Permalink
net/smc: delete pointless divide by one
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and NipaLocal committed Jan 11, 2025
1 parent 88e80e1 commit 42b7658
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion net/smc/smc_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2155,7 +2155,7 @@ static int smcr_buf_map_link(struct smc_buf_desc *buf_desc, bool is_rmb,
for_each_sg(buf_desc->sgt[lnk->link_idx].sgl, sg, nents, i) {
size = min_t(int, PAGE_SIZE - offset, buf_size);
sg_set_page(sg, vmalloc_to_page(buf), size, offset);
buf += size / sizeof(*buf);
buf += size;
buf_size -= size;
offset = 0;
}
Expand Down
2 changes: 1 addition & 1 deletion net/smc/smc_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ static int smc_rx_splice(struct pipe_inode_info *pipe, char *src, size_t len,
partial[i].offset = offset;
partial[i].len = size;
partial[i].private = (unsigned long)priv[i];
buf += size / sizeof(*buf);
buf += size;
left -= size;
offset = 0;
}
Expand Down

0 comments on commit 42b7658

Please sign in to comment.