Subject: Re: [PATCH v15 3/9] ptp: Reorganize ptp_kvm module to make it arch-independent.

From: kernel test robot <[email-masked]>
Date: Wed, 11 Nov 2020 22:36:32 +0800

Hi Jianyong,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v5.10-rc3 next-20201111]
[cannot apply to tip/timers/core kvmarm/next kvm/linux-next]
[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/Jianyong-Wu/Enable-ptp_kvm-for-arm-arm64/20201111-142600
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git eccc876724927ff3b9ff91f36f7b6b159e948f0c
config: x86_64-randconfig-a005-20201111 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 874b0a0b9db93f5d3350ffe6b5efda2d908415d0)
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
        # https://github.com/0day-ci/linux/commit/8cc52e023b81a9f561cc2094ecdd7266f5e29230
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Jianyong-Wu/Enable-ptp_kvm-for-arm-arm64/20201111-142600
        git checkout 8cc52e023b81a9f561cc2094ecdd7266f5e29230
        # 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
Reported-by: kernel test robot <[email-masked]>

All warnings (new ones prefixed by >>):

>> drivers/ptp/ptp_kvm_x86.c:21:5: warning: no previous prototype for function 'kvm_arch_ptp_init' [-Wmissing-prototypes]
   int kvm_arch_ptp_init(void)
       ^
   drivers/ptp/ptp_kvm_x86.c:21:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   int kvm_arch_ptp_init(void)
   ^
   static 
>> drivers/ptp/ptp_kvm_x86.c:41:5: warning: no previous prototype for function 'kvm_arch_ptp_get_clock' [-Wmissing-prototypes]
   int kvm_arch_ptp_get_clock(struct timespec64 *ts)
       ^
   drivers/ptp/ptp_kvm_x86.c:41:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   int kvm_arch_ptp_get_clock(struct timespec64 *ts)
   ^
   static 
>> drivers/ptp/ptp_kvm_x86.c:59:5: warning: no previous prototype for function 'kvm_arch_ptp_get_crosststamp' [-Wmissing-prototypes]
   int kvm_arch_ptp_get_crosststamp(u64 *cycle, struct timespec64 *tspec,
       ^
   drivers/ptp/ptp_kvm_x86.c:59:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   int kvm_arch_ptp_get_crosststamp(u64 *cycle, struct timespec64 *tspec,
   ^
   static 
   3 warnings generated.

vim +/kvm_arch_ptp_init +21 drivers/ptp/ptp_kvm_x86.c

    20	
  > 21	int kvm_arch_ptp_init(void)
    22	{
    23		long ret;
    24	
    25		if (!kvm_para_available())
    26			return -ENODEV;
    27	
    28		clock_pair_gpa = slow_virt_to_phys(&clock_pair);
    29		hv_clock = pvclock_get_pvti_cpu0_va();
    30		if (!hv_clock)
    31			return -ENODEV;
    32	
    33		ret = kvm_hypercall2(KVM_HC_CLOCK_PAIRING, clock_pair_gpa,
    34				     KVM_CLOCK_PAIRING_WALLCLOCK);
    35		if (ret == -KVM_ENOSYS || ret == -KVM_EOPNOTSUPP)
    36			return -ENODEV;
    37	
    38		return 0;
    39	}
    40	
  > 41	int kvm_arch_ptp_get_clock(struct timespec64 *ts)
    42	{
    43		unsigned long ret;
    44	
    45		ret = kvm_hypercall2(KVM_HC_CLOCK_PAIRING,
    46				     clock_pair_gpa,
    47				     KVM_CLOCK_PAIRING_WALLCLOCK);
    48		if (ret != 0) {
    49			pr_err_ratelimited("clock offset hypercall ret %lu\n", ret);
    50			return -EOPNOTSUPP;
    51		}
    52	
    53		ts->tv_sec = clock_pair.sec;
    54		ts->tv_nsec = clock_pair.nsec;
    55	
    56		return 0;
    57	}
    58	
  > 59	int kvm_arch_ptp_get_crosststamp(u64 *cycle, struct timespec64 *tspec,

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email-masked]