diff options
author | David Woodhouse <David.Woodhouse@intel.com> | 2009-06-08 07:21:27 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2009-06-08 07:21:27 -0400 |
commit | e635a01ea0a16cf7cd31ecd2305870385dca9be6 (patch) | |
tree | c7153e7dee5caf6ac90d85694ff27e4d0b606290 /drivers/usb/atm/cxacru.c | |
parent | 143070e74630b9557e1bb64d899ff2cc5a1dcb48 (diff) | |
parent | 947391cfbaa3b08558844c0b187bcd0223c3f660 (diff) |
Merge branch 'next-mtd' of git://aeryn.fluff.org.uk/bjdooks/linux
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) |