linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ptp: mark symbols static where possible
@ 2020-09-17  2:25 Herrington
  2020-09-17  7:16 ` Leon Romanovsky
  2020-09-17  9:24 ` kernel test robot
  0 siblings, 2 replies; 4+ messages in thread
From: Herrington @ 2020-09-17  2:25 UTC (permalink / raw)
  To: Richard Cochran; +Cc: netdev, linux-kernel, hankinsea

We get 1 warning when building kernel with W=1:
drivers/ptp/ptp_pch.c:182:5: warning: no previous prototype for ‘pch_ch_control_read’ [-Wmissing-prototypes]
 u32 pch_ch_control_read(struct pci_dev *pdev)
drivers/ptp/ptp_pch.c:193:6: warning: no previous prototype for ‘pch_ch_control_write’ [-Wmissing-prototypes]
 void pch_ch_control_write(struct pci_dev *pdev, u32 val)
drivers/ptp/ptp_pch.c:201:5: warning: no previous prototype for ‘pch_ch_event_read’ [-Wmissing-prototypes]
 u32 pch_ch_event_read(struct pci_dev *pdev)
drivers/ptp/ptp_pch.c:212:6: warning: no previous prototype for ‘pch_ch_event_write’ [-Wmissing-prototypes]
 void pch_ch_event_write(struct pci_dev *pdev, u32 val)
drivers/ptp/ptp_pch.c:220:5: warning: no previous prototype for ‘pch_src_uuid_lo_read’ [-Wmissing-prototypes]
 u32 pch_src_uuid_lo_read(struct pci_dev *pdev)
drivers/ptp/ptp_pch.c:231:5: warning: no previous prototype for ‘pch_src_uuid_hi_read’ [-Wmissing-prototypes]
 u32 pch_src_uuid_hi_read(struct pci_dev *pdev)
drivers/ptp/ptp_pch.c:242:5: warning: no previous prototype for ‘pch_rx_snap_read’ [-Wmissing-prototypes]
 u64 pch_rx_snap_read(struct pci_dev *pdev)
drivers/ptp/ptp_pch.c:259:5: warning: no previous prototype for ‘pch_tx_snap_read’ [-Wmissing-prototypes]
 u64 pch_tx_snap_read(struct pci_dev *pdev)
drivers/ptp/ptp_pch.c:300:5: warning: no previous prototype for ‘pch_set_station_address’ [-Wmissing-prototypes]
 int pch_set_station_address(u8 *addr, struct pci_dev *pdev)

Signed-off-by: Herrington <hankinsea@gmail.com>
---
 drivers/ptp/ptp_pch.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/ptp/ptp_pch.c b/drivers/ptp/ptp_pch.c
index ce10ecd41ba0..8db2d1893577 100644
--- a/drivers/ptp/ptp_pch.c
+++ b/drivers/ptp/ptp_pch.c
@@ -179,7 +179,7 @@ static inline void pch_block_reset(struct pch_dev *chip)
 	iowrite32(val, (&chip->regs->control));
 }
 
-u32 pch_ch_control_read(struct pci_dev *pdev)
+static u32 pch_ch_control_read(struct pci_dev *pdev)
 {
 	struct pch_dev *chip = pci_get_drvdata(pdev);
 	u32 val;
@@ -190,7 +190,7 @@ u32 pch_ch_control_read(struct pci_dev *pdev)
 }
 EXPORT_SYMBOL(pch_ch_control_read);
 
-void pch_ch_control_write(struct pci_dev *pdev, u32 val)
+static void pch_ch_control_write(struct pci_dev *pdev, u32 val)
 {
 	struct pch_dev *chip = pci_get_drvdata(pdev);
 
@@ -198,7 +198,7 @@ void pch_ch_control_write(struct pci_dev *pdev, u32 val)
 }
 EXPORT_SYMBOL(pch_ch_control_write);
 
-u32 pch_ch_event_read(struct pci_dev *pdev)
+static u32 pch_ch_event_read(struct pci_dev *pdev)
 {
 	struct pch_dev *chip = pci_get_drvdata(pdev);
 	u32 val;
@@ -209,7 +209,7 @@ u32 pch_ch_event_read(struct pci_dev *pdev)
 }
 EXPORT_SYMBOL(pch_ch_event_read);
 
-void pch_ch_event_write(struct pci_dev *pdev, u32 val)
+static void pch_ch_event_write(struct pci_dev *pdev, u32 val)
 {
 	struct pch_dev *chip = pci_get_drvdata(pdev);
 
@@ -217,7 +217,7 @@ void pch_ch_event_write(struct pci_dev *pdev, u32 val)
 }
 EXPORT_SYMBOL(pch_ch_event_write);
 
-u32 pch_src_uuid_lo_read(struct pci_dev *pdev)
+static u32 pch_src_uuid_lo_read(struct pci_dev *pdev)
 {
 	struct pch_dev *chip = pci_get_drvdata(pdev);
 	u32 val;
@@ -228,7 +228,7 @@ u32 pch_src_uuid_lo_read(struct pci_dev *pdev)
 }
 EXPORT_SYMBOL(pch_src_uuid_lo_read);
 
-u32 pch_src_uuid_hi_read(struct pci_dev *pdev)
+static u32 pch_src_uuid_hi_read(struct pci_dev *pdev)
 {
 	struct pch_dev *chip = pci_get_drvdata(pdev);
 	u32 val;
@@ -239,7 +239,7 @@ u32 pch_src_uuid_hi_read(struct pci_dev *pdev)
 }
 EXPORT_SYMBOL(pch_src_uuid_hi_read);
 
-u64 pch_rx_snap_read(struct pci_dev *pdev)
+static u64 pch_rx_snap_read(struct pci_dev *pdev)
 {
 	struct pch_dev *chip = pci_get_drvdata(pdev);
 	u64 ns;
@@ -256,7 +256,7 @@ u64 pch_rx_snap_read(struct pci_dev *pdev)
 }
 EXPORT_SYMBOL(pch_rx_snap_read);
 
-u64 pch_tx_snap_read(struct pci_dev *pdev)
+static u64 pch_tx_snap_read(struct pci_dev *pdev)
 {
 	struct pch_dev *chip = pci_get_drvdata(pdev);
 	u64 ns;
@@ -297,7 +297,7 @@ static void pch_reset(struct pch_dev *chip)
  *				    traffic on the  ethernet interface
  * @addr:	dress which contain the column separated address to be used.
  */
-int pch_set_station_address(u8 *addr, struct pci_dev *pdev)
+static int pch_set_station_address(u8 *addr, struct pci_dev *pdev)
 {
 	s32 i;
 	struct pch_dev *chip = pci_get_drvdata(pdev);
-- 
2.18.1


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

* Re: [PATCH] ptp: mark symbols static where possible
  2020-09-17  2:25 [PATCH] ptp: mark symbols static where possible Herrington
@ 2020-09-17  7:16 ` Leon Romanovsky
  2020-09-17 19:38   ` Jacob Keller
  2020-09-17  9:24 ` kernel test robot
  1 sibling, 1 reply; 4+ messages in thread
From: Leon Romanovsky @ 2020-09-17  7:16 UTC (permalink / raw)
  To: Herrington; +Cc: Richard Cochran, netdev, linux-kernel

On Thu, Sep 17, 2020 at 10:25:08AM +0800, Herrington wrote:
> We get 1 warning when building kernel with W=1:
> drivers/ptp/ptp_pch.c:182:5: warning: no previous prototype for ‘pch_ch_control_read’ [-Wmissing-prototypes]
>  u32 pch_ch_control_read(struct pci_dev *pdev)
> drivers/ptp/ptp_pch.c:193:6: warning: no previous prototype for ‘pch_ch_control_write’ [-Wmissing-prototypes]
>  void pch_ch_control_write(struct pci_dev *pdev, u32 val)
> drivers/ptp/ptp_pch.c:201:5: warning: no previous prototype for ‘pch_ch_event_read’ [-Wmissing-prototypes]
>  u32 pch_ch_event_read(struct pci_dev *pdev)
> drivers/ptp/ptp_pch.c:212:6: warning: no previous prototype for ‘pch_ch_event_write’ [-Wmissing-prototypes]
>  void pch_ch_event_write(struct pci_dev *pdev, u32 val)
> drivers/ptp/ptp_pch.c:220:5: warning: no previous prototype for ‘pch_src_uuid_lo_read’ [-Wmissing-prototypes]
>  u32 pch_src_uuid_lo_read(struct pci_dev *pdev)
> drivers/ptp/ptp_pch.c:231:5: warning: no previous prototype for ‘pch_src_uuid_hi_read’ [-Wmissing-prototypes]
>  u32 pch_src_uuid_hi_read(struct pci_dev *pdev)
> drivers/ptp/ptp_pch.c:242:5: warning: no previous prototype for ‘pch_rx_snap_read’ [-Wmissing-prototypes]
>  u64 pch_rx_snap_read(struct pci_dev *pdev)
> drivers/ptp/ptp_pch.c:259:5: warning: no previous prototype for ‘pch_tx_snap_read’ [-Wmissing-prototypes]
>  u64 pch_tx_snap_read(struct pci_dev *pdev)
> drivers/ptp/ptp_pch.c:300:5: warning: no previous prototype for ‘pch_set_station_address’ [-Wmissing-prototypes]
>  int pch_set_station_address(u8 *addr, struct pci_dev *pdev)
>
> Signed-off-by: Herrington <hankinsea@gmail.com>
> ---
>  drivers/ptp/ptp_pch.c | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)

This file is total mess.

>
> diff --git a/drivers/ptp/ptp_pch.c b/drivers/ptp/ptp_pch.c
> index ce10ecd41ba0..8db2d1893577 100644
> --- a/drivers/ptp/ptp_pch.c
> +++ b/drivers/ptp/ptp_pch.c
> @@ -179,7 +179,7 @@ static inline void pch_block_reset(struct pch_dev *chip)
>  	iowrite32(val, (&chip->regs->control));
>  }
>
> -u32 pch_ch_control_read(struct pci_dev *pdev)
> +static u32 pch_ch_control_read(struct pci_dev *pdev)
>  {
>  	struct pch_dev *chip = pci_get_drvdata(pdev);
>  	u32 val;
> @@ -190,7 +190,7 @@ u32 pch_ch_control_read(struct pci_dev *pdev)
>  }
>  EXPORT_SYMBOL(pch_ch_control_read);

This function is not used and can be deleted.

>
> -void pch_ch_control_write(struct pci_dev *pdev, u32 val)
> +static void pch_ch_control_write(struct pci_dev *pdev, u32 val)
>  {
>  	struct pch_dev *chip = pci_get_drvdata(pdev);
>
> @@ -198,7 +198,7 @@ void pch_ch_control_write(struct pci_dev *pdev, u32 val)
>  }
>  EXPORT_SYMBOL(pch_ch_control_write);


This function in use (incorrectly) by
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c

Your patch will break it.

I didn't check other functions, but assume they are broken too.

Thanks

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

* Re: [PATCH] ptp: mark symbols static where possible
  2020-09-17  2:25 [PATCH] ptp: mark symbols static where possible Herrington
  2020-09-17  7:16 ` Leon Romanovsky
@ 2020-09-17  9:24 ` kernel test robot
  1 sibling, 0 replies; 4+ messages in thread
From: kernel test robot @ 2020-09-17  9:24 UTC (permalink / raw)
  To: Herrington, Richard Cochran; +Cc: kbuild-all, netdev, linux-kernel, hankinsea

[-- Attachment #1: Type: text/plain, Size: 3396 bytes --]

Hi Herrington,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on net/master]
[also build test ERROR on net-next/master linus/master v5.9-rc5 next-20200916]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Herrington/ptp-mark-symbols-static-where-possible/20200917-103557
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git d5d325eae7823c85eedabf05f78f9cd574fe832b
config: riscv-allyesconfig (attached as .config)
compiler: riscv64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=riscv 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   riscv64-linux-ld: drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.o: in function `.L306':
>> pch_gbe_main.c:(.text+0x2a04): undefined reference to `pch_ch_control_write'
   riscv64-linux-ld: drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.o: in function `.L287':
   pch_gbe_main.c:(.text+0x2a3c): undefined reference to `pch_ch_control_write'
>> riscv64-linux-ld: pch_gbe_main.c:(.text+0x2a76): undefined reference to `pch_ch_control_write'
   riscv64-linux-ld: pch_gbe_main.c:(.text+0x2ab2): undefined reference to `pch_ch_control_write'
   riscv64-linux-ld: drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.o: in function `.L0 ':
>> pch_gbe_main.c:(.text+0x2ad6): undefined reference to `pch_set_station_address'
   riscv64-linux-ld: drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.o: in function `.L295':
>> pch_gbe_main.c:(.text+0x2b1c): undefined reference to `pch_ch_event_write'
   riscv64-linux-ld: drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.o: in function `.L0 ':
>> pch_gbe_main.c:(.text+0x44ea): undefined reference to `pch_ch_event_read'
   riscv64-linux-ld: drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.o: in function `.L447':
>> pch_gbe_main.c:(.text+0x468e): undefined reference to `pch_tx_snap_read'
   riscv64-linux-ld: drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.o: in function `.L450':
   pch_gbe_main.c:(.text+0x46ae): undefined reference to `pch_ch_event_write'
   riscv64-linux-ld: drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.o: in function `.L508':
   pch_gbe_main.c:(.text+0x522c): undefined reference to `pch_ch_event_read'
   riscv64-linux-ld: drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.o: in function `.L509':
>> pch_gbe_main.c:(.text+0x5254): undefined reference to `pch_src_uuid_lo_read'
>> riscv64-linux-ld: pch_gbe_main.c:(.text+0x5266): undefined reference to `pch_src_uuid_hi_read'
   riscv64-linux-ld: drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.o: in function `.L515':
>> pch_gbe_main.c:(.text+0x540e): undefined reference to `pch_rx_snap_read'
>> riscv64-linux-ld: pch_gbe_main.c:(.text+0x545c): undefined reference to `pch_ch_event_write'

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 66125 bytes --]

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

* Re: [PATCH] ptp: mark symbols static where possible
  2020-09-17  7:16 ` Leon Romanovsky
@ 2020-09-17 19:38   ` Jacob Keller
  0 siblings, 0 replies; 4+ messages in thread
From: Jacob Keller @ 2020-09-17 19:38 UTC (permalink / raw)
  To: Leon Romanovsky, Herrington; +Cc: Richard Cochran, netdev, linux-kernel



On 9/17/2020 12:16 AM, Leon Romanovsky wrote:
> On Thu, Sep 17, 2020 at 10:25:08AM +0800, Herrington wrote:
>> We get 1 warning when building kernel with W=1:
>> drivers/ptp/ptp_pch.c:182:5: warning: no previous prototype for ‘pch_ch_control_read’ [-Wmissing-prototypes]
>>  u32 pch_ch_control_read(struct pci_dev *pdev)
>> drivers/ptp/ptp_pch.c:193:6: warning: no previous prototype for ‘pch_ch_control_write’ [-Wmissing-prototypes]
>>  void pch_ch_control_write(struct pci_dev *pdev, u32 val)
>> drivers/ptp/ptp_pch.c:201:5: warning: no previous prototype for ‘pch_ch_event_read’ [-Wmissing-prototypes]
>>  u32 pch_ch_event_read(struct pci_dev *pdev)
>> drivers/ptp/ptp_pch.c:212:6: warning: no previous prototype for ‘pch_ch_event_write’ [-Wmissing-prototypes]
>>  void pch_ch_event_write(struct pci_dev *pdev, u32 val)
>> drivers/ptp/ptp_pch.c:220:5: warning: no previous prototype for ‘pch_src_uuid_lo_read’ [-Wmissing-prototypes]
>>  u32 pch_src_uuid_lo_read(struct pci_dev *pdev)
>> drivers/ptp/ptp_pch.c:231:5: warning: no previous prototype for ‘pch_src_uuid_hi_read’ [-Wmissing-prototypes]
>>  u32 pch_src_uuid_hi_read(struct pci_dev *pdev)
>> drivers/ptp/ptp_pch.c:242:5: warning: no previous prototype for ‘pch_rx_snap_read’ [-Wmissing-prototypes]
>>  u64 pch_rx_snap_read(struct pci_dev *pdev)
>> drivers/ptp/ptp_pch.c:259:5: warning: no previous prototype for ‘pch_tx_snap_read’ [-Wmissing-prototypes]
>>  u64 pch_tx_snap_read(struct pci_dev *pdev)
>> drivers/ptp/ptp_pch.c:300:5: warning: no previous prototype for ‘pch_set_station_address’ [-Wmissing-prototypes]
>>  int pch_set_station_address(u8 *addr, struct pci_dev *pdev)
>>
>> Signed-off-by: Herrington <hankinsea@gmail.com>
>> ---
>>  drivers/ptp/ptp_pch.c | 18 +++++++++---------
>>  1 file changed, 9 insertions(+), 9 deletions(-)
> 
> This file is total mess.
> 
>>
>> diff --git a/drivers/ptp/ptp_pch.c b/drivers/ptp/ptp_pch.c
>> index ce10ecd41ba0..8db2d1893577 100644
>> --- a/drivers/ptp/ptp_pch.c
>> +++ b/drivers/ptp/ptp_pch.c
>> @@ -179,7 +179,7 @@ static inline void pch_block_reset(struct pch_dev *chip)
>>  	iowrite32(val, (&chip->regs->control));
>>  }
>>
>> -u32 pch_ch_control_read(struct pci_dev *pdev)
>> +static u32 pch_ch_control_read(struct pci_dev *pdev)
>>  {
>>  	struct pch_dev *chip = pci_get_drvdata(pdev);
>>  	u32 val;
>> @@ -190,7 +190,7 @@ u32 pch_ch_control_read(struct pci_dev *pdev)
>>  }
>>  EXPORT_SYMBOL(pch_ch_control_read);
> 
> This function is not used and can be deleted.
> 
>>
>> -void pch_ch_control_write(struct pci_dev *pdev, u32 val)
>> +static void pch_ch_control_write(struct pci_dev *pdev, u32 val)
>>  {
>>  	struct pch_dev *chip = pci_get_drvdata(pdev);
>>
>> @@ -198,7 +198,7 @@ void pch_ch_control_write(struct pci_dev *pdev, u32 val)
>>  }
>>  EXPORT_SYMBOL(pch_ch_control_write);
> 
> 
> This function in use (incorrectly) by
> drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
> 
> Your patch will break it.
> 
> I didn't check other functions, but assume they are broken too.
> 
> Thanks
> 

Seems like the more appropriate fix is to include the right header so
that these functions do have prototypes.

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

end of thread, other threads:[~2020-09-17 20:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-17  2:25 [PATCH] ptp: mark symbols static where possible Herrington
2020-09-17  7:16 ` Leon Romanovsky
2020-09-17 19:38   ` Jacob Keller
2020-09-17  9:24 ` kernel test robot

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).