From: Chris Rorvick <chris@rorvick.com>
To: Oleg Drokin <oleg.drokin@intel.com>,
Andreas Dilger <andreas.dilger@intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Chris Rorvick <chris@rorvick.com>,
Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>,
Julia Lawall <Julia.Lawall@lip6.fr>,
Greg Donald <gdonald@gmail.com>,
"John L. Hammond" <john.hammond@intel.com>,
Andriy Skulysh <Andriy_Skulysh@xyratex.com>,
Fabian Frederick <fabf@skynet.be>,
James Simmons <uja.ornl@gmail.com>,
HPDD-discuss@ml01.01.org, devel@driverdev.osuosl.org,
linux-kernel@vger.kernel.org
Subject: [PATCH v4 1/2] staging: lustre: Use mult if units not specified
Date: Sun, 11 Jan 2015 17:42:28 -0600 [thread overview]
Message-ID: <1421019749-25110-2-git-send-email-chris@rorvick.com> (raw)
In-Reply-To: <1421019749-25110-1-git-send-email-chris@rorvick.com>
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 <chris@rorvick.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
---
drivers/staging/lustre/lustre/obdclass/lprocfs_status.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
index 3b7dfc3..a7b270e 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;
--
2.1.0
next prev parent reply other threads:[~2015-01-11 23:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-11 23:42 [PATCH v4 0/2] lprocfs_write_frac_u64_helper cleanup Chris Rorvick
2015-01-11 23:42 ` Chris Rorvick [this message]
2015-01-11 23:42 ` [PATCH v4 2/2] staging: lustre: Track sign separately Chris Rorvick
2015-01-13 10:30 ` [PATCH v4 0/2] lprocfs_write_frac_u64_helper cleanup Dan Carpenter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1421019749-25110-2-git-send-email-chris@rorvick.com \
--to=chris@rorvick.com \
--cc=Andriy_Skulysh@xyratex.com \
--cc=HPDD-discuss@ml01.01.org \
--cc=Julia.Lawall@lip6.fr \
--cc=andreas.dilger@intel.com \
--cc=devel@driverdev.osuosl.org \
--cc=fabf@skynet.be \
--cc=gdonald@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=john.hammond@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=oleg.drokin@intel.com \
--cc=rickard_strandqvist@spectrumdigital.se \
--cc=uja.ornl@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox