Skip to content

Commit d788c59

Browse files
Javier Gonzálezaxboe
authored andcommitted
lightnvm: fix type checks on rrpc
sector_t is always unsigned, therefore avoid < 0 checks on it. Signed-off-by: Javier González <[email protected]> Signed-off-by: Matias Bjørling <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 5d30f3b commit d788c59

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/lightnvm/rrpc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,7 @@ static int rrpc_read_ppalist_rq(struct rrpc *rrpc, struct bio *bio,
817817

818818
for (i = 0; i < npages; i++) {
819819
/* We assume that mapping occurs at 4KB granularity */
820-
BUG_ON(!(laddr + i >= 0 && laddr + i < rrpc->nr_sects));
820+
BUG_ON(!(laddr + i < rrpc->nr_sects));
821821
gp = &rrpc->trans_map[laddr + i];
822822

823823
if (gp->rblk) {
@@ -846,7 +846,7 @@ static int rrpc_read_rq(struct rrpc *rrpc, struct bio *bio, struct nvm_rq *rqd,
846846
if (!is_gc && rrpc_lock_rq(rrpc, bio, rqd))
847847
return NVM_IO_REQUEUE;
848848

849-
BUG_ON(!(laddr >= 0 && laddr < rrpc->nr_sects));
849+
BUG_ON(!(laddr < rrpc->nr_sects));
850850
gp = &rrpc->trans_map[laddr];
851851

852852
if (gp->rblk) {

0 commit comments

Comments
 (0)