Skip to contentSkip to conversation

staging: kpc2000: kpc_dma: fix symbol 'kpc_dma_add_device' was not declared.

PATCH Superseded Valerio Genovese 3 participants 4 messages Jun 5, 2019 Staging

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: kpc2000: kpc_dma: fix symbol 'kpc_dma_add_device' was not declared.

This was reported by sparse:
drivers/staging/kpc2000/kpc_dma/kpc_dma_driver.c:39:7: warning: symbol 'kpc_dma_add_device ' was not declared. Should it be static?

---
 drivers/staging/kpc2000/kpc_dma/kpc_dma_driver.h | 1 +
 1 file changed, 1 insertion(+)
drivers/staging/kpc2000/kpc_dma/kpc_dma_driver.h +1 -0
index ee47f43e71cf..19e88c3bc13f 100644
@@ -56,6 +56,7 @@ struct dev_private_data {
 };
 
 struct kpc_dma_device *kpc_dma_lookup_device(int minor);
+void kpc_dma_add_device(struct kpc_dma_device *ldev);
 
 extern const struct file_operations  kpc_dma_fops;
 
Signature · 1 line
2.17.1
#1 lore raw
Quoted 16 lines

This was reported by sparse:
drivers/staging/kpc2000/kpc_dma/kpc_dma_driver.c:39:7: warning: symbol 'kpc_dma_add_device
' was not declared. Should it be static?

---
drivers/staging/kpc2000/kpc_dma/kpc_dma_driver.h | 1 +

1 file changed, 1 insertion(+)
drivers/staging/kpc2000/kpc_dma/kpc_dma_driver.h +0 -0
index ee47f43e71cf..19e88c3bc13f 100644

drivers/staging/kpc2000/kpc_dma/kpc_dma_driver.h struct dev_private_data { · line 62

Quoted 7 lines
drivers/staging/kpc2000/kpc_dma/kpc_dma_driver.h +1 -0
@@ -56,6 +56,7 @@ struct dev_private_data {
 };
 
 struct kpc_dma_device *kpc_dma_lookup_device(int minor);
+void kpc_dma_add_device(struct kpc_dma_device *ldev);
 
 extern const struct file_operations  kpc_dma_fops;
 

Wouldn't it be better to mark the function static? It's only used in kpc_dma_driver.c which is where it's defined.

maintainer
#2 lore raw
In reply to Valerio Genovese
Quoted 14 lines · Valerio Genovese

This was reported by sparse:
drivers/staging/kpc2000/kpc_dma/kpc_dma_driver.c:39:7: warning: symbol 'kpc_dma_add_device ' was not declared. Should it be static?

---
 drivers/staging/kpc2000/kpc_dma/kpc_dma_driver.h | 1 +
 1 file changed, 1 insertion(+)
drivers/staging/kpc2000/kpc_dma/kpc_dma_driver.h +0 -0
index ee47f43e71cf..19e88c3bc13f 100644

drivers/staging/kpc2000/kpc_dma/kpc_dma_driver.h struct dev_private_data { · line 62

Quoted 7 lines
drivers/staging/kpc2000/kpc_dma/kpc_dma_driver.h +1 -0
@@ -56,6 +56,7 @@ struct dev_private_data {
 };
 
 struct kpc_dma_device *kpc_dma_lookup_device(int minor);
+void kpc_dma_add_device(struct kpc_dma_device *ldev);
 
 extern const struct file_operations  kpc_dma_fops;
 

This is not how you fix this issue.

Look at the warning given to you. Think about your C programming knowledge and remember what the 'static' keyword is and does.

Then fix the issue properly.

thanks,

greg k-h

author
#3 lore raw

Hi,

Thanks for the feedback. I re-submitted the patch as v2.

best,
Valerio

Il 05/06/19 18:11, Greg KH ha scritto:

Quoted 34 lines · Valerio Genovese
Quoted 14 lines

This was reported by sparse:
drivers/staging/kpc2000/kpc_dma/kpc_dma_driver.c:39:7: warning: symbol 'kpc_dma_add_device ' was not declared. Should it be static?

---
 drivers/staging/kpc2000/kpc_dma/kpc_dma_driver.h | 1 +
 1 file changed, 1 insertion(+)
drivers/staging/kpc2000/kpc_dma/kpc_dma_driver.h +0 -0
index ee47f43e71cf..19e88c3bc13f 100644

drivers/staging/kpc2000/kpc_dma/kpc_dma_driver.h struct dev_private_data { · line 62

Quoted 7 lines
drivers/staging/kpc2000/kpc_dma/kpc_dma_driver.h +1 -0
@@ -56,6 +56,7 @@ struct dev_private_data {
 };
 
 struct kpc_dma_device *kpc_dma_lookup_device(int minor);
+void kpc_dma_add_device(struct kpc_dma_device *ldev);
 
 extern const struct file_operations  kpc_dma_fops;
 

This is not how you fix this issue.

Look at the warning given to you. Think about your C programming knowledge and remember what the 'static' keyword is and does.

Then fix the issue properly.

thanks,

greg k-h