linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "Johnson CH Chen (陳昭勳)" <JohnsonCH.Chen@moxa.com>,
	"Jiri Slaby" <jirislaby@gmail.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
Cc: kbuild-all@lists.01.org,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>
Subject: Re: [PATCH] tty: Add MOXA NPort Real TTY Driver
Date: Wed, 15 Jul 2020 16:27:58 +0800	[thread overview]
Message-ID: <202007151654.blCbcUU2%lkp@intel.com> (raw)
In-Reply-To: <HK2PR01MB328134FB2EF5F9D1E381BDA3FA610@HK2PR01MB3281.apcprd01.prod.exchangelabs.com>

[-- Attachment #1: Type: text/plain, Size: 13972 bytes --]

Hi "Johnson,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on tty/tty-testing]
[also build test WARNING on v5.8-rc5 next-20200714]
[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/Johnson-CH-Chen/tty-Add-MOXA-NPort-Real-TTY-Driver/20200714-142712
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tty-testing
config: sparc64-randconfig-s032-20200715 (attached as .config)
compiler: sparc64-linux-gcc (GCC) 9.3.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.2-49-g707c5017-dirty
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=sparc64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)

>> drivers/tty/npreal2.c:1107:26: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void [noderef] __user *to @@     got struct serial_struct *retinfo @@
>> drivers/tty/npreal2.c:1107:26: sparse:     expected void [noderef] __user *to
>> drivers/tty/npreal2.c:1107:26: sparse:     got struct serial_struct *retinfo
>> drivers/tty/npreal2.c:1122:56: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const [noderef] __user *from @@     got struct serial_struct *new_info @@
>> drivers/tty/npreal2.c:1122:56: sparse:     expected void const [noderef] __user *from
>> drivers/tty/npreal2.c:1122:56: sparse:     got struct serial_struct *new_info
>> drivers/tty/npreal2.c:1149:57: sparse: sparse: Using plain integer as NULL pointer
>> drivers/tty/npreal2.c:1186:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user * @@     got unsigned int *value @@
>> drivers/tty/npreal2.c:1186:9: sparse:     expected void const volatile [noderef] __user *
>> drivers/tty/npreal2.c:1186:9: sparse:     got unsigned int *value
   drivers/tty/npreal2.c:1624:38: sparse: sparse: Using plain integer as NULL pointer
   drivers/tty/npreal2.c:1897:34: sparse: sparse: Using plain integer as NULL pointer
   drivers/tty/npreal2.c:1914:21: sparse: sparse: Using plain integer as NULL pointer
   drivers/tty/npreal2.c:1984:46: sparse: sparse: Using plain integer as NULL pointer
>> drivers/tty/npreal2.c:2261:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user * @@     got unsigned long * @@
   drivers/tty/npreal2.c:2261:17: sparse:     expected void const volatile [noderef] __user *
>> drivers/tty/npreal2.c:2261:17: sparse:     got unsigned long *
   drivers/tty/npreal2.c:2265:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user * @@     got unsigned long * @@
   drivers/tty/npreal2.c:2265:17: sparse:     expected void const volatile [noderef] __user *
   drivers/tty/npreal2.c:2265:17: sparse:     got unsigned long *
>> drivers/tty/npreal2.c:2319:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user * @@     got int * @@
   drivers/tty/npreal2.c:2319:21: sparse:     expected void const volatile [noderef] __user *
>> drivers/tty/npreal2.c:2319:21: sparse:     got int *
   drivers/tty/npreal2.c:2319:62: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user * @@     got int * @@
   drivers/tty/npreal2.c:2319:62: sparse:     expected void const volatile [noderef] __user *
   drivers/tty/npreal2.c:2319:62: sparse:     got int *
   drivers/tty/npreal2.c:2320:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user * @@     got int * @@
   drivers/tty/npreal2.c:2320:25: sparse:     expected void const volatile [noderef] __user *
   drivers/tty/npreal2.c:2320:25: sparse:     got int *
   drivers/tty/npreal2.c:2321:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user * @@     got int * @@
   drivers/tty/npreal2.c:2321:25: sparse:     expected void const volatile [noderef] __user *
   drivers/tty/npreal2.c:2321:25: sparse:     got int *
   drivers/tty/npreal2.c:2322:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user * @@     got int * @@
   drivers/tty/npreal2.c:2322:25: sparse:     expected void const volatile [noderef] __user *
   drivers/tty/npreal2.c:2322:25: sparse:     got int *
   drivers/tty/npreal2.c:2323:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user * @@     got int * @@
   drivers/tty/npreal2.c:2323:25: sparse:     expected void const volatile [noderef] __user *
   drivers/tty/npreal2.c:2323:25: sparse:     got int *
   drivers/tty/npreal2.c:2324:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user * @@     got int * @@
   drivers/tty/npreal2.c:2324:25: sparse:     expected void const volatile [noderef] __user *
   drivers/tty/npreal2.c:2324:25: sparse:     got int *
   drivers/tty/npreal2.c:2329:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user * @@     got int * @@
   drivers/tty/npreal2.c:2329:17: sparse:     expected void const volatile [noderef] __user *
   drivers/tty/npreal2.c:2329:17: sparse:     got int *
   drivers/tty/npreal2.c:2330:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user * @@     got int * @@
   drivers/tty/npreal2.c:2330:17: sparse:     expected void const volatile [noderef] __user *
   drivers/tty/npreal2.c:2330:17: sparse:     got int *
   drivers/tty/npreal2.c:2331:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user * @@     got int * @@
   drivers/tty/npreal2.c:2331:17: sparse:     expected void const volatile [noderef] __user *
   drivers/tty/npreal2.c:2331:17: sparse:     got int *
   drivers/tty/npreal2.c:2332:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user * @@     got int * @@
   drivers/tty/npreal2.c:2332:17: sparse:     expected void const volatile [noderef] __user *
   drivers/tty/npreal2.c:2332:17: sparse:     got int *
>> drivers/tty/npreal2.c:2570:35: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void [noderef] __user *to @@     got void * @@
   drivers/tty/npreal2.c:2570:35: sparse:     expected void [noderef] __user *to
>> drivers/tty/npreal2.c:2570:35: sparse:     got void *
>> drivers/tty/npreal2.c:2591:57: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const [noderef] __user *from @@     got void * @@
   drivers/tty/npreal2.c:2591:57: sparse:     expected void const [noderef] __user *from
   drivers/tty/npreal2.c:2591:57: sparse:     got void *
   drivers/tty/npreal2.c:2720:35: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void [noderef] __user *to @@     got void * @@
   drivers/tty/npreal2.c:2720:35: sparse:     expected void [noderef] __user *to
   drivers/tty/npreal2.c:2720:35: sparse:     got void *
   drivers/tty/npreal2.c:2734:56: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const [noderef] __user *from @@     got void * @@
   drivers/tty/npreal2.c:2734:56: sparse:     expected void const [noderef] __user *from
   drivers/tty/npreal2.c:2734:56: sparse:     got void *
>> drivers/tty/npreal2.c:2803:34: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void [noderef] __user *to @@     got char *buf @@
   drivers/tty/npreal2.c:2803:34: sparse:     expected void [noderef] __user *to
>> drivers/tty/npreal2.c:2803:34: sparse:     got char *buf
>> drivers/tty/npreal2.c:2831:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void [noderef] __user *to @@     got char * @@
   drivers/tty/npreal2.c:2831:38: sparse:     expected void [noderef] __user *to
>> drivers/tty/npreal2.c:2831:38: sparse:     got char *
>> drivers/tty/npreal2.c:2899:38: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const [noderef] __user *from @@     got char const *buf @@
   drivers/tty/npreal2.c:2899:38: sparse:     expected void const [noderef] __user *from
>> drivers/tty/npreal2.c:2899:38: sparse:     got char const *buf
>> drivers/tty/npreal2.c:2950:22: sparse: sparse: incorrect type in initializer (incompatible argument 2 (different address spaces)) @@     expected long ( *proc_read )( ... ) @@     got long ( * )( ... ) @@
>> drivers/tty/npreal2.c:2950:22: sparse:     expected long ( *proc_read )( ... )
>> drivers/tty/npreal2.c:2950:22: sparse:     got long ( * )( ... )
>> drivers/tty/npreal2.c:2951:23: sparse: sparse: incorrect type in initializer (incompatible argument 2 (different address spaces)) @@     expected long ( *proc_write )( ... ) @@     got long ( * )( ... ) @@
>> drivers/tty/npreal2.c:2951:23: sparse:     expected long ( *proc_write )( ... )
   drivers/tty/npreal2.c:2951:23: sparse:     got long ( * )( ... )
>> drivers/tty/npreal2.c:2954:22: sparse: sparse: incorrect type in initializer (different base types) @@     expected restricted __poll_t ( *proc_poll )( ... ) @@     got unsigned int ( * )( ... ) @@
>> drivers/tty/npreal2.c:2954:22: sparse:     expected restricted __poll_t ( *proc_poll )( ... )
>> drivers/tty/npreal2.c:2954:22: sparse:     got unsigned int ( * )( ... )

vim +1107 drivers/tty/npreal2.c

  1089	
  1090	static int npreal_get_serial_info(struct npreal_struct *info, struct serial_struct *retinfo)
  1091	{
  1092		struct serial_struct tmp;
  1093	
  1094		if (!retinfo)
  1095			return -EFAULT;
  1096	
  1097		memset(&tmp, 0, sizeof(tmp));
  1098		tmp.type = info->type;
  1099		tmp.line = info->port;
  1100		tmp.flags = info->flags;
  1101		tmp.close_delay = info->close_delay;
  1102		tmp.closing_wait = info->closing_wait;
  1103		tmp.custom_divisor = info->custom_divisor;
  1104		tmp.baud_base = info->baud_base;
  1105		tmp.hub6 = 0;
  1106	
> 1107		if (copy_to_user(retinfo, &tmp, sizeof(*retinfo)))
  1108			return -EFAULT;
  1109		else
  1110			return 0;
  1111	}
  1112	
  1113	static int npreal_set_serial_info(struct npreal_struct *info, struct serial_struct *new_info)
  1114	{
  1115		struct serial_struct new_serial;
  1116		int rsp_length = RSP_BUFFER_SIZE;
  1117		int retval = 0;
  1118		unsigned int flags;
  1119		char rsp_buffer[RSP_BUFFER_SIZE];
  1120	
  1121	
> 1122		if ((!new_info) || copy_from_user(&new_serial, new_info, sizeof(new_serial)))
  1123			return -EFAULT;
  1124	
  1125		flags = info->flags & ASYNC_SPD_MASK;
  1126	
  1127		if (!capable(CAP_SYS_ADMIN)) {
  1128			if ((new_serial.close_delay != info->close_delay) ||
  1129				((new_serial.flags & ~ASYNC_USR_MASK) != (info->flags & ~ASYNC_USR_MASK)))
  1130				return -EPERM;
  1131	
  1132			info->flags = ((info->flags & ~ASYNC_USR_MASK) |
  1133					(new_serial.flags & ASYNC_USR_MASK));
  1134		} else {
  1135			info->flags = ((info->flags & ~ASYNC_FLAGS) | (new_serial.flags & ASYNC_FLAGS));
  1136			info->close_delay = new_serial.close_delay * HZ / 100;
  1137	
  1138			if (new_serial.closing_wait == ASYNC_CLOSING_WAIT_NONE)
  1139				info->closing_wait = ASYNC_CLOSING_WAIT_NONE;
  1140			else
  1141				info->closing_wait = new_serial.closing_wait * HZ / 100;
  1142		}
  1143	
  1144		info->type = new_serial.type;
  1145		set_common_xmit_fifo_size(info, info->net_node);
  1146	
  1147		if (info->flags & ASYNC_INITIALIZED) {
  1148			if (flags != (info->flags & ASYNC_SPD_MASK))
> 1149				retval = npreal_port_init(info, 0);
  1150	
  1151			if (info->net_node)
  1152				npreal_set_tx_fifo_command_done(info, info->net_node, rsp_buffer,
  1153								&rsp_length);
  1154	
  1155		}
  1156	
  1157		info->custom_divisor = new_serial.custom_divisor;
  1158	
  1159		if (info->custom_divisor == 0)
  1160			info->baud_base = 921600L;
  1161		else
  1162			info->baud_base = new_serial.baud_base;
  1163	
  1164		return retval;
  1165	}
  1166	
  1167	/**
  1168	 * npreal_get_lsr_info() - get line status register info
  1169	 *
  1170	 * Let user call ioctl() to get info when the UART physically is emptied.
  1171	 * On bus types like RS485, the transmitter must release the bus after
  1172	 * transmitting. This must be done when the transmit shift register is
  1173	 * empty, not be done when the transmit holding register is empty.
  1174	 * This functionality allows an RS485 driver to be written in user space.
  1175	 *
  1176	 * Always return 0 when function is ended.
  1177	 */
  1178	static int npreal_get_lsr_info(struct npreal_struct *info,
  1179					unsigned int *value)
  1180	{
  1181		unsigned int result = 0;
  1182	
  1183		if (npreal_wait_oqueue(info, 0) == 0)
  1184			result = TIOCSER_TEMT;
  1185	
> 1186		put_user(result, value);
  1187	
  1188		return 0;
  1189	}
  1190	

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 29498 bytes --]

  parent reply	other threads:[~2020-07-15  8:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <HK2PR01MB328134FB2EF5F9D1E381BDA3FA610@HK2PR01MB3281.apcprd01.prod.exchangelabs.com>
2020-07-14  7:11 ` [PATCH] tty: Add MOXA NPort Real TTY Driver Greg Kroah-Hartman
2020-07-23 10:54   ` Johnson CH Chen (陳昭勳)
2020-07-14  7:36 ` Greg Kroah-Hartman
2020-07-16  7:19   ` Johnson CH Chen (陳昭勳)
2020-07-16  7:23     ` Greg Kroah-Hartman
2020-07-22  7:04       ` Johnson CH Chen (陳昭勳)
2020-07-22  7:11         ` Greg Kroah-Hartman
2020-07-14  9:34 ` Jiri Slaby
2020-08-07  9:18   ` Johnson CH Chen (陳昭勳)
2020-08-07  9:48     ` Greg Kroah-Hartman
2020-07-15  8:27 ` kernel test robot [this message]
2020-07-24  5:32 ` kernel test robot
2020-07-28 20:40 ` Pavel Machek

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=202007151654.blCbcUU2%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=JohnsonCH.Chen@moxa.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@gmail.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).