Skip to contentSkip to conversation

staging: dgap: Fixed sparse error: same symbol redeclared with different type

PATCH In review Masood Mehmood 2 participants 5 messages Mar 10, 2014 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 staging: dgap: Fixed sparse error: same symbol redeclared with different type

sparse reported dgap_do_fep_load is redeclared with different type. while fixing, I noticed __user attribute is used incorrectly in declaration. There is no need to define __user for firware->data.

Replaced the __user with 'const uchar *' from function dgap_do_fep_load and did the same for function dgap_do_bios_load.

---
 drivers/staging/dgap/dgap.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
drivers/staging/dgap/dgap.c +6 -7
index d00283a..ab81479 100644
@@ -210,9 +210,8 @@ static uint dgap_config_get_useintr(struct board_t *bd);
 static uint dgap_config_get_altpin(struct board_t *bd);
 
 static int dgap_ms_sleep(ulong ms);
-static void dgap_do_bios_load(struct board_t *brd, uchar __user *ubios,
-				int len);
-static void dgap_do_fep_load(struct board_t *brd, uchar __user *ufep, int len);
+static void dgap_do_bios_load(struct board_t *brd, const uchar *ubios, int len);
+static void dgap_do_fep_load(struct board_t *brd, const uchar *ufep, int len);
 #ifdef DIGI_CONCENTRATORS_SUPPORTED
 static void dgap_do_conc_load(struct board_t *brd, uchar *uaddr, int len);
 #endif
@@ -935,7 +934,7 @@ static int dgap_firmware_load(struct pci_dev *pdev, int card_type)
 				fw_info[card_type].bios_name);
 			return ret;
 		}
-		dgap_do_bios_load(brd, (char *)fw->data, fw->size);
+		dgap_do_bios_load(brd, fw->data, fw->size);
 		release_firmware(fw);
 
 		/* Wait for BIOS to test board... */
@@ -953,7 +952,7 @@ static int dgap_firmware_load(struct pci_dev *pdev, int card_type)
 				fw_info[card_type].fep_name);
 			return ret;
 		}
-		dgap_do_fep_load(brd, (char *)fw->data, fw->size);
+		dgap_do_fep_load(brd, fw->data, fw->size);
 		release_firmware(fw);
 
 		/* Wait for FEP to load on board... */
@@ -4349,7 +4348,7 @@ static int dgap_tty_register_ports(struct board_t *brd)
  * Copies the BIOS code from the user to the board,
  * and starts the BIOS running.
  */
-static void dgap_do_bios_load(struct board_t *brd, uchar __user *ubios, int len)
+static void dgap_do_bios_load(struct board_t *brd, const uchar *ubios, int len)
 {
 	uchar *addr;
 	uint offset;
@@ -4425,7 +4424,7 @@ static void dgap_do_wait_for_bios(struct board_t *brd)
  * Copies the FEP code from the user to the board,
  * and starts the FEP running.
  */
-static void dgap_do_fep_load(struct board_t *brd, uchar *ufep, int len)
+static void dgap_do_fep_load(struct board_t *brd, const uchar *ufep, int len)
 {
 	uchar *addr;
 	uint offset;
Signature · 1 line
1.8.3.1
maintainer
#1 lore raw
Quoted 11 lines · Masood Mehmood

sparse reported dgap_do_fep_load is redeclared with different type. while fixing, I noticed __user attribute is used incorrectly in declaration. There is no need to define __user for firware->data.

Replaced the __user with 'const uchar *' from function dgap_do_fep_load and did the same for function dgap_do_bios_load.

---
 drivers/staging/dgap/dgap.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

I don't see a patch 1/2 here, did you forget to send it to me?

thanks,

greg k-h

#2 lore raw
Quoted 4 lines · Greg KH
Quoted 1 line · Masood Mehmood
 1 file changed, 6 insertions(+), 7 deletions(-)

I don't see a patch 1/2 here, did you forget to send it to me?

Patch 1/2 has some unrelated changes. My bad, I forgot to remove it before sending. Should I send a new patch or it will work as it is?

Thanks,

--
Masood

maintainer
#3 lore raw
Quoted 8 lines · Masood Mehmood
Quoted 4 lines · Greg KH
Quoted 1 line · Masood Mehmood
 1 file changed, 6 insertions(+), 7 deletions(-)

I don't see a patch 1/2 here, did you forget to send it to me?

Patch 1/2 has some unrelated changes. My bad, I forgot to remove it before sending. Should I send a new patch or it will work as it is?

Please resend, otherwise I'll be confused again when I go to look at patches to apply in a day or so...

thanks,

greg k-h

#4 lore raw
Quoted 5 lines · Greg KH
Quoted 4 lines · Masood Mehmood
Quoted 3 lines · Greg KH
Quoted 1 line · Masood Mehmood
 1 file changed, 6 insertions(+), 7 deletions(-)
Quoted 7 lines
Quoted 4 lines
Quoted 1 line

I don't see a patch 1/2 here, did you forget to send it to me?

Patch 1/2 has some unrelated changes. My bad, I forgot to remove it before sending. Should I send a new patch or it will work as it is?

Please resend, otherwise I'll be confused again when I go to look at patches to apply in a day or so...

No poblem, resending it now.

Thanks,

--Masood