Messages in this thread | | | Date | Fri, 6 Aug 2021 21:29:53 +0800 | From | kernel test robot <> | Subject | [jirislaby:devel 14/38] drivers/tty/tty_io.c:2993:39: warning: passing argument 2 of 'ld->ops->compat_ioctl' makes integer from pointer without a cast |
| |
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: arm64-randconfig-s032-20210806 (attached as .config) compiler: aarch64-linux-gcc (GCC) 10.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.3-348-gf0e6938b-dirty # 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 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=arm64
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); | ^~ drivers/tty/tty_io.c: In function 'tty_compat_ioctl': >> drivers/tty/tty_io.c:2993:39: warning: passing argument 2 of 'ld->ops->compat_ioctl' makes integer from pointer without a cast [-Wint-conversion] 2993 | retval = ld->ops->compat_ioctl(tty, file, cmd, arg); | ^~~~ | | | struct file * drivers/tty/tty_io.c:2993:39: note: expected 'unsigned int' but argument is of type 'struct file *' drivers/tty/tty_io.c:2993:12: error: too many arguments to function 'ld->ops->compat_ioctl' 2993 | retval = ld->ops->compat_ioctl(tty, file, cmd, arg); | ^~ drivers/tty/tty_io.c:2995:32: warning: passing argument 2 of 'ld->ops->ioctl' makes integer from pointer without a cast [-Wint-conversion] 2995 | retval = ld->ops->ioctl(tty, file, | ^~~~ | | | struct file * drivers/tty/tty_io.c:2995:32: note: expected 'unsigned int' but argument is of type 'struct file *' drivers/tty/tty_io.c:2995:12: error: too many arguments to function 'ld->ops->ioctl' 2995 | retval = ld->ops->ioctl(tty, file, | ^~
vim +2993 drivers/tty/tty_io.c
77654350306acc drivers/tty/tty_io.c Al Viro 2018-09-12 2863 77654350306acc drivers/tty/tty_io.c Al Viro 2018-09-12 2864 static int compat_tty_tiocgserial(struct tty_struct *tty, 77654350306acc drivers/tty/tty_io.c Al Viro 2018-09-12 2865 struct serial_struct32 __user *ss) 77654350306acc drivers/tty/tty_io.c Al Viro 2018-09-12 2866 { 77654350306acc drivers/tty/tty_io.c Al Viro 2018-09-12 2867 struct serial_struct32 v32; 77654350306acc drivers/tty/tty_io.c Al Viro 2018-09-12 2868 struct serial_struct v; 77654350306acc drivers/tty/tty_io.c Al Viro 2018-09-12 2869 int err; 17329563a97df3 drivers/tty/tty_io.c Eric Biggers 2020-02-24 2870 17329563a97df3 drivers/tty/tty_io.c Eric Biggers 2020-02-24 2871 memset(&v, 0, sizeof(v)); 17329563a97df3 drivers/tty/tty_io.c Eric Biggers 2020-02-24 2872 memset(&v32, 0, sizeof(v32)); 77654350306acc drivers/tty/tty_io.c Al Viro 2018-09-12 2873 6e622cd8bd888c drivers/tty/tty_io.c Eric Biggers 2020-02-24 2874 if (!tty->ops->get_serial) 77654350306acc drivers/tty/tty_io.c Al Viro 2018-09-12 2875 return -ENOTTY; 77654350306acc drivers/tty/tty_io.c Al Viro 2018-09-12 2876 err = tty->ops->get_serial(tty, &v); 77654350306acc drivers/tty/tty_io.c Al Viro 2018-09-12 2877 if (!err) { 77654350306acc drivers/tty/tty_io.c Al Viro 2018-09-12 2878 memcpy(&v32, &v, offsetof(struct serial_struct32, iomem_base)); 77654350306acc drivers/tty/tty_io.c Al Viro 2018-09-12 2879 v32.iomem_base = (unsigned long)v.iomem_base >> 32 ? 77654350306acc drivers/tty/tty_io.c Al Viro 2018-09-12 2880 0xfffffff : ptr_to_compat(v.iomem_base); 77654350306acc drivers/tty/tty_io.c Al Viro 2018-09-12 2881 v32.iomem_reg_shift = v.iomem_reg_shift; 77654350306acc drivers/tty/tty_io.c Al Viro 2018-09-12 2882 v32.port_high = v.port_high; a32418919dd5e8 drivers/tty/tty_io.c Gustavo A. R. Silva 2020-07-23 2883 if (copy_to_user(ss, &v32, sizeof(v32))) 77654350306acc drivers/tty/tty_io.c Al Viro 2018-09-12 2884 err = -EFAULT; 77654350306acc drivers/tty/tty_io.c Al Viro 2018-09-12 2885 } 77654350306acc drivers/tty/tty_io.c Al Viro 2018-09-12 2886 return err; 77654350306acc drivers/tty/tty_io.c Al Viro 2018-09-12 2887 } e10cc1df1d2014 drivers/char/tty_io.c Paul Fulghum 2007-05-10 2888 static long tty_compat_ioctl(struct file *file, unsigned int cmd, e10cc1df1d2014 drivers/char/tty_io.c Paul Fulghum 2007-05-10 2889 unsigned long arg) e10cc1df1d2014 drivers/char/tty_io.c Paul Fulghum 2007-05-10 2890 { d996b62a8df1d9 drivers/char/tty_io.c Nicholas Piggin 2010-08-18 2891 struct tty_struct *tty = file_tty(file); e10cc1df1d2014 drivers/char/tty_io.c Paul Fulghum 2007-05-10 2892 struct tty_ldisc *ld; e10cc1df1d2014 drivers/char/tty_io.c Paul Fulghum 2007-05-10 2893 int retval = -ENOIOCTLCMD; e10cc1df1d2014 drivers/char/tty_io.c Paul Fulghum 2007-05-10 2894 e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2895 switch (cmd) { c7dc504e2ff78a drivers/tty/tty_io.c Arnd Bergmann 2019-06-03 2896 case TIOCOUTQ: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2897 case TIOCSTI: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2898 case TIOCGWINSZ: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2899 case TIOCSWINSZ: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2900 case TIOCGEXCL: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2901 case TIOCGETD: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2902 case TIOCSETD: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2903 case TIOCGDEV: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2904 case TIOCMGET: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2905 case TIOCMSET: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2906 case TIOCMBIC: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2907 case TIOCMBIS: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2908 case TIOCGICOUNT: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2909 case TIOCGPGRP: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2910 case TIOCSPGRP: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2911 case TIOCGSID: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2912 case TIOCSERGETLSR: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2913 case TIOCGRS485: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2914 case TIOCSRS485: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2915 #ifdef TIOCGETP e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2916 case TIOCGETP: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2917 case TIOCSETP: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2918 case TIOCSETN: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2919 #endif e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2920 #ifdef TIOCGETC e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2921 case TIOCGETC: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2922 case TIOCSETC: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2923 #endif e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2924 #ifdef TIOCGLTC e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2925 case TIOCGLTC: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2926 case TIOCSLTC: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2927 #endif e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2928 case TCSETSF: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2929 case TCSETSW: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2930 case TCSETS: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2931 case TCGETS: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2932 #ifdef TCGETS2 e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2933 case TCGETS2: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2934 case TCSETSF2: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2935 case TCSETSW2: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2936 case TCSETS2: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2937 #endif e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2938 case TCGETA: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2939 case TCSETAF: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2940 case TCSETAW: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2941 case TCSETA: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2942 case TIOCGLCKTRMIOS: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2943 case TIOCSLCKTRMIOS: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2944 #ifdef TCGETX e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2945 case TCGETX: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2946 case TCSETX: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2947 case TCSETXW: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2948 case TCSETXF: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2949 #endif e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2950 case TIOCGSOFTCAR: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2951 case TIOCSSOFTCAR: b7aff093e94daf drivers/tty/tty_io.c Arnd Bergmann 2019-06-06 2952 b7aff093e94daf drivers/tty/tty_io.c Arnd Bergmann 2019-06-06 2953 case PPPIOCGCHAN: b7aff093e94daf drivers/tty/tty_io.c Arnd Bergmann 2019-06-06 2954 case PPPIOCGUNIT: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2955 return tty_ioctl(file, cmd, (unsigned long)compat_ptr(arg)); e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2956 case TIOCCONS: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2957 case TIOCEXCL: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2958 case TIOCNXCL: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2959 case TIOCVHANGUP: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2960 case TIOCSBRK: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2961 case TIOCCBRK: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2962 case TCSBRK: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2963 case TCSBRKP: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2964 case TCFLSH: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2965 case TIOCGPTPEER: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2966 case TIOCNOTTY: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2967 case TIOCSCTTY: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2968 case TCXONC: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2969 case TIOCMIWAIT: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2970 case TIOCSERCONFIG: e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2971 return tty_ioctl(file, cmd, arg); e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2972 } e21120383f2dce drivers/tty/tty_io.c Al Viro 2018-09-11 2973 6131ffaa1f0914 drivers/tty/tty_io.c Al Viro 2013-02-27 2974 if (tty_paranoia_check(tty, file_inode(file), "tty_ioctl")) e10cc1df1d2014 drivers/char/tty_io.c Paul Fulghum 2007-05-10 2975 return -EINVAL; e10cc1df1d2014 drivers/char/tty_io.c Paul Fulghum 2007-05-10 2976 77654350306acc drivers/tty/tty_io.c Al Viro 2018-09-12 2977 switch (cmd) { 77654350306acc drivers/tty/tty_io.c Al Viro 2018-09-12 2978 case TIOCSSERIAL: 77654350306acc drivers/tty/tty_io.c Al Viro 2018-09-12 2979 return compat_tty_tiocsserial(tty, compat_ptr(arg)); 77654350306acc drivers/tty/tty_io.c Al Viro 2018-09-12 2980 case TIOCGSERIAL: 77654350306acc drivers/tty/tty_io.c Al Viro 2018-09-12 2981 return compat_tty_tiocgserial(tty, compat_ptr(arg)); 77654350306acc drivers/tty/tty_io.c Al Viro 2018-09-12 2982 } f34d7a5b7010b8 drivers/char/tty_io.c Alan Cox 2008-04-30 2983 if (tty->ops->compat_ioctl) { c961bfb17406c9 drivers/tty/tty_io.c Peter Hurley 2014-11-05 2984 retval = tty->ops->compat_ioctl(tty, cmd, arg); e10cc1df1d2014 drivers/char/tty_io.c Paul Fulghum 2007-05-10 2985 if (retval != -ENOIOCTLCMD) e10cc1df1d2014 drivers/char/tty_io.c Paul Fulghum 2007-05-10 2986 return retval; e10cc1df1d2014 drivers/char/tty_io.c Paul Fulghum 2007-05-10 2987 } e10cc1df1d2014 drivers/char/tty_io.c Paul Fulghum 2007-05-10 2988 e10cc1df1d2014 drivers/char/tty_io.c Paul Fulghum 2007-05-10 2989 ld = tty_ldisc_ref_wait(tty); e55afd11a48354 drivers/tty/tty_io.c Peter Hurley 2016-01-10 2990 if (!ld) e55afd11a48354 drivers/tty/tty_io.c Peter Hurley 2016-01-10 2991 return hung_up_tty_compat_ioctl(file, cmd, arg); a352def21a6421 drivers/char/tty_io.c Alan Cox 2008-07-16 2992 if (ld->ops->compat_ioctl) a352def21a6421 drivers/char/tty_io.c Alan Cox 2008-07-16 @2993 retval = ld->ops->compat_ioctl(tty, file, cmd, arg); f0193d3ea73b96 drivers/tty/tty_io.c Al Viro 2018-09-13 2994 if (retval == -ENOIOCTLCMD && ld->ops->ioctl) f0193d3ea73b96 drivers/tty/tty_io.c Al Viro 2018-09-13 2995 retval = ld->ops->ioctl(tty, file, f0193d3ea73b96 drivers/tty/tty_io.c Al Viro 2018-09-13 2996 (unsigned long)compat_ptr(cmd), arg); e10cc1df1d2014 drivers/char/tty_io.c Paul Fulghum 2007-05-10 2997 tty_ldisc_deref(ld); e10cc1df1d2014 drivers/char/tty_io.c Paul Fulghum 2007-05-10 2998 e10cc1df1d2014 drivers/char/tty_io.c Paul Fulghum 2007-05-10 2999 return retval; e10cc1df1d2014 drivers/char/tty_io.c Paul Fulghum 2007-05-10 3000 } e10cc1df1d2014 drivers/char/tty_io.c Paul Fulghum 2007-05-10 3001 #endif ^1da177e4c3f41 drivers/char/tty_io.c Linus Torvalds 2005-04-16 3002
:::::: The code at line 2993 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 [unhandled content-type:application/gzip] | |