Re: [PATCHv2] zram: modernize writeback interface
From: Sergey Senozhatsky
Date: Thu Apr 03 2025 - 21:50:58 EST
On (25/04/03 20:39), Brian Geffon wrote:
[..]
> > +static int parse_page_index(char *val, unsigned long nr_pages,
> > + unsigned long *lo, unsigned long *hi)
> > +{
> > + int ret;
> > +
> > + ret = kstrtoul(val, 10, lo);
> > + if (ret)
> > + return ret;
> > + *hi = *lo + 1;
> > + if (*lo >= nr_pages || *hi > nr_pages)
>
> I think you can do just:
> if (*lo >= nr_pages)
>
> The *hi > nr_pages check seems superfluous given the
> assignment directly above this.
Ack, thanks.