LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [jirislaby:devel 14/38] drivers/tty/tty_io.c:2814:32: warning: passing argument 2 of 'ld->ops->ioctl' makes integer from pointer without a cast
@ 2021-08-06 18:44 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-08-06 18:44 UTC (permalink / raw)
  To: Jiri Slaby; +Cc: kbuild-all, linux-kernel

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jirislaby/linux.git devel
head:   f7af18a9564a3d79c7ac5291734ef0b68c1f765d
commit: ea5d828388883933b32d38377907d9ea0533f692 [14/38] tty: remove file from tty_ldisc_ops::ioctl and compat_ioctl
config: openrisc-buildonly-randconfig-r006-20210805 (attached as .config)
compiler: or1k-linux-gcc (GCC) 10.3.0
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
        # https://git.kernel.org/pub/scm/linux/kernel/git/jirislaby/linux.git/commit/?id=ea5d828388883933b32d38377907d9ea0533f692
        git remote add jirislaby https://git.kernel.org/pub/scm/linux/kernel/git/jirislaby/linux.git
        git fetch --no-tags jirislaby devel
        git checkout ea5d828388883933b32d38377907d9ea0533f692
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross ARCH=openrisc 

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

All warnings (new ones prefixed by >>):

   drivers/tty/tty_io.c: In function 'tty_ioctl':
>> drivers/tty/tty_io.c:2814:32: warning: passing argument 2 of 'ld->ops->ioctl' makes integer from pointer without a cast [-Wint-conversion]
    2814 |   retval = ld->ops->ioctl(tty, file, cmd, arg);
         |                                ^~~~
         |                                |
         |                                struct file *
   drivers/tty/tty_io.c:2814:32: note: expected 'unsigned int' but argument is of type 'struct file *'
   drivers/tty/tty_io.c:2814:12: error: too many arguments to function 'ld->ops->ioctl'
    2814 |   retval = ld->ops->ioctl(tty, file, cmd, arg);
         |            ^~


vim +2814 drivers/tty/tty_io.c

e8b70e7d3e86319 drivers/char/tty_io.c Alan Cox          2009-06-11  2677  
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2678  /*
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2679   * Split this up, as gcc can choke on it otherwise..
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2680   */
04f378b198da233 drivers/char/tty_io.c Alan Cox          2008-04-30  2681  long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2682  {
d996b62a8df1d93 drivers/char/tty_io.c Nicholas Piggin   2010-08-18  2683  	struct tty_struct *tty = file_tty(file);
d996b62a8df1d93 drivers/char/tty_io.c Nicholas Piggin   2010-08-18  2684  	struct tty_struct *real_tty;
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2685  	void __user *p = (void __user *)arg;
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2686  	int retval;
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2687  	struct tty_ldisc *ld;
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2688  
6131ffaa1f09141 drivers/tty/tty_io.c  Al Viro           2013-02-27  2689  	if (tty_paranoia_check(tty, file_inode(file), "tty_ioctl"))
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2690  		return -EINVAL;
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2691  
e8b70e7d3e86319 drivers/char/tty_io.c Alan Cox          2009-06-11  2692  	real_tty = tty_pair_get_tty(tty);
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2693  
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2694  	/*
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2695  	 * Factor out some common prep work
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2696  	 */
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2697  	switch (cmd) {
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2698  	case TIOCSETD:
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2699  	case TIOCSBRK:
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2700  	case TIOCCBRK:
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2701  	case TCSBRK:
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2702  	case TCSBRKP:
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2703  		retval = tty_check_change(tty);
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2704  		if (retval)
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2705  			return retval;
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2706  		if (cmd != TIOCCBRK) {
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2707  			tty_wait_until_sent(tty, 0);
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2708  			if (signal_pending(current))
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2709  				return -EINTR;
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2710  		}
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2711  		break;
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2712  	}
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2713  
9e98966c7bb9435 drivers/char/tty_io.c Alan Cox          2008-07-22  2714  	/*
9e98966c7bb9435 drivers/char/tty_io.c Alan Cox          2008-07-22  2715  	 *	Now do the stuff.
9e98966c7bb9435 drivers/char/tty_io.c Alan Cox          2008-07-22  2716  	 */
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2717  	switch (cmd) {
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2718  	case TIOCSTI:
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2719  		return tiocsti(tty, p);
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2720  	case TIOCGWINSZ:
8f520021837d45c drivers/char/tty_io.c Alan Cox          2008-10-13  2721  		return tiocgwinsz(real_tty, p);
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2722  	case TIOCSWINSZ:
fc6f6238226e6d1 drivers/char/tty_io.c Alan Cox          2009-01-02  2723  		return tiocswinsz(real_tty, p);
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2724  	case TIOCCONS:
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2725  		return real_tty != tty ? -EINVAL : tioccons(file);
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2726  	case TIOCEXCL:
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2727  		set_bit(TTY_EXCLUSIVE, &tty->flags);
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2728  		return 0;
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2729  	case TIOCNXCL:
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2730  		clear_bit(TTY_EXCLUSIVE, &tty->flags);
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2731  		return 0;
84fd7bdf1266ee6 drivers/tty/tty_io.c  Cyrill Gorcunov   2012-10-24  2732  	case TIOCGEXCL:
84fd7bdf1266ee6 drivers/tty/tty_io.c  Cyrill Gorcunov   2012-10-24  2733  	{
84fd7bdf1266ee6 drivers/tty/tty_io.c  Cyrill Gorcunov   2012-10-24  2734  		int excl = test_bit(TTY_EXCLUSIVE, &tty->flags);
e73b240785f2845 drivers/tty/tty_io.c  Xiaofei Tan       2021-05-12  2735  
84fd7bdf1266ee6 drivers/tty/tty_io.c  Cyrill Gorcunov   2012-10-24  2736  		return put_user(excl, (int __user *)p);
84fd7bdf1266ee6 drivers/tty/tty_io.c  Cyrill Gorcunov   2012-10-24  2737  	}
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2738  	case TIOCGETD:
5c17c861a357e94 drivers/tty/tty_io.c  Peter Hurley      2016-01-10  2739  		return tiocgetd(tty, p);
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2740  	case TIOCSETD:
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2741  		return tiocsetd(tty, p);
3c95c985fa91ecf drivers/tty/tty_io.c  Kay Sievers       2011-02-17  2742  	case TIOCVHANGUP:
3c95c985fa91ecf drivers/tty/tty_io.c  Kay Sievers       2011-02-17  2743  		if (!capable(CAP_SYS_ADMIN))
3c95c985fa91ecf drivers/tty/tty_io.c  Kay Sievers       2011-02-17  2744  			return -EPERM;
3c95c985fa91ecf drivers/tty/tty_io.c  Kay Sievers       2011-02-17  2745  		tty_vhangup(tty);
3c95c985fa91ecf drivers/tty/tty_io.c  Kay Sievers       2011-02-17  2746  		return 0;
b7b8de087384cc1 drivers/tty/tty_io.c  Werner Fink       2010-12-03  2747  	case TIOCGDEV:
b7b8de087384cc1 drivers/tty/tty_io.c  Werner Fink       2010-12-03  2748  	{
b7b8de087384cc1 drivers/tty/tty_io.c  Werner Fink       2010-12-03  2749  		unsigned int ret = new_encode_dev(tty_devnum(real_tty));
e73b240785f2845 drivers/tty/tty_io.c  Xiaofei Tan       2021-05-12  2750  
b7b8de087384cc1 drivers/tty/tty_io.c  Werner Fink       2010-12-03  2751  		return put_user(ret, (unsigned int __user *)p);
b7b8de087384cc1 drivers/tty/tty_io.c  Werner Fink       2010-12-03  2752  	}
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2753  	/*
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2754  	 * Break handling
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2755  	 */
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2756  	case TIOCSBRK:	/* Turn break on, unconditionally */
f34d7a5b7010b82 drivers/char/tty_io.c Alan Cox          2008-04-30  2757  		if (tty->ops->break_ctl)
9e98966c7bb9435 drivers/char/tty_io.c Alan Cox          2008-07-22  2758  			return tty->ops->break_ctl(tty, -1);
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2759  		return 0;
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2760  	case TIOCCBRK:	/* Turn break off, unconditionally */
f34d7a5b7010b82 drivers/char/tty_io.c Alan Cox          2008-04-30  2761  		if (tty->ops->break_ctl)
9e98966c7bb9435 drivers/char/tty_io.c Alan Cox          2008-07-22  2762  			return tty->ops->break_ctl(tty, 0);
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2763  		return 0;
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2764  	case TCSBRK:   /* SVID version: non-zero arg --> no break */
283fef59d6e934e drivers/char/tty_io.c Paul Fulghum      2006-06-27  2765  		/* non-zero arg means wait for all output data
283fef59d6e934e drivers/char/tty_io.c Paul Fulghum      2006-06-27  2766  		 * to be sent (performed above) but don't send break.
283fef59d6e934e drivers/char/tty_io.c Paul Fulghum      2006-06-27  2767  		 * This is used by the tcdrain() termios function.
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2768  		 */
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2769  		if (!arg)
b20f3ae5f0efe18 drivers/char/tty_io.c Domen Puncer      2005-06-25  2770  			return send_break(tty, 250);
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2771  		return 0;
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2772  	case TCSBRKP:	/* support for POSIX tcsendbreak() */
b20f3ae5f0efe18 drivers/char/tty_io.c Domen Puncer      2005-06-25  2773  		return send_break(tty, arg ? arg*100 : 250);
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2774  
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2775  	case TIOCMGET:
60b33c133ca0b7c drivers/tty/tty_io.c  Alan Cox          2011-02-14  2776  		return tty_tiocmget(tty, p);
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2777  	case TIOCMSET:
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2778  	case TIOCMBIC:
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2779  	case TIOCMBIS:
20b9d17715017ae drivers/tty/tty_io.c  Alan Cox          2011-02-14  2780  		return tty_tiocmset(tty, cmd, p);
d281da7ff6f70ef drivers/char/tty_io.c Alan Cox          2010-09-16  2781  	case TIOCGICOUNT:
a3096199226c2e4 drivers/tty/tty_io.c  Al Viro           2018-09-12  2782  		return tty_tiocgicount(tty, p);
c5c34d4862e18ef drivers/char/tty_io.c Paul Fulghum      2007-05-12  2783  	case TCFLSH:
c5c34d4862e18ef drivers/char/tty_io.c Paul Fulghum      2007-05-12  2784  		switch (arg) {
c5c34d4862e18ef drivers/char/tty_io.c Paul Fulghum      2007-05-12  2785  		case TCIFLUSH:
c5c34d4862e18ef drivers/char/tty_io.c Paul Fulghum      2007-05-12  2786  		case TCIOFLUSH:
c5c34d4862e18ef drivers/char/tty_io.c Paul Fulghum      2007-05-12  2787  		/* flush tty buffer and allow ldisc to process ioctl */
86c80a8e2ab443e drivers/tty/tty_io.c  Peter Hurley      2014-11-05  2788  			tty_buffer_flush(tty, NULL);
c5c34d4862e18ef drivers/char/tty_io.c Paul Fulghum      2007-05-12  2789  			break;
c5c34d4862e18ef drivers/char/tty_io.c Paul Fulghum      2007-05-12  2790  		}
c5c34d4862e18ef drivers/char/tty_io.c Paul Fulghum      2007-05-12  2791  		break;
8a8ae62f8296760 drivers/tty/tty_io.c  Jiri Slaby        2014-11-06  2792  	case TIOCSSERIAL:
930236a30897532 drivers/tty/tty_io.c  Al Viro           2018-09-12  2793  		return tty_tiocsserial(tty, p);
2f46a2c1d4eb982 drivers/tty/tty_io.c  Al Viro           2018-09-11  2794  	case TIOCGSERIAL:
930236a30897532 drivers/tty/tty_io.c  Al Viro           2018-09-12  2795  		return tty_tiocgserial(tty, p);
311fc65c9fb9c96 drivers/tty/tty_io.c  Eric W. Biederman 2017-08-24  2796  	case TIOCGPTPEER:
311fc65c9fb9c96 drivers/tty/tty_io.c  Eric W. Biederman 2017-08-24  2797  		/* Special because the struct file is needed */
311fc65c9fb9c96 drivers/tty/tty_io.c  Eric W. Biederman 2017-08-24  2798  		return ptm_open_peer(file, tty, (int)arg);
a1235b3eb10086b drivers/tty/tty_io.c  Nicolas Pitre     2017-04-12  2799  	default:
a1235b3eb10086b drivers/tty/tty_io.c  Nicolas Pitre     2017-04-12  2800  		retval = tty_jobctrl_ioctl(tty, real_tty, file, cmd, arg);
a1235b3eb10086b drivers/tty/tty_io.c  Nicolas Pitre     2017-04-12  2801  		if (retval != -ENOIOCTLCMD)
a1235b3eb10086b drivers/tty/tty_io.c  Nicolas Pitre     2017-04-12  2802  			return retval;
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2803  	}
f34d7a5b7010b82 drivers/char/tty_io.c Alan Cox          2008-04-30  2804  	if (tty->ops->ioctl) {
c961bfb17406c9f drivers/tty/tty_io.c  Peter Hurley      2014-11-05  2805  		retval = tty->ops->ioctl(tty, cmd, arg);
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2806  		if (retval != -ENOIOCTLCMD)
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2807  			return retval;
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2808  	}
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2809  	ld = tty_ldisc_ref_wait(tty);
e55afd11a48354c drivers/tty/tty_io.c  Peter Hurley      2016-01-10  2810  	if (!ld)
e55afd11a48354c drivers/tty/tty_io.c  Peter Hurley      2016-01-10  2811  		return hung_up_tty_ioctl(file, cmd, arg);
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2812  	retval = -EINVAL;
a352def21a64213 drivers/char/tty_io.c Alan Cox          2008-07-16  2813  	if (ld->ops->ioctl) {
a352def21a64213 drivers/char/tty_io.c Alan Cox          2008-07-16 @2814  		retval = ld->ops->ioctl(tty, file, cmd, arg);
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2815  		if (retval == -ENOIOCTLCMD)
bbb63c514a34643 drivers/tty/tty_io.c  Wanlong Gao       2012-08-27  2816  			retval = -ENOTTY;
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2817  	}
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2818  	tty_ldisc_deref(ld);
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2819  	return retval;
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2820  }
^1da177e4c3f415 drivers/char/tty_io.c Linus Torvalds    2005-04-16  2821  

:::::: The code at line 2814 was first introduced by commit
:::::: a352def21a642133758b868c71bee12ab34ad5c5 tty: Ldisc revamp

:::::: TO: Alan Cox <alan@redhat.com>
:::::: CC: Linus Torvalds <torvalds@linux-foundation.org>

---
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: 42370 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-06 18:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-06 18:44 [jirislaby:devel 14/38] drivers/tty/tty_io.c:2814:32: warning: passing argument 2 of 'ld->ops->ioctl' makes integer from pointer without a cast kernel test robot

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).