On Mon, Dec 15, 2014 at 11:41:49PM -0600, Chris Rorvick wrote:
> Units can be passed to lprocfs_write_frac_u64_helper() via a suffix
> (e.g., "...K", "...M", etc.) tacked onto the value.  A comment states
> that "specified units override the multiplier," though the multiplier is
> overridden regardless.  Update the conditional logic so that it only
> applies when units are specified.
> 

That introduces a bug.  We need to take the initial '-' into
consideration.  Just remove the condition.  Also remove the "mult"
parameter since that is always 1.

        bool negative = false;

        ...

        if (*pbuf == '-') {
                negative = true;
                pbuf++;
        }

        ...

        mult = negative ? -units : units;


regards,
dan carpenter

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to