mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/8] cxacru: return an empty value for modulation if there is no connection
@ 2009-11-21 15:03 Simon Arlott
  2009-11-21 15:07 ` [PATCH 2/8] cxacru: check data length is not negative Simon Arlott
                   ` (6 more replies)
  0 siblings, 7 replies; 11+ messages in thread
From: Simon Arlott @ 2009-11-21 15:03 UTC (permalink / raw)
  To: Linux Kernel Mailing List, Greg Kroah-Hartman

When there is no connection, return an empty string
instead of "0" for the connection modulation.

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
---
 Documentation/networking/cxacru.txt |    1 +
 drivers/usb/atm/cxacru.c            |    4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/Documentation/networking/cxacru.txt b/Documentation/networking/cxacru.txt
index b074681..3532cee 100644
--- a/Documentation/networking/cxacru.txt
+++ b/Documentation/networking/cxacru.txt
@@ -61,6 +61,7 @@ several sysfs attribute files for retrieving device statistics:
 * mac_address
 
 * modulation
+	"" (when not connected)
 	"ANSI T1.413"
 	"ITU-T G.992.1 (G.DMT)"
 	"ITU-T G.992.2 (G.LITE)"
diff --git a/drivers/usb/atm/cxacru.c b/drivers/usb/atm/cxacru.c
index 56802d2..4a26a6c 100644
--- a/drivers/usb/atm/cxacru.c
+++ b/drivers/usb/atm/cxacru.c
@@ -267,12 +267,12 @@ static ssize_t cxacru_sysfs_showattr_LINE(u32 value, char *buf)
 static ssize_t cxacru_sysfs_showattr_MODU(u32 value, char *buf)
 {
 	static char *str[] = {
-			NULL,
+			"",
 			"ANSI T1.413",
 			"ITU-T G.992.1 (G.DMT)",
 			"ITU-T G.992.2 (G.LITE)"
 	};
-	if (unlikely(value >= ARRAY_SIZE(str) || str[value] == NULL))
+	if (unlikely(value >= ARRAY_SIZE(str)))
 		return snprintf(buf, PAGE_SIZE, "%u\n", value);
 	return snprintf(buf, PAGE_SIZE, "%s\n", str[value]);
 }
-- 
1.6.3.3

-- 
Simon Arlott


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2009-11-21 15:47 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-21 15:03 [PATCH 1/8] cxacru: return an empty value for modulation if there is no connection Simon Arlott
2009-11-21 15:07 ` [PATCH 2/8] cxacru: check data length is not negative Simon Arlott
2009-11-21 15:12 ` [PATCH 3/8] cxacru: check device isn't being removed during sysfs calls Simon Arlott
2009-11-21 15:24   ` Duncan Sands
2009-11-21 15:29     ` Simon Arlott
2009-11-21 15:33       ` [PATCH 3/8 (v2)] " Simon Arlott
2009-11-21 15:12 ` [PATCH 4/8] cxacru: document how to interact with the flash memory Simon Arlott
2009-11-21 15:12 ` [PATCH 5/8] cxacru: firmware writes on OHCI are slow, log progress Simon Arlott
2009-11-21 15:14 ` [PATCH 6/8] cxacru: add write-only sysfs attribute for modem configuration Simon Arlott
2009-11-21 15:15 ` [PATCH 7/8] cxacru: remove cxacru-cf.bin loader Simon Arlott
2009-11-21 15:16 ` [PATCH 8/8] cxacru: increment driver version Simon Arlott

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®