* [PATCH] ptp_pch: include ethernet driver for external functions
@ 2019-10-18 10:51 Ben Dooks (Codethink)
2019-10-18 10:56 ` Ben Dooks
2019-10-18 11:41 ` Richard Cochran
0 siblings, 2 replies; 3+ messages in thread
From: Ben Dooks (Codethink) @ 2019-10-18 10:51 UTC (permalink / raw)
To: linux-kernel; +Cc: Ben Dooks (Codethink), Richard Cochran, netdev, linux-kernel
The driver uses a number of functions from the ethernet driver
so include the header to remove the following warnings from
sparse about undeclared functions:
drivers/ptp/ptp_pch.c:182:5: warning: symbol 'pch_ch_control_read' was not declared. Should it be static?
drivers/ptp/ptp_pch.c:193:6: warning: symbol 'pch_ch_control_write' was not declared. Should it be static?
drivers/ptp/ptp_pch.c:201:5: warning: symbol 'pch_ch_event_read' was not declared. Should it be static?
drivers/ptp/ptp_pch.c:212:6: warning: symbol 'pch_ch_event_write' was not declared. Should it be static?
drivers/ptp/ptp_pch.c:220:5: warning: symbol 'pch_src_uuid_lo_read' was not declared. Should it be static?
drivers/ptp/ptp_pch.c:231:5: warning: symbol 'pch_src_uuid_hi_read' was not declared. Should it be static?
drivers/ptp/ptp_pch.c:242:5: warning: symbol 'pch_rx_snap_read' was not declared. Should it be static?
drivers/ptp/ptp_pch.c:259:5: warning: symbol 'pch_tx_snap_read' was not declared. Should it be static?
drivers/ptp/ptp_pch.c:300:5: warning: symbol 'pch_set_station_address' was not declared. Should it be static?
Should we include the header file from the ethernet driver directly
or if not, where should the declarations go?
Signed-off-by: Ben Dooks (Codethink) <ben.dooks@codethink.co.uk>
---
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
drivers/ptp/ptp_pch.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/ptp/ptp_pch.c b/drivers/ptp/ptp_pch.c
index dcd6e00c8046..2bb1184b6359 100644
--- a/drivers/ptp/ptp_pch.c
+++ b/drivers/ptp/ptp_pch.c
@@ -20,6 +20,8 @@
#include <linux/ptp_clock_kernel.h>
#include <linux/slab.h>
+#include <../net/ethernet/oki-semi/pch_gbe/pch_gbe.h>
+
#define STATION_ADDR_LEN 20
#define PCI_DEVICE_ID_PCH_1588 0x8819
#define IO_MEM_BAR 1
--
2.23.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ptp_pch: include ethernet driver for external functions
2019-10-18 10:51 [PATCH] ptp_pch: include ethernet driver for external functions Ben Dooks (Codethink)
@ 2019-10-18 10:56 ` Ben Dooks
2019-10-18 11:41 ` Richard Cochran
1 sibling, 0 replies; 3+ messages in thread
From: Ben Dooks @ 2019-10-18 10:56 UTC (permalink / raw)
To: linux-kernel; +Cc: Richard Cochran, netdev, linux-kernel
On 18/10/2019 11:51, Ben Dooks (Codethink) wrote:
> The driver uses a number of functions from the ethernet driver
> so include the header to remove the following warnings from
> sparse about undeclared functions:
>
> drivers/ptp/ptp_pch.c:182:5: warning: symbol 'pch_ch_control_read' was not declared. Should it be static?
> drivers/ptp/ptp_pch.c:193:6: warning: symbol 'pch_ch_control_write' was not declared. Should it be static?
> drivers/ptp/ptp_pch.c:201:5: warning: symbol 'pch_ch_event_read' was not declared. Should it be static?
> drivers/ptp/ptp_pch.c:212:6: warning: symbol 'pch_ch_event_write' was not declared. Should it be static?
> drivers/ptp/ptp_pch.c:220:5: warning: symbol 'pch_src_uuid_lo_read' was not declared. Should it be static?
> drivers/ptp/ptp_pch.c:231:5: warning: symbol 'pch_src_uuid_hi_read' was not declared. Should it be static?
> drivers/ptp/ptp_pch.c:242:5: warning: symbol 'pch_rx_snap_read' was not declared. Should it be static?
> drivers/ptp/ptp_pch.c:259:5: warning: symbol 'pch_tx_snap_read' was not declared. Should it be static?
> drivers/ptp/ptp_pch.c:300:5: warning: symbol 'pch_set_station_address' was not declared. Should it be static?
>
> Should we include the header file from the ethernet driver directly
> or if not, where should the declarations go?
>
> Signed-off-by: Ben Dooks (Codethink) <ben.dooks@codethink.co.uk>
> ---
> Cc: Richard Cochran <richardcochran@gmail.com>
> Cc: netdev@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> ---
> drivers/ptp/ptp_pch.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/ptp/ptp_pch.c b/drivers/ptp/ptp_pch.c
> index dcd6e00c8046..2bb1184b6359 100644
> --- a/drivers/ptp/ptp_pch.c
> +++ b/drivers/ptp/ptp_pch.c
> @@ -20,6 +20,8 @@
> #include <linux/ptp_clock_kernel.h>
> #include <linux/slab.h>
>
> +#include <../net/ethernet/oki-semi/pch_gbe/pch_gbe.h>
oops, missed saving the version with ../../drivers/net
> +
> #define STATION_ADDR_LEN 20
> #define PCI_DEVICE_ID_PCH_1588 0x8819
> #define IO_MEM_BAR 1
>
--
Ben Dooks http://www.codethink.co.uk/
Senior Engineer Codethink - Providing Genius
https://www.codethink.co.uk/privacy.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ptp_pch: include ethernet driver for external functions
2019-10-18 10:51 [PATCH] ptp_pch: include ethernet driver for external functions Ben Dooks (Codethink)
2019-10-18 10:56 ` Ben Dooks
@ 2019-10-18 11:41 ` Richard Cochran
1 sibling, 0 replies; 3+ messages in thread
From: Richard Cochran @ 2019-10-18 11:41 UTC (permalink / raw)
To: Ben Dooks (Codethink); +Cc: linux-kernel, netdev, linux-kernel
On Fri, Oct 18, 2019 at 11:51:28AM +0100, Ben Dooks (Codethink) wrote:
> The driver uses a number of functions from the ethernet driver
> so include the header to remove the following warnings from
> sparse about undeclared functions:
>
> drivers/ptp/ptp_pch.c:182:5: warning: symbol 'pch_ch_control_read' was not declared. Should it be static?
That one is never used and should be removed.
> drivers/ptp/ptp_pch.c:193:6: warning: symbol 'pch_ch_control_write' was not declared. Should it be static?
> drivers/ptp/ptp_pch.c:201:5: warning: symbol 'pch_ch_event_read' was not declared. Should it be static?
> drivers/ptp/ptp_pch.c:212:6: warning: symbol 'pch_ch_event_write' was not declared. Should it be static?
> drivers/ptp/ptp_pch.c:220:5: warning: symbol 'pch_src_uuid_lo_read' was not declared. Should it be static?
> drivers/ptp/ptp_pch.c:231:5: warning: symbol 'pch_src_uuid_hi_read' was not declared. Should it be static?
> drivers/ptp/ptp_pch.c:242:5: warning: symbol 'pch_rx_snap_read' was not declared. Should it be static?
> drivers/ptp/ptp_pch.c:259:5: warning: symbol 'pch_tx_snap_read' was not declared. Should it be static?
> drivers/ptp/ptp_pch.c:300:5: warning: symbol 'pch_set_station_address' was not declared. Should it be static?
> +#include <../net/ethernet/oki-semi/pch_gbe/pch_gbe.h>
Instead of that long relative path, just move ptp_pch.c out of
drivers/ptp and into drivers/net/ethernet/oki-semi/pch_gbe.
Then move the shared declarations out of pch_gbe.h and into a new
header file, included by both users with:
#include "ptp_pch.h"
Thanks,
Richard
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-10-18 11:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-18 10:51 [PATCH] ptp_pch: include ethernet driver for external functions Ben Dooks (Codethink)
2019-10-18 10:56 ` Ben Dooks
2019-10-18 11:41 ` Richard Cochran
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).