All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Jarkko Sonninen <kasper@iki.fi>
Cc: oe-kbuild-all@lists.linux.dev, Johan Hovold <johan@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4] USB: serial: xr: Add TIOCGRS485 and TIOCSRS485 ioctls
Date: Mon, 24 Apr 2023 13:32:24 +0800	[thread overview]
Message-ID: <202304241303.WkdqPPbt-lkp@intel.com> (raw)
In-Reply-To: <20230423185929.1595056-1-kasper@iki.fi>

Hi Jarkko,

kernel test robot noticed the following build warnings:

[auto build test WARNING on johan-usb-serial/usb-next]
[also build test WARNING on johan-usb-serial/usb-linus linus/master v6.3 next-20230421]
[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/Jarkko-Sonninen/USB-serial-xr-Add-TIOCGRS485-and-TIOCSRS485-ioctls/20230424-030038
base:   https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial.git usb-next
patch link:    https://lore.kernel.org/r/20230423185929.1595056-1-kasper%40iki.fi
patch subject: [PATCH v4] USB: serial: xr: Add TIOCGRS485 and TIOCSRS485 ioctls
config: ia64-randconfig-s053-20230423 (https://download.01.org/0day-ci/archive/20230424/202304241303.WkdqPPbt-lkp@intel.com/config)
compiler: ia64-linux-gcc (GCC) 12.1.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.4-39-gce1a6720-dirty
        # https://github.com/intel-lab-lkp/linux/commit/a80fa27b4fe1974bad2427d7f3260012a04b721a
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Jarkko-Sonninen/USB-serial-xr-Add-TIOCGRS485-and-TIOCSRS485-ioctls/20230424-030038
        git checkout a80fa27b4fe1974bad2427d7f3260012a04b721a
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=ia64 olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=ia64 SHELL=/bin/bash drivers/usb/serial/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202304241303.WkdqPPbt-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> drivers/usb/serial/xr_serial.c:856:26: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void [noderef] __user *to @@     got struct serial_rs485 *argp @@
   drivers/usb/serial/xr_serial.c:856:26: sparse:     expected void [noderef] __user *to
   drivers/usb/serial/xr_serial.c:856:26: sparse:     got struct serial_rs485 *argp
>> drivers/usb/serial/xr_serial.c:872:36: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const [noderef] __user *from @@     got struct serial_rs485 *argp @@
   drivers/usb/serial/xr_serial.c:872:36: sparse:     expected void const [noderef] __user *from
   drivers/usb/serial/xr_serial.c:872:36: sparse:     got struct serial_rs485 *argp
   drivers/usb/serial/xr_serial.c:881:26: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void [noderef] __user *to @@     got struct serial_rs485 *argp @@
   drivers/usb/serial/xr_serial.c:881:26: sparse:     expected void [noderef] __user *to
   drivers/usb/serial/xr_serial.c:881:26: sparse:     got struct serial_rs485 *argp
>> drivers/usb/serial/xr_serial.c:893:49: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected struct serial_rs485 *argp @@     got void [noderef] __user *argp @@
   drivers/usb/serial/xr_serial.c:893:49: sparse:     expected struct serial_rs485 *argp
   drivers/usb/serial/xr_serial.c:893:49: sparse:     got void [noderef] __user *argp
   drivers/usb/serial/xr_serial.c:895:49: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected struct serial_rs485 *argp @@     got void [noderef] __user *argp @@
   drivers/usb/serial/xr_serial.c:895:49: sparse:     expected struct serial_rs485 *argp
   drivers/usb/serial/xr_serial.c:895:49: sparse:     got void [noderef] __user *argp

vim +856 drivers/usb/serial/xr_serial.c

   848	
   849	static int xr_get_rs485_config(struct tty_struct *tty,
   850				       struct serial_rs485 *argp)
   851	{
   852		struct usb_serial_port *port = tty->driver_data;
   853		struct xr_data *data = usb_get_serial_port_data(port);
   854	
   855		mutex_lock(&data->lock);
 > 856		if (copy_to_user(argp, &data->rs485, sizeof(data->rs485))) {
   857			mutex_unlock(&data->lock);
   858			return -EFAULT;
   859		}
   860		mutex_unlock(&data->lock);
   861	
   862		return 0;
   863	}
   864	
   865	static int xr_set_rs485_config(struct tty_struct *tty,
   866				       struct serial_rs485 *argp)
   867	{
   868		struct usb_serial_port *port = tty->driver_data;
   869		struct xr_data *data = usb_get_serial_port_data(port);
   870		struct serial_rs485 rs485;
   871	
 > 872		if (copy_from_user(&rs485, argp, sizeof(rs485)))
   873			return -EFAULT;
   874		xr_sanitize_serial_rs485(&rs485);
   875	
   876		mutex_lock(&data->lock);
   877		data->rs485 = rs485;
   878		xr_set_flow_mode(tty, port, NULL);
   879		mutex_unlock(&data->lock);
   880	
   881		if (copy_to_user(argp, &rs485, sizeof(rs485)))
   882			return -EFAULT;
   883	
   884		return 0;
   885	}
   886	
   887	static int xr_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg)
   888	{
   889		void __user *argp = (void __user *)arg;
   890	
   891		switch (cmd) {
   892		case TIOCGRS485:
 > 893			return xr_get_rs485_config(tty, argp);
   894		case TIOCSRS485:
   895			return xr_set_rs485_config(tty, argp);
   896		}
   897	
   898		return -ENOIOCTLCMD;
   899	}
   900	

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

  reply	other threads:[~2023-04-24  5:32 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-13  1:04 [PATCH] USB: serial: xr: Add TIOCGRS485 and TIOCSRS485 ioctls Jarkko Sonninen
2023-03-13  7:00 ` Greg Kroah-Hartman
2023-03-13  7:49   ` Jarkko Sonninen
2023-03-13  7:53     ` Greg Kroah-Hartman
2023-03-13  8:27       ` [PATCH v2] " Jarkko Sonninen
2023-03-13  8:45         ` Greg Kroah-Hartman
2023-03-13  9:54         ` Oliver Neukum
2023-03-13 10:47           ` Jarkko Sonninen
2023-03-13 11:27             ` Oliver Neukum
2023-03-13 23:02         ` David Laight
2023-03-14  6:19         ` kernel test robot
2023-03-13 15:07       ` [PATCH] " Jarkko Sonninen
2023-03-13 15:50         ` Greg Kroah-Hartman
2023-03-13 15:53           ` Jarkko Sonninen
2023-03-13 20:18           ` Oliver Neukum
2023-03-14  7:00 ` [PATCH v3] " Jarkko Sonninen
2023-03-14  7:37   ` Greg Kroah-Hartman
2023-03-14  8:00     ` Jarkko Sonninen
2023-04-13  8:57     ` Johan Hovold
2023-04-13  8:53   ` Johan Hovold
2023-04-16  8:40     ` Jarkko Sonninen
2023-04-17 14:50       ` Johan Hovold
2023-04-23 18:59         ` [PATCH v4] " Jarkko Sonninen
2023-04-24  5:32           ` kernel test robot [this message]
2023-06-20 12:38           ` Johan Hovold
2023-07-06 19:37             ` Jarkko Sonninen
2023-07-20 13:46               ` Johan Hovold
2023-07-08 14:56             ` [PATCH v5] " Jarkko Sonninen
2023-07-20 13:52               ` Johan Hovold

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=202304241303.WkdqPPbt-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=johan@kernel.org \
    --cc=kasper@iki.fi \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --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.