Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 965bd8b9 authored by Chris Rorvick's avatar Chris Rorvick Committed by Greg Kroah-Hartman
Browse files

drivers: staging: lustre: Use mult if units not specified



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.

Signed-off-by: default avatarChris Rorvick <chris@rorvick.com>
Reviewed-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 054cd837
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1908,7 +1908,7 @@ int lprocfs_write_frac_u64_helper(const char *buffer, unsigned long count,
		units <<= 10;
	}
	/* Specified units override the multiplier */
	if (units)
	if (units > 1)
		mult = mult < 0 ? -units : units;

	frac *= mult;