From: Chris Rorvick Date: Wed, 17 Dec 2014 04:24:01 +0000 (-0600) Subject: drivers: staging: lustre: Use mult if units not specified X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=965bd8b9f743dfc7fd4175fc5072643d321e55d4;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git 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: Chris Rorvick Reviewed-by: Andreas Dilger Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c index f78a24145329..5aada17c6450 100644 --- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c +++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c @@ -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;