All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Maciek Machnikowski <maciek@machnikowski.net>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: Re: [RFC 1/3] ptp: Implement timex esterror support
Date: Sat, 17 Aug 2024 13:40:48 +0800	[thread overview]
Message-ID: <202408171333.n2ohRgye-lkp@intel.com> (raw)
In-Reply-To: <20240813125602.155827-2-maciek@machnikowski.net>

Hi Maciek,

[This is a private test report for your RFC patch.]
kernel test robot noticed the following build warnings:

[auto build test WARNING on shuah-kselftest/next]
[also build test WARNING on shuah-kselftest/fixes net/main net-next/main linus/master horms-ipvs/master v6.11-rc3 next-20240816]
[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#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Maciek-Machnikowski/ptp-Implement-timex-esterror-support/20240814-233156
base:   https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git next
patch link:    https://lore.kernel.org/r/20240813125602.155827-2-maciek%40machnikowski.net
patch subject: [RFC 1/3] ptp: Implement timex esterror support
config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20240817/202408171333.n2ohRgye-lkp@intel.com/config)
compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project 26670e7fa4f032a019d23d56c6a02926e854e8af)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240817/202408171333.n2ohRgye-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202408171333.n2ohRgye-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from include/linux/device.h:32:
   In file included from include/linux/device/driver.h:21:
   In file included from include/linux/module.h:19:
   In file included from include/linux/elf.h:6:
   In file included from arch/s390/include/asm/elf.h:181:
   In file included from arch/s390/include/asm/mmu_context.h:11:
   In file included from arch/s390/include/asm/pgalloc.h:18:
   In file included from include/linux/mm.h:2228:
   include/linux/vmstat.h:500:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     500 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     501 |                            item];
         |                            ~~~~
   include/linux/vmstat.h:507:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     507 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     508 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmstat.h:514:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     514 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
   include/linux/vmstat.h:519:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     519 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     520 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmstat.h:528:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     528 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     529 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/ptp/ptp_clock.c:21:
   In file included from drivers/ptp/ptp_private.h:16:
   In file included from include/linux/ptp_clock_kernel.h:15:
   In file included from include/linux/skbuff.h:28:
   In file included from include/linux/dma-mapping.h:11:
   In file included from include/linux/scatterlist.h:9:
   In file included from arch/s390/include/asm/io.h:93:
   include/asm-generic/io.h:548:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     548 |         val = __raw_readb(PCI_IOBASE + addr);
         |                           ~~~~~~~~~~ ^
   include/asm-generic/io.h:561:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     561 |         val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
         |                                                         ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/big_endian.h:37:59: note: expanded from macro '__le16_to_cpu'
      37 | #define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
         |                                                           ^
   include/uapi/linux/swab.h:102:54: note: expanded from macro '__swab16'
     102 | #define __swab16(x) (__u16)__builtin_bswap16((__u16)(x))
         |                                                      ^
   In file included from drivers/ptp/ptp_clock.c:21:
   In file included from drivers/ptp/ptp_private.h:16:
   In file included from include/linux/ptp_clock_kernel.h:15:
   In file included from include/linux/skbuff.h:28:
   In file included from include/linux/dma-mapping.h:11:
   In file included from include/linux/scatterlist.h:9:
   In file included from arch/s390/include/asm/io.h:93:
   include/asm-generic/io.h:574:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     574 |         val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
         |                                                         ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/big_endian.h:35:59: note: expanded from macro '__le32_to_cpu'
      35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
         |                                                           ^
   include/uapi/linux/swab.h:115:54: note: expanded from macro '__swab32'
     115 | #define __swab32(x) (__u32)__builtin_bswap32((__u32)(x))
         |                                                      ^
   In file included from drivers/ptp/ptp_clock.c:21:
   In file included from drivers/ptp/ptp_private.h:16:
   In file included from include/linux/ptp_clock_kernel.h:15:
   In file included from include/linux/skbuff.h:28:
   In file included from include/linux/dma-mapping.h:11:
   In file included from include/linux/scatterlist.h:9:
   In file included from arch/s390/include/asm/io.h:93:
   include/asm-generic/io.h:585:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     585 |         __raw_writeb(value, PCI_IOBASE + addr);
         |                             ~~~~~~~~~~ ^
   include/asm-generic/io.h:595:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     595 |         __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
         |                                                       ~~~~~~~~~~ ^
   include/asm-generic/io.h:605:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     605 |         __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
         |                                                       ~~~~~~~~~~ ^
   include/asm-generic/io.h:693:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     693 |         readsb(PCI_IOBASE + addr, buffer, count);
         |                ~~~~~~~~~~ ^
   include/asm-generic/io.h:701:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     701 |         readsw(PCI_IOBASE + addr, buffer, count);
         |                ~~~~~~~~~~ ^
   include/asm-generic/io.h:709:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     709 |         readsl(PCI_IOBASE + addr, buffer, count);
         |                ~~~~~~~~~~ ^
   include/asm-generic/io.h:718:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     718 |         writesb(PCI_IOBASE + addr, buffer, count);
         |                 ~~~~~~~~~~ ^
   include/asm-generic/io.h:727:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     727 |         writesw(PCI_IOBASE + addr, buffer, count);
         |                 ~~~~~~~~~~ ^
   include/asm-generic/io.h:736:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     736 |         writesl(PCI_IOBASE + addr, buffer, count);
         |                 ~~~~~~~~~~ ^
>> drivers/ptp/ptp_clock.c:171:4: warning: add explicit braces to avoid dangling else [-Wdangling-else]
     171 |                         else
         |                         ^
   18 warnings generated.


vim +171 drivers/ptp/ptp_clock.c

   117	
   118	static int ptp_clock_adjtime(struct posix_clock *pc, struct __kernel_timex *tx)
   119	{
   120		struct ptp_clock *ptp = container_of(pc, struct ptp_clock, clock);
   121		struct ptp_clock_info *ops;
   122		int err = -EOPNOTSUPP;
   123	
   124		if (ptp_clock_freerun(ptp)) {
   125			pr_err("ptp: physical clock is free running\n");
   126			return -EBUSY;
   127		}
   128	
   129		ops = ptp->info;
   130	
   131		if (tx->modes & ADJ_SETOFFSET) {
   132			struct timespec64 ts;
   133			ktime_t kt;
   134			s64 delta;
   135	
   136			ts.tv_sec  = tx->time.tv_sec;
   137			ts.tv_nsec = tx->time.tv_usec;
   138	
   139			if (!(tx->modes & ADJ_NANO))
   140				ts.tv_nsec *= 1000;
   141	
   142			if ((unsigned long) ts.tv_nsec >= NSEC_PER_SEC)
   143				return -EINVAL;
   144	
   145			kt = timespec64_to_ktime(ts);
   146			delta = ktime_to_ns(kt);
   147			err = ops->adjtime(ops, delta);
   148		} else if (tx->modes & ADJ_FREQUENCY) {
   149			long ppb = scaled_ppm_to_ppb(tx->freq);
   150			if (ppb > ops->max_adj || ppb < -ops->max_adj)
   151				return -ERANGE;
   152			err = ops->adjfine(ops, tx->freq);
   153			ptp->dialed_frequency = tx->freq;
   154		} else if (tx->modes & ADJ_OFFSET) {
   155			if (ops->adjphase) {
   156				s32 max_phase_adj = ops->getmaxphase(ops);
   157				s32 offset = tx->offset;
   158	
   159				if (!(tx->modes & ADJ_NANO))
   160					offset *= NSEC_PER_USEC;
   161	
   162				if (offset > max_phase_adj || offset < -max_phase_adj)
   163					return -ERANGE;
   164	
   165				err = ops->adjphase(ops, offset);
   166			}
   167		} else if (tx->modes & ADJ_ESTERROR) {
   168			if (ops->setesterror)
   169				if (tx->modes & ADJ_NANO)
   170					err = ops->setesterror(ops, tx->esterror * 1000);
 > 171				else
   172					err = ops->setesterror(ops, tx->esterror);
   173		} else if (tx->modes == 0) {
   174			long esterror;
   175	
   176			tx->freq = ptp->dialed_frequency;
   177			if (ops->getesterror) {
   178				err = ops->getesterror(ops, &esterror, NULL, NULL);
   179				if (err)
   180					return err;
   181				tx->modes &= ADJ_NANO;
   182				tx->esterror = esterror;
   183			} else {
   184				err = 0;
   185			}
   186		}
   187	
   188		return err;
   189	}
   190	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

  parent reply	other threads:[~2024-08-17  5:41 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-13 12:55 [RFC 0/3] ptp: Add esterror support Maciek Machnikowski
2024-08-13 12:56 ` [RFC 1/3] ptp: Implement timex " Maciek Machnikowski
2024-08-14  9:29   ` Vadim Fedorenko
2024-08-15  9:33     ` Maciek Machnikowski
2024-08-14 11:46   ` Simon Horman
2024-08-15  9:32     ` Maciek Machnikowski
2024-08-15  4:23   ` Richard Cochran
2024-08-15  9:43     ` Maciek Machnikowski
2024-08-15  9:47     ` Maciek Machnikowski
2024-08-15 21:04       ` Richard Cochran
2024-08-16 16:01   ` kernel test robot
2024-08-17  5:40   ` kernel test robot [this message]
2024-08-13 12:56 ` [RFC 2/3] ptp: Implement support for esterror in ptp_mock Maciek Machnikowski
2024-08-13 12:56 ` [RFC 3/3] ptp: Add setting esterror and reading timex structure Maciek Machnikowski
2024-08-13 20:05 ` [RFC 0/3] ptp: Add esterror support Andrew Lunn
2024-08-14  8:44   ` Vadim Fedorenko
2024-08-14 13:08     ` Andrew Lunn
2024-08-14 15:08       ` Maciek Machnikowski
2024-08-15  3:53         ` Richard Cochran
2024-08-15  9:40           ` Maciek Machnikowski
2024-08-15 14:26             ` Andrew Lunn
2024-08-15 15:00               ` Maciek Machnikowski
2024-08-15 21:08                 ` Richard Cochran
2024-08-15 22:06                   ` Maciek Machnikowski
2024-08-15 23:11                     ` Andrew Lunn
2024-08-16  4:13                       ` Maciek Machnikowski
2024-08-17  4:29                     ` Richard Cochran
2024-08-15  3:33       ` Richard Cochran
2024-08-15  4:16         ` Richard Cochran
2024-08-15  5:24           ` Miroslav Lichvar
2024-08-15  9:45             ` Maciek Machnikowski
2024-08-15  9:41           ` Maciek Machnikowski
2024-08-15  0:41 ` Jakub Kicinski
2024-08-15  3:42   ` Richard Cochran
2024-08-15  4:17     ` Richard Cochran
2024-08-15  9:35   ` Maciek Machnikowski
2024-08-15 10:29     ` Vadim Fedorenko
2024-08-15 11:40       ` Arinzon, David

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202408171333.n2ohRgye-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=llvm@lists.linux.dev \
    --cc=maciek@machnikowski.net \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.