Skip to content

Commit

Permalink
lightnvm: fix type checks on rrpc
Browse files Browse the repository at this point in the history
sector_t is always unsigned, therefore avoid < 0 checks on it.

Signed-off-by: Javier González <javier@cnexlabs.com>
Signed-off-by: Matias Bjørling <matias@cnexlabs.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
  • Loading branch information
Javier González authored and Jens Axboe committed Apr 16, 2017
1 parent 5d30f3b commit d788c59
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/lightnvm/rrpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ static int rrpc_read_ppalist_rq(struct rrpc *rrpc, struct bio *bio,

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

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

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

if (gp->rblk) {
Expand Down

0 comments on commit d788c59

Please sign in to comment.