All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: Re: [PATCH v2] posix-timers: add multi_clock_gettime system call
Date: Fri, 1 Dec 2023 01:43:33 +0800	[thread overview]
Message-ID: <202312010141.Mz5MHrQK-lkp@intel.com> (raw)

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20231127153901.6399-1-maimon.sagi@gmail.com>
References: <20231127153901.6399-1-maimon.sagi@gmail.com>
TO: Sagi Maimon <maimon.sagi@gmail.com>
TO: richardcochran@gmail.com
TO: reibax@gmail.com
TO: davem@davemloft.net
TO: rrameshbabu@nvidia.com
CC: netdev@vger.kernel.org
CC: linux-kernel@vger.kernel.org
CC: maheshb@google.com
CC: maimon.sagi@gmail.com

Hi Sagi,

kernel test robot noticed the following build warnings:

[auto build test WARNING on arnd-asm-generic/master]
[also build test WARNING on tip/timers/core linus/master v6.7-rc3]
[cannot apply to tip/x86/asm next-20231130]
[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/Sagi-Maimon/posix-timers-add-multi_clock_gettime-system-call/20231128-000215
base:   https://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git master
patch link:    https://lore.kernel.org/r/20231127153901.6399-1-maimon.sagi%40gmail.com
patch subject: [PATCH v2] posix-timers: add multi_clock_gettime system call
:::::: branch date: 3 days ago
:::::: commit date: 3 days ago
config: x86_64-randconfig-r081-20231130 (https://download.01.org/0day-ci/archive/20231201/202312010141.Mz5MHrQK-lkp@intel.com/config)
compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
reproduce: (https://download.01.org/0day-ci/archive/20231201/202312010141.Mz5MHrQK-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>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202312010141.Mz5MHrQK-lkp@intel.com/

smatch warnings:
kernel/time/posix-timers.c:1457 __do_sys_multi_clock_gettime() error: uninitialized symbol 'error'.
kernel/time/posix-timers.c:1457 __do_sys_multi_clock_gettime() error: uninitialized symbol 'error'.
kernel/time/posix-timers.c:1488 __do_sys_multi_clock_gettime32() error: uninitialized symbol 'error'.
kernel/time/posix-timers.c:1488 __do_sys_multi_clock_gettime32() error: uninitialized symbol 'error'.

vim +/error +1457 kernel/time/posix-timers.c

6631fa12c105e3 Thomas Gleixner 2017-05-30  1428  
2b752da024b14d Sagi Maimon     2023-11-27  1429  SYSCALL_DEFINE1(multi_clock_gettime, struct __ptp_multi_clock_get __user *, ptp_multi_clk_get)
2b752da024b14d Sagi Maimon     2023-11-27  1430  {
2b752da024b14d Sagi Maimon     2023-11-27  1431  	const struct k_clock *kc;
2b752da024b14d Sagi Maimon     2023-11-27  1432  	struct timespec64 kernel_tp;
2b752da024b14d Sagi Maimon     2023-11-27  1433  	struct __ptp_multi_clock_get multi_clk_get;
2b752da024b14d Sagi Maimon     2023-11-27  1434  	int error;
2b752da024b14d Sagi Maimon     2023-11-27  1435  	unsigned int i, j;
2b752da024b14d Sagi Maimon     2023-11-27  1436  
2b752da024b14d Sagi Maimon     2023-11-27  1437  	if (copy_from_user(&multi_clk_get, ptp_multi_clk_get, sizeof(multi_clk_get)))
2b752da024b14d Sagi Maimon     2023-11-27  1438  		return -EFAULT;
2b752da024b14d Sagi Maimon     2023-11-27  1439  
2b752da024b14d Sagi Maimon     2023-11-27  1440  	if (multi_clk_get.n_samples > MULTI_PTP_MAX_SAMPLES)
2b752da024b14d Sagi Maimon     2023-11-27  1441  		return -EINVAL;
2b752da024b14d Sagi Maimon     2023-11-27  1442  	if (multi_clk_get.n_clocks > MULTI_PTP_MAX_CLOCKS)
2b752da024b14d Sagi Maimon     2023-11-27  1443  		return -EINVAL;
2b752da024b14d Sagi Maimon     2023-11-27  1444  
2b752da024b14d Sagi Maimon     2023-11-27  1445  	for (j = 0; j < multi_clk_get.n_samples; j++) {
2b752da024b14d Sagi Maimon     2023-11-27  1446  		for (i = 0; i < multi_clk_get.n_clocks; i++) {
2b752da024b14d Sagi Maimon     2023-11-27  1447  			kc = clockid_to_kclock(multi_clk_get.clkid_arr[i]);
2b752da024b14d Sagi Maimon     2023-11-27  1448  			if (!kc)
2b752da024b14d Sagi Maimon     2023-11-27  1449  				return -EINVAL;
2b752da024b14d Sagi Maimon     2023-11-27  1450  			error = kc->clock_get_timespec(multi_clk_get.clkid_arr[i], &kernel_tp);
2b752da024b14d Sagi Maimon     2023-11-27  1451  			if (!error && put_timespec64(&kernel_tp, (struct __kernel_timespec __user *)
2b752da024b14d Sagi Maimon     2023-11-27  1452  						     &ptp_multi_clk_get->ts[j][i]))
2b752da024b14d Sagi Maimon     2023-11-27  1453  				error = -EFAULT;
2b752da024b14d Sagi Maimon     2023-11-27  1454  		}
2b752da024b14d Sagi Maimon     2023-11-27  1455  	}
2b752da024b14d Sagi Maimon     2023-11-27  1456  
2b752da024b14d Sagi Maimon     2023-11-27 @1457  	return error;
2b752da024b14d Sagi Maimon     2023-11-27  1458  }
2b752da024b14d Sagi Maimon     2023-11-27  1459  
2b752da024b14d Sagi Maimon     2023-11-27  1460  SYSCALL_DEFINE1(multi_clock_gettime32, struct __ptp_multi_clock_get32 __user *, ptp_multi_clk_get)
2b752da024b14d Sagi Maimon     2023-11-27  1461  {
2b752da024b14d Sagi Maimon     2023-11-27  1462  	const struct k_clock *kc;
2b752da024b14d Sagi Maimon     2023-11-27  1463  	struct timespec64 kernel_tp;
2b752da024b14d Sagi Maimon     2023-11-27  1464  	struct __ptp_multi_clock_get multi_clk_get;
2b752da024b14d Sagi Maimon     2023-11-27  1465  	int error;
2b752da024b14d Sagi Maimon     2023-11-27  1466  	unsigned int i, j;
2b752da024b14d Sagi Maimon     2023-11-27  1467  
2b752da024b14d Sagi Maimon     2023-11-27  1468  	if (copy_from_user(&multi_clk_get, ptp_multi_clk_get, sizeof(multi_clk_get)))
2b752da024b14d Sagi Maimon     2023-11-27  1469  		return -EFAULT;
2b752da024b14d Sagi Maimon     2023-11-27  1470  
2b752da024b14d Sagi Maimon     2023-11-27  1471  	if (multi_clk_get.n_samples > MULTI_PTP_MAX_SAMPLES)
2b752da024b14d Sagi Maimon     2023-11-27  1472  		return -EINVAL;
2b752da024b14d Sagi Maimon     2023-11-27  1473  	if (multi_clk_get.n_clocks > MULTI_PTP_MAX_CLOCKS)
2b752da024b14d Sagi Maimon     2023-11-27  1474  		return -EINVAL;
2b752da024b14d Sagi Maimon     2023-11-27  1475  
2b752da024b14d Sagi Maimon     2023-11-27  1476  	for (j = 0; j < multi_clk_get.n_samples; j++) {
2b752da024b14d Sagi Maimon     2023-11-27  1477  		for (i = 0; i < multi_clk_get.n_clocks; i++) {
2b752da024b14d Sagi Maimon     2023-11-27  1478  			kc = clockid_to_kclock(multi_clk_get.clkid_arr[i]);
2b752da024b14d Sagi Maimon     2023-11-27  1479  			if (!kc)
2b752da024b14d Sagi Maimon     2023-11-27  1480  				return -EINVAL;
2b752da024b14d Sagi Maimon     2023-11-27  1481  			error = kc->clock_get_timespec(multi_clk_get.clkid_arr[i], &kernel_tp);
2b752da024b14d Sagi Maimon     2023-11-27  1482  			if (!error && put_old_timespec32(&kernel_tp, (struct old_timespec32 __user *)
2b752da024b14d Sagi Maimon     2023-11-27  1483  							&ptp_multi_clk_get->ts[j][i]))
2b752da024b14d Sagi Maimon     2023-11-27  1484  				error = -EFAULT;
2b752da024b14d Sagi Maimon     2023-11-27  1485  		}
2b752da024b14d Sagi Maimon     2023-11-27  1486  	}
2b752da024b14d Sagi Maimon     2023-11-27  1487  
2b752da024b14d Sagi Maimon     2023-11-27 @1488  	return error;
2b752da024b14d Sagi Maimon     2023-11-27  1489  }
2b752da024b14d Sagi Maimon     2023-11-27  1490  

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

             reply	other threads:[~2023-11-30 17:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-30 17:43 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-11-27 15:39 [PATCH v2] posix-timers: add multi_clock_gettime system call Sagi Maimon
2023-11-28  0:11 ` Richard Cochran
2023-11-28  0:46   ` John Stultz
2023-11-30 15:45     ` Sagi Maimon
2023-11-28 11:45 ` kernel test robot
2023-11-28 13:36 ` kernel test robot
2023-11-30 15:43 ` kernel test robot
2023-12-15 18:04 ` Thomas Gleixner
2023-12-27 15:09   ` Sagi Maimon

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=202312010141.Mz5MHrQK-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=error27@gmail.com \
    --cc=oe-kbuild@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.