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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/