diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2009-05-23 18:18:40 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-05-23 18:18:40 -0400 |
commit | fc05505b77f7900a1bb74fb3f3a4343dee4265a4 (patch) | |
tree | 6517919cb60bd9465078512cacbefd8c77f94b76 /drivers/usb/atm/cxacru.c | |
parent | a2ab67fae1ab9226679495a8d260f4e6555efc5f (diff) | |
parent | 11c79740d3c03cb81f84e98cf2e2dbd8d9bb53cd (diff) |
Merge branch 'ixp4xx' of git://git.kernel.org/pub/scm/linux/kernel/git/chris/linux-2.6 into devel
Diffstat (limited to 'drivers/usb/atm/cxacru.c')
-rw-r--r-- | drivers/usb/atm/cxacru.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/usb/atm/cxacru.c b/drivers/usb/atm/cxacru.c index 6789089e2461..56802d2e994b 100644 --- a/drivers/usb/atm/cxacru.c +++ b/drivers/usb/atm/cxacru.c | |||
@@ -227,8 +227,14 @@ static ssize_t cxacru_sysfs_showattr_s8(s8 value, char *buf) | |||
227 | 227 | ||
228 | static ssize_t cxacru_sysfs_showattr_dB(s16 value, char *buf) | 228 | static ssize_t cxacru_sysfs_showattr_dB(s16 value, char *buf) |
229 | { | 229 | { |
230 | return snprintf(buf, PAGE_SIZE, "%d.%02u\n", | 230 | if (likely(value >= 0)) { |
231 | value / 100, abs(value) % 100); | 231 | return snprintf(buf, PAGE_SIZE, "%u.%02u\n", |
232 | value / 100, value % 100); | ||
233 | } else { | ||
234 | value = -value; | ||
235 | return snprintf(buf, PAGE_SIZE, "-%u.%02u\n", | ||
236 | value / 100, value % 100); | ||
237 | } | ||
232 | } | 238 | } |
233 | 239 | ||
234 | static ssize_t cxacru_sysfs_showattr_bool(u32 value, char *buf) | 240 | static ssize_t cxacru_sysfs_showattr_bool(u32 value, char *buf) |