[PATCH] Fix unused variable build errors.

Vinson Lee <[email protected]>
Newsgroups org.kernel.vger.trinity
Message-ID <[email protected]>
From: Vinson Lee <[email protected]>

This patch fixes these build errors on CentOS 6.

  CC	net/caif_setsockopt.o
cc1: warnings being treated as errors
net/caif_setsockopt.c: In function ‘caif_setsockopt’:
net/caif_setsockopt.c:20: error: unused variable ‘val’

  CC	net/rds_setsockopt.o
cc1: warnings being treated as errors
net/rds_setsockopt.c: In function ‘rds_setsockopt’:
net/rds_setsockopt.c:23: error: unused variable ‘val’

Signed-off-by: Vinson Lee <[email protected]>
---
 net/caif_setsockopt.c |    2 ++
 net/rds_setsockopt.c  |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/net/caif_setsockopt.c b/net/caif_setsockopt.c
index fcc42c0..c829521 100644
--- a/net/caif_setsockopt.c
+++ b/net/caif_setsockopt.c
@@ -17,7 +17,9 @@ static const unsigned int caif_opts[] = { CAIFSO_LINK_SELECT, CAIFSO_REQ_PARAM }
 
 void caif_setsockopt(struct sockopt *so)
 {
+#ifdef USE_CAIF
 	unsigned char val;
+#endif
 
 	so->level = SOL_CAIF;
 
diff --git a/net/rds_setsockopt.c b/net/rds_setsockopt.c
index 25b6c8b..6ad6e2a 100644
--- a/net/rds_setsockopt.c
+++ b/net/rds_setsockopt.c
@@ -20,7 +20,9 @@ static const unsigned int rds_opts[] = {
 
 void rds_setsockopt(struct sockopt *so)
 {
+#ifdef USE_RDS
 	unsigned char val;
+#endif
 
 	so->level = SOL_RDS;
 #ifdef USE_RDS
-- 
1.7.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.