Re: [PATCH] drivers: staging: lustre: Use mult if units not specified

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux