summaryrefslogtreecommitdiff
path: root/drivers/lightnvm/pblk-gc.c
diff options
context:
space:
mode:
authorJavier González <jg@lightnvm.io>2017-06-30 18:56:34 +0300
committerJens Axboe <axboe@kernel.dk>2017-06-30 20:08:18 +0300
commitf417aa0bd8c4b8fd3fecbc23819a994436709dcc (patch)
tree7174de496c5ed3bf3bf0eae242c23e277179473c /drivers/lightnvm/pblk-gc.c
parenta2b93775002bc12ff7a61c7d622de07f553f0d53 (diff)
downloadlinux-f417aa0bd8c4b8fd3fecbc23819a994436709dcc.tar.xz
lightnvm: pblk: fix bad le64 assignations
Use the right types and conversions on le64 variables. Reported by sparse. Signed-off-by: Javier González <javier@cnexlabs.com> Signed-off-by: Matias Bjørling <matias@cnexlabs.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/lightnvm/pblk-gc.c')
-rw-r--r--drivers/lightnvm/pblk-gc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/lightnvm/pblk-gc.c b/drivers/lightnvm/pblk-gc.c
index 1d289242ab92..9b4059b93855 100644
--- a/drivers/lightnvm/pblk-gc.c
+++ b/drivers/lightnvm/pblk-gc.c
@@ -314,10 +314,13 @@ static struct pblk_line *pblk_gc_get_victim_line(struct pblk *pblk,
struct list_head *group_list)
{
struct pblk_line *line, *victim;
+ int line_vsc, victim_vsc;
victim = list_first_entry(group_list, struct pblk_line, list);
list_for_each_entry(line, group_list, list) {
- if (*line->vsc < *victim->vsc)
+ line_vsc = le32_to_cpu(*line->vsc);
+ victim_vsc = le32_to_cpu(*victim->vsc);
+ if (line_vsc < victim_vsc)
victim = line;
}