netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pds_core: add stub macros for pdsc_debufs_* when ! CONFIG_DEBUG_FS
@ 2023-05-02 14:52 Tom Rix
  2023-05-02 14:57 ` Paolo Abeni
  2023-05-03  7:36 ` Jiri Pirko
  0 siblings, 2 replies; 4+ messages in thread
From: Tom Rix @ 2023-05-02 14:52 UTC (permalink / raw)
  To: shannon.nelson, brett.creeley, davem, edumazet, kuba, pabeni
  Cc: netdev, linux-kernel, Tom Rix

When CONFIG_DEBUG_FS is not defined there is this representative link error
ld: drivers/net/ethernet/amd/pds_core/main.o: in function `pdsc_remove':
main.c:(.text+0x35c): undefined reference to `pdsc_debugfs_del_dev

Avoid these link errors when CONFIG_DEBUG_FS is not defined by
providing some empty macros.

Signed-off-by: Tom Rix <trix@redhat.com>
---
 drivers/net/ethernet/amd/pds_core/core.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/net/ethernet/amd/pds_core/core.h b/drivers/net/ethernet/amd/pds_core/core.h
index e545fafc4819..0b39a6dc65c8 100644
--- a/drivers/net/ethernet/amd/pds_core/core.h
+++ b/drivers/net/ethernet/amd/pds_core/core.h
@@ -261,6 +261,7 @@ int pdsc_dl_enable_validate(struct devlink *dl, u32 id,
 
 void __iomem *pdsc_map_dbpage(struct pdsc *pdsc, int page_num);
 
+#ifdef CONFIG_DEBUG_FS
 void pdsc_debugfs_create(void);
 void pdsc_debugfs_destroy(void);
 void pdsc_debugfs_add_dev(struct pdsc *pdsc);
@@ -270,6 +271,17 @@ void pdsc_debugfs_add_viftype(struct pdsc *pdsc);
 void pdsc_debugfs_add_irqs(struct pdsc *pdsc);
 void pdsc_debugfs_add_qcq(struct pdsc *pdsc, struct pdsc_qcq *qcq);
 void pdsc_debugfs_del_qcq(struct pdsc_qcq *qcq);
+#else
+#define pdsc_debugfs_create()
+#define pdsc_debugfs_destroy()
+#define pdsc_debugfs_add_dev(pdsc)
+#define pdsc_debugfs_del_dev(pdsc)
+#define pdsc_debugfs_add_ident(pdsc)
+#define pdsc_debugfs_add_viftype(pdsc)
+#define pdsc_debugfs_add_irqs(pdsc)
+#define pdsc_debugfs_add_qcq(pdsc, qcq)
+#define pdsc_debugfs_del_qcq(qcq)
+#endif
 
 int pdsc_err_to_errno(enum pds_core_status_code code);
 bool pdsc_is_fw_running(struct pdsc *pdsc);
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] pds_core: add stub macros for pdsc_debufs_* when ! CONFIG_DEBUG_FS
  2023-05-02 14:52 [PATCH] pds_core: add stub macros for pdsc_debufs_* when ! CONFIG_DEBUG_FS Tom Rix
@ 2023-05-02 14:57 ` Paolo Abeni
  2023-05-03  7:36 ` Jiri Pirko
  1 sibling, 0 replies; 4+ messages in thread
From: Paolo Abeni @ 2023-05-02 14:57 UTC (permalink / raw)
  To: Tom Rix, shannon.nelson, brett.creeley, davem, edumazet, kuba
  Cc: netdev, linux-kernel

On Tue, 2023-05-02 at 10:52 -0400, Tom Rix wrote:
> When CONFIG_DEBUG_FS is not defined there is this representative link error
> ld: drivers/net/ethernet/amd/pds_core/main.o: in function `pdsc_remove':
> main.c:(.text+0x35c): undefined reference to `pdsc_debugfs_del_dev
> 
> Avoid these link errors when CONFIG_DEBUG_FS is not defined by
> providing some empty macros.
> 
> Signed-off-by: Tom Rix <trix@redhat.com>

There is already a patch pending on the same topic:

https://patchwork.kernel.org/user/todo/netdevbpf/?series=744165


and probably a different approach will be preferred:

https://lore.kernel.org/all/84bc488b-5b4b-49ec-7e1a-3a88f92476f6@amd.com/

Cheers,

Paolo


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] pds_core: add stub macros for pdsc_debufs_* when ! CONFIG_DEBUG_FS
  2023-05-02 14:52 [PATCH] pds_core: add stub macros for pdsc_debufs_* when ! CONFIG_DEBUG_FS Tom Rix
  2023-05-02 14:57 ` Paolo Abeni
@ 2023-05-03  7:36 ` Jiri Pirko
  2023-05-03 12:32   ` Tom Rix
  1 sibling, 1 reply; 4+ messages in thread
From: Jiri Pirko @ 2023-05-03  7:36 UTC (permalink / raw)
  To: Tom Rix
  Cc: shannon.nelson, brett.creeley, davem, edumazet, kuba, pabeni,
	netdev, linux-kernel

Tue, May 02, 2023 at 04:52:20PM CEST, trix@redhat.com wrote:
>When CONFIG_DEBUG_FS is not defined there is this representative link error
>ld: drivers/net/ethernet/amd/pds_core/main.o: in function `pdsc_remove':
>main.c:(.text+0x35c): undefined reference to `pdsc_debugfs_del_dev
>
>Avoid these link errors when CONFIG_DEBUG_FS is not defined by
>providing some empty macros.
>
>Signed-off-by: Tom Rix <trix@redhat.com>
>---
> drivers/net/ethernet/amd/pds_core/core.h | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
>diff --git a/drivers/net/ethernet/amd/pds_core/core.h b/drivers/net/ethernet/amd/pds_core/core.h
>index e545fafc4819..0b39a6dc65c8 100644
>--- a/drivers/net/ethernet/amd/pds_core/core.h
>+++ b/drivers/net/ethernet/amd/pds_core/core.h
>@@ -261,6 +261,7 @@ int pdsc_dl_enable_validate(struct devlink *dl, u32 id,
> 
> void __iomem *pdsc_map_dbpage(struct pdsc *pdsc, int page_num);
> 
>+#ifdef CONFIG_DEBUG_FS
> void pdsc_debugfs_create(void);
> void pdsc_debugfs_destroy(void);
> void pdsc_debugfs_add_dev(struct pdsc *pdsc);
>@@ -270,6 +271,17 @@ void pdsc_debugfs_add_viftype(struct pdsc *pdsc);
> void pdsc_debugfs_add_irqs(struct pdsc *pdsc);
> void pdsc_debugfs_add_qcq(struct pdsc *pdsc, struct pdsc_qcq *qcq);
> void pdsc_debugfs_del_qcq(struct pdsc_qcq *qcq);
>+#else
>+#define pdsc_debugfs_create()
>+#define pdsc_debugfs_destroy()
>+#define pdsc_debugfs_add_dev(pdsc)
>+#define pdsc_debugfs_del_dev(pdsc)
>+#define pdsc_debugfs_add_ident(pdsc)
>+#define pdsc_debugfs_add_viftype(pdsc)
>+#define pdsc_debugfs_add_irqs(pdsc)
>+#define pdsc_debugfs_add_qcq(pdsc, qcq)
>+#define pdsc_debugfs_del_qcq(qcq)

Usually this is done using static inline stub functions. Any reason to
not to do it in the same way?


>+#endif
> 
> int pdsc_err_to_errno(enum pds_core_status_code code);
> bool pdsc_is_fw_running(struct pdsc *pdsc);
>-- 
>2.27.0
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] pds_core: add stub macros for pdsc_debufs_* when ! CONFIG_DEBUG_FS
  2023-05-03  7:36 ` Jiri Pirko
@ 2023-05-03 12:32   ` Tom Rix
  0 siblings, 0 replies; 4+ messages in thread
From: Tom Rix @ 2023-05-03 12:32 UTC (permalink / raw)
  To: Jiri Pirko
  Cc: shannon.nelson, brett.creeley, davem, edumazet, kuba, pabeni,
	netdev, linux-kernel


On 5/3/23 12:36 AM, Jiri Pirko wrote:
> Tue, May 02, 2023 at 04:52:20PM CEST, trix@redhat.com wrote:
>> When CONFIG_DEBUG_FS is not defined there is this representative link error
>> ld: drivers/net/ethernet/amd/pds_core/main.o: in function `pdsc_remove':
>> main.c:(.text+0x35c): undefined reference to `pdsc_debugfs_del_dev
>>
>> Avoid these link errors when CONFIG_DEBUG_FS is not defined by
>> providing some empty macros.
>>
>> Signed-off-by: Tom Rix <trix@redhat.com>
>> ---
>> drivers/net/ethernet/amd/pds_core/core.h | 12 ++++++++++++
>> 1 file changed, 12 insertions(+)
>>
>> diff --git a/drivers/net/ethernet/amd/pds_core/core.h b/drivers/net/ethernet/amd/pds_core/core.h
>> index e545fafc4819..0b39a6dc65c8 100644
>> --- a/drivers/net/ethernet/amd/pds_core/core.h
>> +++ b/drivers/net/ethernet/amd/pds_core/core.h
>> @@ -261,6 +261,7 @@ int pdsc_dl_enable_validate(struct devlink *dl, u32 id,
>>
>> void __iomem *pdsc_map_dbpage(struct pdsc *pdsc, int page_num);
>>
>> +#ifdef CONFIG_DEBUG_FS
>> void pdsc_debugfs_create(void);
>> void pdsc_debugfs_destroy(void);
>> void pdsc_debugfs_add_dev(struct pdsc *pdsc);
>> @@ -270,6 +271,17 @@ void pdsc_debugfs_add_viftype(struct pdsc *pdsc);
>> void pdsc_debugfs_add_irqs(struct pdsc *pdsc);
>> void pdsc_debugfs_add_qcq(struct pdsc *pdsc, struct pdsc_qcq *qcq);
>> void pdsc_debugfs_del_qcq(struct pdsc_qcq *qcq);
>> +#else
>> +#define pdsc_debugfs_create()
>> +#define pdsc_debugfs_destroy()
>> +#define pdsc_debugfs_add_dev(pdsc)
>> +#define pdsc_debugfs_del_dev(pdsc)
>> +#define pdsc_debugfs_add_ident(pdsc)
>> +#define pdsc_debugfs_add_viftype(pdsc)
>> +#define pdsc_debugfs_add_irqs(pdsc)
>> +#define pdsc_debugfs_add_qcq(pdsc, qcq)
>> +#define pdsc_debugfs_del_qcq(qcq)
> Usually this is done using static inline stub functions. Any reason to
> not to do it in the same way?

I do not mind changing the patch if that is what is required.

However I believe Paolo said the change was being handled by another patch.

Tom

>
>
>> +#endif
>>
>> int pdsc_err_to_errno(enum pds_core_status_code code);
>> bool pdsc_is_fw_running(struct pdsc *pdsc);
>> -- 
>> 2.27.0
>>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-05-03 12:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-02 14:52 [PATCH] pds_core: add stub macros for pdsc_debufs_* when ! CONFIG_DEBUG_FS Tom Rix
2023-05-02 14:57 ` Paolo Abeni
2023-05-03  7:36 ` Jiri Pirko
2023-05-03 12:32   ` Tom Rix

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).