Skip to contentSkip to conversation

ptp: mark symbols static where possible

PATCH In review Herrington 3 participants 4 messages Sep 18, 2020

Subsystems (3)
lore
Share & tools
lore

Herrington

author
#0 lore raw

PATCH v3 1/1 ptp: mark symbols static where possible

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)

---
 drivers/ptp/ptp_pch.c            | 11 -----------
 include/linux/ptp_clock_kernel.h |  9 +++++++++
 2 files changed, 9 insertions(+), 11 deletions(-)
drivers/ptp/ptp_pch.c +0 -11
index ce10ecd41ba0..f7ff7230623e 100644
@@ -179,17 +179,6 @@ static inline void pch_block_reset(struct pch_dev *chip)
 	iowrite32(val, (&chip->regs->control));
 }
 
-u32 pch_ch_control_read(struct pci_dev *pdev)
-{
-	struct pch_dev *chip = pci_get_drvdata(pdev);
-	u32 val;
-
-	val = ioread32(&chip->regs->ch_control);
-
-	return val;
-}
-EXPORT_SYMBOL(pch_ch_control_read);
-
 void pch_ch_control_write(struct pci_dev *pdev, u32 val)
 {
 	struct pch_dev *chip = pci_get_drvdata(pdev);
include/linux/ptp_clock_kernel.h +9 -0
index d3e8ba5c7125..5db4b8891b22 100644
@@ -307,4 +307,13 @@ static inline void ptp_read_system_postts(struct ptp_system_timestamp *sts)
 		ktime_get_real_ts64(&sts->post_ts);
 }
 
+void pch_ch_control_write(struct pci_dev *pdev, u32 val);
+u32 pch_ch_event_read(struct pci_dev *pdev);
+void pch_ch_event_write(struct pci_dev *pdev, u32 val);
+u32 pch_src_uuid_lo_read(struct pci_dev *pdev);
+u32 pch_src_uuid_hi_read(struct pci_dev *pdev);
+u64 pch_rx_snap_read(struct pci_dev *pdev);
+u64 pch_tx_snap_read(struct pci_dev *pdev);
+int pch_set_station_address(u8 *addr, struct pci_dev *pdev);
+
 #endif
Signature · 1 line
2.18.1
maintainer
#1 lore raw
Quoted 6 lines · Herrington
include/linux/ptp_clock_kernel.h +0 -0
index d3e8ba5c7125..5db4b8891b22 100644
@@ -307,4 +307,13 @@ static inline void ptp_read_system_postts(struct ptp_system_timestamp *sts)
 		ktime_get_real_ts64(&sts->post_ts);

include/linux/ptp_clock_kernel.h static inline void ptp_read_system_postts(struct ptp_system_timestamp *sts) · line 317

Quoted 10 lines
include/linux/ptp_clock_kernel.h +8 -0
 }
 
+void pch_ch_control_write(struct pci_dev *pdev, u32 val);
+u32 pch_ch_event_read(struct pci_dev *pdev);
+void pch_ch_event_write(struct pci_dev *pdev, u32 val);
+u32 pch_src_uuid_lo_read(struct pci_dev *pdev);
+u32 pch_src_uuid_hi_read(struct pci_dev *pdev);
+u64 pch_rx_snap_read(struct pci_dev *pdev);
+u64 pch_tx_snap_read(struct pci_dev *pdev);
+int pch_set_station_address(u8 *addr, struct pci_dev *pdev);

NAK. Please see Jacob's comment on the origin patch.

Thanks,
Richard

#2 lore raw
In reply to Herrington
Thank you for the patch! Perhaps something to improve:

Hi Herrington,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v5.9-rc5 next-20200918]
[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/20200918-181139
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 10b82d5176488acee2820e5a2cf0f2ec5c3488b6
config: arc-allyesconfig (attached as .config)
compiler: arceb-elf-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=arc

If you fix the issue, kindly add following tag as appropriate

All warnings (new ones prefixed by >>):

In file included from drivers/net/ethernet/aquantia/atlantic/aq_ptp.c:12:

>> include/linux/ptp_clock_kernel.h:310:34: warning: 'struct pci_dev' declared inside parameter list will not be visible outside of this definition or declaration
     310 | void pch_ch_control_write(struct pci_dev *pdev, u32 val);
         |                                  ^~~~~~~
   include/linux/ptp_clock_kernel.h:311:30: warning: 'struct pci_dev' declared inside parameter list will not be visible outside of this definition or declaration
     311 | u32 pch_ch_event_read(struct pci_dev *pdev);
         |                              ^~~~~~~
   include/linux/ptp_clock_kernel.h:312:32: warning: 'struct pci_dev' declared inside parameter list will not be visible outside of this definition or declaration
     312 | void pch_ch_event_write(struct pci_dev *pdev, u32 val);
         |                                ^~~~~~~
   include/linux/ptp_clock_kernel.h:313:33: warning: 'struct pci_dev' declared inside parameter list will not be visible outside of this definition or declaration
     313 | u32 pch_src_uuid_lo_read(struct pci_dev *pdev);
         |                                 ^~~~~~~
   include/linux/ptp_clock_kernel.h:314:33: warning: 'struct pci_dev' declared inside parameter list will not be visible outside of this definition or declaration
     314 | u32 pch_src_uuid_hi_read(struct pci_dev *pdev);
         |                                 ^~~~~~~
   include/linux/ptp_clock_kernel.h:315:29: warning: 'struct pci_dev' declared inside parameter list will not be visible outside of this definition or declaration
     315 | u64 pch_rx_snap_read(struct pci_dev *pdev);
         |                             ^~~~~~~
   include/linux/ptp_clock_kernel.h:316:29: warning: 'struct pci_dev' declared inside parameter list will not be visible outside of this definition or declaration
     316 | u64 pch_tx_snap_read(struct pci_dev *pdev);
         |                             ^~~~~~~
   include/linux/ptp_clock_kernel.h:317:46: warning: 'struct pci_dev' declared inside parameter list will not be visible outside of this definition or declaration
     317 | int pch_set_station_address(u8 *addr, struct pci_dev *pdev);
         |                                              ^~~~~~~

# https://github.com/0day-ci/linux/commit/d5fd7587ec0ce30118654a4b5c38a41a19ea5920
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Herrington/ptp-mark-symbols-static-where-possible/20200918-181139 git checkout d5fd7587ec0ce30118654a4b5c38a41a19ea5920
vim +310 include/linux/ptp_clock_kernel.h

309

 > 310	void pch_ch_control_write(struct pci_dev *pdev, u32 val);

311 u32 pch_ch_event_read(struct pci_dev *pdev);
312 void pch_ch_event_write(struct pci_dev *pdev, u32 val);
313 u32 pch_src_uuid_lo_read(struct pci_dev *pdev);
314 u32 pch_src_uuid_hi_read(struct pci_dev *pdev);
315 u64 pch_rx_snap_read(struct pci_dev *pdev);
316 u64 pch_tx_snap_read(struct pci_dev *pdev);
317 int pch_set_station_address(u8 *addr, struct pci_dev *pdev);
318

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

#3 lore raw
In reply to Herrington
Thank you for the patch! Perhaps something to improve:

Hi Herrington,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v5.9-rc5 next-20200918]
[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/20200918-181139
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 10b82d5176488acee2820e5a2cf0f2ec5c3488b6
config: x86_64-randconfig-a002-20200917 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 0ff28fa6a75617d61b1aeea77463d6a1684c3c89)

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
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64

If you fix the issue, kindly add following tag as appropriate

All warnings (new ones prefixed by >>):

In file included from drivers/ptp/ptp_chardev.c:16:
In file included from drivers/ptp/ptp_private.h:16:

>> include/linux/ptp_clock_kernel.h:310:34: warning: declaration of 'struct pci_dev' will not be visible outside of this function [-Wvisibility]
   void pch_ch_control_write(struct pci_dev *pdev, u32 val);
                                    ^
   include/linux/ptp_clock_kernel.h:311:30: warning: declaration of 'struct pci_dev' will not be visible outside of this function [-Wvisibility]
   u32 pch_ch_event_read(struct pci_dev *pdev);
                                ^
   include/linux/ptp_clock_kernel.h:312:32: warning: declaration of 'struct pci_dev' will not be visible outside of this function [-Wvisibility]
   void pch_ch_event_write(struct pci_dev *pdev, u32 val);
                                  ^
   include/linux/ptp_clock_kernel.h:313:33: warning: declaration of 'struct pci_dev' will not be visible outside of this function [-Wvisibility]
   u32 pch_src_uuid_lo_read(struct pci_dev *pdev);
                                   ^
   include/linux/ptp_clock_kernel.h:314:33: warning: declaration of 'struct pci_dev' will not be visible outside of this function [-Wvisibility]
   u32 pch_src_uuid_hi_read(struct pci_dev *pdev);
                                   ^
   include/linux/ptp_clock_kernel.h:315:29: warning: declaration of 'struct pci_dev' will not be visible outside of this function [-Wvisibility]
   u64 pch_rx_snap_read(struct pci_dev *pdev);
                               ^
   include/linux/ptp_clock_kernel.h:316:29: warning: declaration of 'struct pci_dev' will not be visible outside of this function [-Wvisibility]
   u64 pch_tx_snap_read(struct pci_dev *pdev);
                               ^
   include/linux/ptp_clock_kernel.h:317:46: warning: declaration of 'struct pci_dev' will not be visible outside of this function [-Wvisibility]
   int pch_set_station_address(u8 *addr, struct pci_dev *pdev);
                                                ^

8 warnings generated.

# https://github.com/0day-ci/linux/commit/d5fd7587ec0ce30118654a4b5c38a41a19ea5920
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Herrington/ptp-mark-symbols-static-where-possible/20200918-181139 git checkout d5fd7587ec0ce30118654a4b5c38a41a19ea5920
vim +310 include/linux/ptp_clock_kernel.h

309

 > 310	void pch_ch_control_write(struct pci_dev *pdev, u32 val);

311 u32 pch_ch_event_read(struct pci_dev *pdev);
312 void pch_ch_event_write(struct pci_dev *pdev, u32 val);
313 u32 pch_src_uuid_lo_read(struct pci_dev *pdev);
314 u32 pch_src_uuid_hi_read(struct pci_dev *pdev);
315 u64 pch_rx_snap_read(struct pci_dev *pdev);
316 u64 pch_tx_snap_read(struct pci_dev *pdev);
317 int pch_set_station_address(u8 *addr, struct pci_dev *pdev);
318

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