public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] staging/otus: fix some sparse waring.
@ 2009-11-22 22:00 Thiago Farina
  2009-12-02 12:59 ` Thiago Farina
  0 siblings, 1 reply; 3+ messages in thread
From: Thiago Farina @ 2009-11-22 22:00 UTC (permalink / raw)
  To: linux-kernel; +Cc: greg, otus-devel, Luiz.Rodrigues, Thiago Farina

*apdbg.c: use NULL pointer instead of 0 interger. Also make two functions private.

Signed-off-by: Thiago Farina <tfransosi@gmail.com>
---
 drivers/staging/otus/apdbg.c |   53 +++++++++++++++++++----------------------
 1 files changed, 25 insertions(+), 28 deletions(-)

diff --git a/drivers/staging/otus/apdbg.c b/drivers/staging/otus/apdbg.c
index 0eb93f1..b59028e 100644
--- a/drivers/staging/otus/apdbg.c
+++ b/drivers/staging/otus/apdbg.c
@@ -90,8 +90,27 @@ struct zdap_ioctl {
 
 #endif
 
-char hex(char);
-unsigned char asctohex(char *str);
+static char hex(char v)
+{
+	if (isdigit(v))
+		return v - '0';
+	else if (isxdigit(v))
+		return tolower(v) - 'a' + 10;
+	else
+		return 0;
+}
+
+static unsigned char asctohex(char *str)
+{
+	unsigned char value;
+
+	value = hex(*str) & 0x0f;
+	value = value << 4;
+	str++;
+	value |= hex(*str) & 0x0f;
+
+	return value;
+}
 
 char *prgname;
 
@@ -109,10 +128,10 @@ int set_ioctl(int sock, struct ifreq *req)
 
 int read_reg(int sock, struct ifreq *req)
 {
-	struct zdap_ioctl *zdreq = 0;
+	struct zdap_ioctl *zdreq = NULL;
 
 	if (!set_ioctl(sock, req))
-			return -1;
+		return -1;
 
 	/*
 	 * zdreq = (struct zdap_ioctl *)req->ifr_data;
@@ -125,7 +144,7 @@ int read_reg(int sock, struct ifreq *req)
 
 int read_mem(int sock, struct ifreq *req)
 {
-	struct zdap_ioctl *zdreq = 0;
+	struct zdap_ioctl *zdreq = NULL;
 	int i;
 
 	if (!set_ioctl(sock, req))
@@ -368,7 +387,7 @@ int main(int argc, char **argv)
 
 		zdreq.addr = addr;
 		zdreq.cmd = ZM_IOCTL_SET_PIBSS_MODE;
-	} else 	{
+	} else {
 		fprintf(stderr, "error action\n");
 		exit(1);
 	}
@@ -380,25 +399,3 @@ fail:
 	exit(0);
 }
 
-unsigned char asctohex(char *str)
-{
-	unsigned char value;
-
-	value = hex(*str) & 0x0f;
-	value = value << 4;
-	str++;
-	value |= hex(*str) & 0x0f;
-
-	return value;
-}
-
-char hex(char v)
-{
-	if (isdigit(v))
-		return v - '0';
-	else if (isxdigit(v))
-		return tolower(v) - 'a' + 10;
-	else
-		return 0;
-}
-
-- 
1.6.5.2.180.gc5b3e


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

* Re: [PATCH v3] staging/otus: fix some sparse waring.
  2009-11-22 22:00 [PATCH v3] staging/otus: fix some sparse waring Thiago Farina
@ 2009-12-02 12:59 ` Thiago Farina
  2009-12-02 16:05   ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Thiago Farina @ 2009-12-02 12:59 UTC (permalink / raw)
  To: greg; +Cc: linux-kernel, otus-devel, Luiz.Rodrigues, Thiago Farina

Ping?

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

* Re: [PATCH v3] staging/otus: fix some sparse waring.
  2009-12-02 12:59 ` Thiago Farina
@ 2009-12-02 16:05   ` Greg KH
  0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2009-12-02 16:05 UTC (permalink / raw)
  To: Thiago Farina; +Cc: linux-kernel, otus-devel, Luiz.Rodrigues

On Wed, Dec 02, 2009 at 10:59:51AM -0200, Thiago Farina wrote:
> Ping?

It's still in my "to-apply" queue, still digging out after the holidays
last week.

thanks for your patience,

greg k-h

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

end of thread, other threads:[~2009-12-02 16:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-22 22:00 [PATCH v3] staging/otus: fix some sparse waring Thiago Farina
2009-12-02 12:59 ` Thiago Farina
2009-12-02 16:05   ` Greg KH

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