[OPW,kernel,v2] Staging: vt6655: Fix Sparse Warning for Static Declarations
diff mbox

Message ID 1381948834-9664-1-git-send-email-rashika.kheria@gmail.com
State Changes Requested
Headers show

Commit Message

Rashika Oct. 16, 2013, 6:40 p.m. UTC
This patch fixes the following Sparse Warnings in rf.c:

drivers/staging/vt6655/rf.c:58:21: warning: symbol 'dwAL2230InitTable' was not declared. Should it be static?
drivers/staging/vt6655/rf.c:76:21: warning: symbol 'dwAL2230ChannelTable0' was not declared. Should it be static?
drivers/staging/vt6655/rf.c:93:21: warning: symbol 'dwAL2230ChannelTable1' was not declared. Should it be static?
drivers/staging/vt6655/rf.c:110:15: warning: symbol 'dwAL2230PowerTable' was not declared. Should it be static?
drivers/staging/vt6655/rf.c:180:21: warning: symbol 'dwAL7230InitTable' was not declared. Should it be static?
drivers/staging/vt6655/rf.c:203:21: warning: symbol 'dwAL7230InitTableAMode' was not declared. Should it be static?
drivers/staging/vt6655/rf.c:222:21: warning: symbol 'dwAL7230ChannelTable0' was not declared. Should it be static?
drivers/staging/vt6655/rf.c:288:21: warning: symbol 'dwAL7230ChannelTable1' was not declared. Should it be static?
drivers/staging/vt6655/rf.c:352:21: warning: symbol 'dwAL7230ChannelTable2' was not declared. Should it be static?
drivers/staging/vt6655/rf.c:431:6: warning: symbol 's_bAL7230Init' was not declared. Should it be static?
drivers/staging/vt6655/rf.c:474:6: warning: symbol 's_bAL7230SelectChannel' was not declared. Should it be static?
drivers/staging/vt6655/rf.c:634:6: warning: symbol 'RFbAL2230Init' was not declared. Should it be static?
drivers/staging/vt6655/rf.c:681:6: warning: symbol 'RFbAL2230SelectChannel' was not declared. Should it be static?
drivers/staging/vt6655/rf.c:791:6: warning: symbol 'RFbShutDown' was not declared. Should it be static?

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
---

This revision fixes the following issues of the previous revision:
Introduction of Build Warning: drivers/staging/vt6655/rf.c:791:13: warning: ‘RFbShutDown’ defined but not used [-Wunused-function]

 drivers/staging/vt6655/rf.c |   56 ++++++++++---------------------------------
 1 file changed, 13 insertions(+), 43 deletions(-)

Comments

Greg KH Oct. 16, 2013, 7:14 p.m. UTC | #1
On Thu, Oct 17, 2013 at 12:10:34AM +0530, Rashika Kheria wrote:
> This patch fixes the following Sparse Warnings in rf.c:
> 
> drivers/staging/vt6655/rf.c:58:21: warning: symbol 'dwAL2230InitTable' was not declared. Should it be static?
> drivers/staging/vt6655/rf.c:76:21: warning: symbol 'dwAL2230ChannelTable0' was not declared. Should it be static?
> drivers/staging/vt6655/rf.c:93:21: warning: symbol 'dwAL2230ChannelTable1' was not declared. Should it be static?
> drivers/staging/vt6655/rf.c:110:15: warning: symbol 'dwAL2230PowerTable' was not declared. Should it be static?
> drivers/staging/vt6655/rf.c:180:21: warning: symbol 'dwAL7230InitTable' was not declared. Should it be static?
> drivers/staging/vt6655/rf.c:203:21: warning: symbol 'dwAL7230InitTableAMode' was not declared. Should it be static?
> drivers/staging/vt6655/rf.c:222:21: warning: symbol 'dwAL7230ChannelTable0' was not declared. Should it be static?
> drivers/staging/vt6655/rf.c:288:21: warning: symbol 'dwAL7230ChannelTable1' was not declared. Should it be static?
> drivers/staging/vt6655/rf.c:352:21: warning: symbol 'dwAL7230ChannelTable2' was not declared. Should it be static?
> drivers/staging/vt6655/rf.c:431:6: warning: symbol 's_bAL7230Init' was not declared. Should it be static?
> drivers/staging/vt6655/rf.c:474:6: warning: symbol 's_bAL7230SelectChannel' was not declared. Should it be static?
> drivers/staging/vt6655/rf.c:634:6: warning: symbol 'RFbAL2230Init' was not declared. Should it be static?
> drivers/staging/vt6655/rf.c:681:6: warning: symbol 'RFbAL2230SelectChannel' was not declared. Should it be static?
> drivers/staging/vt6655/rf.c:791:6: warning: symbol 'RFbShutDown' was not declared. Should it be static?
> 
> Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>

Better, but you are doing two different things in this patch:
	- marking some functions static
	- deleting some functions entirely.

Please split that up into two different patches, as they are two
different things in order to solve these warning issues.

thanks,

greg k-h
Rashika Oct. 16, 2013, 7:16 p.m. UTC | #2
On Thu, Oct 17, 2013 at 12:44 AM, Greg KH <gregkh@linuxfoundation.org>wrote:

> On Thu, Oct 17, 2013 at 12:10:34AM +0530, Rashika Kheria wrote:
> > This patch fixes the following Sparse Warnings in rf.c:
> >
> > drivers/staging/vt6655/rf.c:58:21: warning: symbol 'dwAL2230InitTable'
> was not declared. Should it be static?
> > drivers/staging/vt6655/rf.c:76:21: warning: symbol
> 'dwAL2230ChannelTable0' was not declared. Should it be static?
> > drivers/staging/vt6655/rf.c:93:21: warning: symbol
> 'dwAL2230ChannelTable1' was not declared. Should it be static?
> > drivers/staging/vt6655/rf.c:110:15: warning: symbol 'dwAL2230PowerTable'
> was not declared. Should it be static?
> > drivers/staging/vt6655/rf.c:180:21: warning: symbol 'dwAL7230InitTable'
> was not declared. Should it be static?
> > drivers/staging/vt6655/rf.c:203:21: warning: symbol
> 'dwAL7230InitTableAMode' was not declared. Should it be static?
> > drivers/staging/vt6655/rf.c:222:21: warning: symbol
> 'dwAL7230ChannelTable0' was not declared. Should it be static?
> > drivers/staging/vt6655/rf.c:288:21: warning: symbol
> 'dwAL7230ChannelTable1' was not declared. Should it be static?
> > drivers/staging/vt6655/rf.c:352:21: warning: symbol
> 'dwAL7230ChannelTable2' was not declared. Should it be static?
> > drivers/staging/vt6655/rf.c:431:6: warning: symbol 's_bAL7230Init' was
> not declared. Should it be static?
> > drivers/staging/vt6655/rf.c:474:6: warning: symbol
> 's_bAL7230SelectChannel' was not declared. Should it be static?
> > drivers/staging/vt6655/rf.c:634:6: warning: symbol 'RFbAL2230Init' was
> not declared. Should it be static?
> > drivers/staging/vt6655/rf.c:681:6: warning: symbol
> 'RFbAL2230SelectChannel' was not declared. Should it be static?
> > drivers/staging/vt6655/rf.c:791:6: warning: symbol 'RFbShutDown' was not
> declared. Should it be static?
> >
> > Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
>
> Better, but you are doing two different things in this patch:
>         - marking some functions static
>         - deleting some functions entirely.
>
> Please split that up into two different patches, as they are two
> different things in order to solve these warning issues.
>
> thanks,
>
> greg k-h
>

I will resend the patch series.

Patch
diff mbox

diff --git a/drivers/staging/vt6655/rf.c b/drivers/staging/vt6655/rf.c
index 6948984..ce173cc 100644
--- a/drivers/staging/vt6655/rf.c
+++ b/drivers/staging/vt6655/rf.c
@@ -55,7 +55,7 @@ 
 
 /*---------------------  Static Variables  --------------------------*/
 
-const unsigned long dwAL2230InitTable[CB_AL2230_INIT_SEQ] = {
+static const unsigned long dwAL2230InitTable[CB_AL2230_INIT_SEQ] = {
 	0x03F79000+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, //
 	0x03333100+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, //
 	0x01A00200+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, //
@@ -73,7 +73,7 @@  const unsigned long dwAL2230InitTable[CB_AL2230_INIT_SEQ] = {
 	0x00580F00+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW
 };
 
-const unsigned long dwAL2230ChannelTable0[CB_MAX_CHANNEL] = {
+static const unsigned long dwAL2230ChannelTable0[CB_MAX_CHANNEL] = {
 	0x03F79000+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 1, Tf = 2412MHz
 	0x03F79000+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 2, Tf = 2417MHz
 	0x03E79000+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 3, Tf = 2422MHz
@@ -90,7 +90,7 @@  const unsigned long dwAL2230ChannelTable0[CB_MAX_CHANNEL] = {
 	0x03E7C000+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW  // channel = 14, Tf = 2412M
 };
 
-const unsigned long dwAL2230ChannelTable1[CB_MAX_CHANNEL] = {
+static const unsigned long dwAL2230ChannelTable1[CB_MAX_CHANNEL] = {
 	0x03333100+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 1, Tf = 2412MHz
 	0x0B333100+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 2, Tf = 2417MHz
 	0x03333100+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 3, Tf = 2422MHz
@@ -107,7 +107,7 @@  const unsigned long dwAL2230ChannelTable1[CB_MAX_CHANNEL] = {
 	0x06666100+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW  // channel = 14, Tf = 2412M
 };
 
-unsigned long dwAL2230PowerTable[AL2230_PWR_IDX_LEN] = {
+static unsigned long dwAL2230PowerTable[AL2230_PWR_IDX_LEN] = {
 	0x04040900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
 	0x04041900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
 	0x04042900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
@@ -177,7 +177,7 @@  unsigned long dwAL2230PowerTable[AL2230_PWR_IDX_LEN] = {
 //{{ RobertYu:20050104
 // 40MHz reference frequency
 // Need to Pull PLLON(PE3) low when writing channel registers through 3-wire.
-const unsigned long dwAL7230InitTable[CB_AL7230_INIT_SEQ] = {
+static const unsigned long dwAL7230InitTable[CB_AL7230_INIT_SEQ] = {
 	0x00379000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // Channel1 // Need modify for 11a
 	0x13333100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // Channel1 // Need modify for 11a
 	0x841FF200+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // Need modify for 11a: 451FE2
@@ -200,7 +200,7 @@  const unsigned long dwAL7230InitTable[CB_AL7230_INIT_SEQ] = {
 	0x1ABA8F00+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW  // Need modify for 11a: 12BACF
 };
 
-const unsigned long dwAL7230InitTableAMode[CB_AL7230_INIT_SEQ] = {
+static const unsigned long dwAL7230InitTableAMode[CB_AL7230_INIT_SEQ] = {
 	0x0FF52000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // Channel184 // Need modify for 11b/g
 	0x00000100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // Channel184 // Need modify for 11b/g
 	0x451FE200+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // Need modify for 11b/g
@@ -219,7 +219,7 @@  const unsigned long dwAL7230InitTableAMode[CB_AL7230_INIT_SEQ] = {
 	0x12BACF00+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW  // Need modify for 11b/g
 };
 
-const unsigned long dwAL7230ChannelTable0[CB_MAX_CHANNEL] = {
+static const unsigned long dwAL7230ChannelTable0[CB_MAX_CHANNEL] = {
 	0x00379000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  1, Tf = 2412MHz
 	0x00379000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  2, Tf = 2417MHz
 	0x00379000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  3, Tf = 2422MHz
@@ -285,7 +285,7 @@  const unsigned long dwAL7230ChannelTable0[CB_MAX_CHANNEL] = {
 	0x0FF61000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW  // channel = 165, Tf = 5825MHz (56)
 };
 
-const unsigned long dwAL7230ChannelTable1[CB_MAX_CHANNEL] = {
+static const unsigned long dwAL7230ChannelTable1[CB_MAX_CHANNEL] = {
 	0x13333100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  1, Tf = 2412MHz
 	0x1B333100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  2, Tf = 2417MHz
 	0x03333100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  3, Tf = 2422MHz
@@ -349,7 +349,7 @@  const unsigned long dwAL7230ChannelTable1[CB_MAX_CHANNEL] = {
 	0x02AAA100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW  // channel = 165, Tf = 5825MHz (56)
 };
 
-const unsigned long dwAL7230ChannelTable2[CB_MAX_CHANNEL] = {
+static const unsigned long dwAL7230ChannelTable2[CB_MAX_CHANNEL] = {
 	0x7FD78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  1, Tf = 2412MHz
 	0x7FD78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  2, Tf = 2417MHz
 	0x7FD78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  3, Tf = 2422MHz
@@ -428,7 +428,7 @@  const unsigned long dwAL7230ChannelTable2[CB_MAX_CHANNEL] = {
  * Return Value: true if succeeded; false if failed.
  *
  */
-bool s_bAL7230Init(unsigned long dwIoBase)
+static bool s_bAL7230Init(unsigned long dwIoBase)
 {
 	int     ii;
 	bool bResult;
@@ -471,7 +471,7 @@  bool s_bAL7230Init(unsigned long dwIoBase)
 }
 
 // Need to Pull PLLON low when writing channel registers through 3-wire interface
-bool s_bAL7230SelectChannel(unsigned long dwIoBase, unsigned char byChannel)
+static bool s_bAL7230SelectChannel(unsigned long dwIoBase, unsigned char byChannel)
 {
 	bool bResult;
 
@@ -631,7 +631,7 @@  bool IFRFbWriteEmbedded(unsigned long dwIoBase, unsigned long dwData)
  * Return Value: true if succeeded; false if failed.
  *
  */
-bool RFbAL2230Init(unsigned long dwIoBase)
+static bool RFbAL2230Init(unsigned long dwIoBase)
 {
 	int     ii;
 	bool bResult;
@@ -678,7 +678,7 @@  bool RFbAL2230Init(unsigned long dwIoBase)
 	return bResult;
 }
 
-bool RFbAL2230SelectChannel(unsigned long dwIoBase, unsigned char byChannel)
+static bool RFbAL2230SelectChannel(unsigned long dwIoBase, unsigned char byChannel)
 {
 	bool bResult;
 
@@ -776,36 +776,6 @@  bool RFbInit(
 }
 
 /*
- * Description: RF ShutDown function
- *
- * Parameters:
- *  In:
- *      byBBType
- *      byRFType
- *  Out:
- *      none
- *
- * Return Value: true if succeeded; false if failed.
- *
- */
-bool RFbShutDown(
-	PSDevice  pDevice
-)
-{
-	bool bResult = true;
-
-	switch (pDevice->byRFType) {
-	case RF_AIROHA7230:
-		bResult = IFRFbWriteEmbedded(pDevice->PortOffset, 0x1ABAEF00 + (BY_AL7230_REG_LEN << 3) + IFREGCTL_REGW);
-		break;
-	default:
-		bResult = true;
-		break;
-	}
-	return bResult;
-}
-
-/*
  * Description: Select channel
  *
  * Parameters: