nvmem: only build nvmem_find_cell_by_index() if OF is enabled
PATCH 1/1 nvmem: only build nvmem_find_cell_by_index() if OF is enabled
From: Bartosz Golaszewski <[email protected]>
The following warning is produced when building nvmem core if CONFIG_OF is disabled:
drivers/nvmem/core.c:496:1: warning: 'nvmem_find_cell_by_index' defined but not used [-Wunused-function]
nvmem_find_cell_by_index(struct nvmem_device *nvmem, int index) ^~~~~~~~~~~~~~~~~~~~~~~~
This is caused by the fact that the only caller of this routine is under an ifdef depending on this option. Fix it by adding a relevant ifdef to the function in question as well.
--- drivers/nvmem/core.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/nvmem/core.c +2 -0
@@ -492,6 +492,7 @@ static int nvmem_add_cells_from_table(struct nvmem_device *nvmem)return rval; } +#if IS_ENABLED (CONFIG_OF )static struct nvmem_cell *nvmem_find_cell_by_index (struct nvmem_device *nvmem,int index) {
@@ -507,6 +508,7 @@ nvmem_find_cell_by_index(struct nvmem_device *nvmem, int index) return cell; } +#endif static struct nvmem_cell *nvmem_find_cell_by_name (struct nvmem_device *nvmem,const char *cell_id)
Signature · 1 line
2.19.0
Quoted 23 lines · Bartosz Golaszewski
From: Bartosz Golaszewski <[email protected]>
The following warning is produced when building nvmem core if
CONFIG_OFis disabled:
drivers/nvmem/core.c:496:1: warning: 'nvmem_find_cell_by_index' defined but not used [-Wunused-function]
nvmem_find_cell_by_index(struct nvmem_device *nvmem, int index)^~~~~~~~~~~~~~~~~~~~~~~~This is caused by the fact that the only caller of this routine is under an ifdef depending on this option. Fix it by adding a relevant ifdef to the function in question as well.
Signed-off-by Bartosz Golaszewski <[email protected]>--- drivers/nvmem/core.c | 2 ++ 1 file changed, 2 insertions(+)drivers/nvmem/core.c +0
-0
drivers/nvmem/core.c static int nvmem_add_cells_from_table(struct nvmem_device *nvmem) · line 495
Quoted 4 lines
drivers/nvmem/core.c +1
-0@@ -492,6 +492,7 @@ static int nvmem_add_cells_from_table(struct nvmem_device *nvmem)return rval; } +#if IS_ENABLED (CONFIG_OF )
You should probably attribute the function with "__maybe_unused" Instead of adding this condition.
--srini
Quoted 12 lines
drivers/nvmem/core.c +1
-0static struct nvmem_cell *nvmem_find_cell_by_index (struct nvmem_device *nvmem,int index) {@@ -507,6 +508,7 @@ nvmem_find_cell_by_index(struct nvmem_device *nvmem, int index) return cell; } +#endif static struct nvmem_cell *nvmem_find_cell_by_name (struct nvmem_device *nvmem,const char *cell_id)
wt., 2 pa? 2018 o 13:49 Srinivas Kandagatla
<[email protected]> napisa?(a):
Quoted 30 lines · Bartosz Golaszewski
Quoted 26 lines
From: Bartosz Golaszewski <[email protected]>
The following warning is produced when building nvmem core if
CONFIG_OFis disabled:
drivers/nvmem/core.c:496:1: warning: 'nvmem_find_cell_by_index' defined but not used [-Wunused-function]
nvmem_find_cell_by_index(struct nvmem_device *nvmem, int index)^~~~~~~~~~~~~~~~~~~~~~~~This is caused by the fact that the only caller of this routine is under an ifdef depending on this option. Fix it by adding a relevant ifdef to the function in question as well.
Signed-off-by Bartosz Golaszewski <[email protected]>--- drivers/nvmem/core.c | 2 ++ 1 file changed, 2 insertions(+)drivers/nvmem/core.c +0
-0@@ -492,6 +492,7 @@ static int nvmem_add_cells_from_table(struct nvmem_device *nvmem)return rval; }
Quoted 5 lines
drivers/nvmem/core.c static int nvmem_add_cells_from_table(struct nvmem_device *nvmem) · line 495
Quoted 1 line
drivers/nvmem/core.c +1
-0+#if IS_ENABLED (CONFIG_OF )You should probably attribute the function with "
__maybe_unused" Instead of adding this condition.
Sounds better indeed. I'll resend tomorrow to avoid spamming.
Bart
Quoted 15 lines
--srini
Quoted 12 lines
drivers/nvmem/core.c +1
-0static struct nvmem_cell *nvmem_find_cell_by_index (struct nvmem_device *nvmem,int index) {@@ -507,6 +508,7 @@ nvmem_find_cell_by_index(struct nvmem_device *nvmem, int index) return cell; } +#endif static struct nvmem_cell *nvmem_find_cell_by_name (struct nvmem_device *nvmem,const char *cell_id)
Quoted 9 lines · Bartosz Golaszewski
From: Bartosz Golaszewski <[email protected]>
The following warning is produced when building nvmem core if
CONFIG_OFis disabled:
drivers/nvmem/core.c:496:1: warning: 'nvmem_find_cell_by_index' defined but not used [-Wunused-function]
nvmem_find_cell_by_index(struct nvmem_device *nvmem, int index)^~~~~~~~~~~~~~~~~~~~~~~~
Quoted 5 lines
This is caused by the fact that the only caller of this routine is under an ifdef depending on this option. Fix it by adding a relevant ifdef to the function in question as well.
Signed-off-by Bartosz Golaszewski <[email protected]>
No "reported-by:" lines on this and the other patch?
Not nice :(
?r., 3 pa? 2018 o 00:26 Greg KH <[email protected]> napisa?(a):
Quoted 15 lines · Bartosz Golaszewski
Quoted 13 lines
From: Bartosz Golaszewski <[email protected]>
The following warning is produced when building nvmem core if
CONFIG_OFis disabled:
drivers/nvmem/core.c:496:1: warning: 'nvmem_find_cell_by_index' defined but not used [-Wunused-function]
nvmem_find_cell_by_index(struct nvmem_device *nvmem, int index)^~~~~~~~~~~~~~~~~~~~~~~~This is caused by the fact that the only caller of this routine is under an ifdef depending on this option. Fix it by adding a relevant ifdef to the function in question as well.
Quoted 5 lines
Quoted 1 line
Signed-off-by Bartosz Golaszewski <[email protected]>No "reported-by:" lines on this and the other patch?
Not nice :(
Sorry, I normally remeber about it. Anyway Arnd sent a better alternative for this one.
Bart