Commit 142e5460 authored by Jaeden Amero's avatar Jaeden Amero Committed by Greg Kroah-Hartman

compat_ioctl: Avoid using undefined RS-485 IOCTLs

Wrap the use of TIOCSRS485 and TIOCGRS485 in #ifdef so that we avoid
adding undefined IOCTLs to the ioctl pointer list as compatible
ioctls.

This change was motivated by a build error on a MIPS build.

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git
tty-next
head:   ac57e7f3
commit: 84c3b848 [10/16] compat_ioctl:
  Add RS-485 IOCTLs to the list
config: mips-fuloong2e_defconfig

All related error/warning messages:

fs/compat_ioctl.c:869:1: error: 'TIOCSRS485' undeclared here (not in a
  function)
fs/compat_ioctl.c:870:1: error: 'TIOCGRS485' undeclared here (not in a
  function)

vim +869 fs/compat_ioctl.c
863 COMPATIBLE_IOCTL(TIOCSPGRP)
864 COMPATIBLE_IOCTL(TIOCGPGRP)
865 COMPATIBLE_IOCTL(TIOCGPTN)
866 COMPATIBLE_IOCTL(TIOCSPTLCK)
867 COMPATIBLE_IOCTL(TIOCSERGETLSR)
868 COMPATIBLE_IOCTL(TIOCSIG)
> 869 COMPATIBLE_IOCTL(TIOCSRS485)
870 COMPATIBLE_IOCTL(TIOCGRS485)
871 #ifdef TCGETS2
872 COMPATIBLE_IOCTL(TCGETS2)
Reported-by: default avatarFengguang Wu <fengguang.wu@intel.com>
Reported-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: default avatarJaeden Amero <jaeden.amero@ni.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ac57e7f3
...@@ -866,8 +866,12 @@ COMPATIBLE_IOCTL(TIOCGPTN) ...@@ -866,8 +866,12 @@ COMPATIBLE_IOCTL(TIOCGPTN)
COMPATIBLE_IOCTL(TIOCSPTLCK) COMPATIBLE_IOCTL(TIOCSPTLCK)
COMPATIBLE_IOCTL(TIOCSERGETLSR) COMPATIBLE_IOCTL(TIOCSERGETLSR)
COMPATIBLE_IOCTL(TIOCSIG) COMPATIBLE_IOCTL(TIOCSIG)
#ifdef TIOCSRS485
COMPATIBLE_IOCTL(TIOCSRS485) COMPATIBLE_IOCTL(TIOCSRS485)
#endif
#ifdef TIOCGRS485
COMPATIBLE_IOCTL(TIOCGRS485) COMPATIBLE_IOCTL(TIOCGRS485)
#endif
#ifdef TCGETS2 #ifdef TCGETS2
COMPATIBLE_IOCTL(TCGETS2) COMPATIBLE_IOCTL(TCGETS2)
COMPATIBLE_IOCTL(TCSETS2) COMPATIBLE_IOCTL(TCSETS2)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment