diff mbox series

[v3] tty: Partially revert the removal of the Cyclades public API

Message ID alpine.DEB.2.20.2201260733430.11348@tpp.orcam.me.uk
State New
Headers show
Series [v3] tty: Partially revert the removal of the Cyclades public API | expand

Commit Message

Maciej W. Rozycki Jan. 26, 2022, 9:22 a.m. UTC
Fix a user API regression introduced with commit f76edd8f7ce0 ("tty: 
cyclades, remove this orphan"), which removed a part of the API and 
caused compilation errors for user programs using said part, such as 
GCC 9 in its libsanitizer component[1]:

.../libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc:160:10: fatal error: linux/cyclades.h: No such file or directory
  160 | #include <linux/cyclades.h>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
make[4]: *** [Makefile:664: sanitizer_platform_limits_posix.lo] Error 1

As the absolute minimum required bring `struct cyclades_monitor' and 
ioctl numbers back then so as to make the library build again.  Add a 
preprocessor warning as to the obsolescence of the features provided.

References:

[1] GCC PR sanitizer/100379, "cyclades.h is removed from linux kernel 
    header files", <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100379>

Signed-off-by: Maciej W. Rozycki <macro@embecosm.com>
Fixes: f76edd8f7ce0 ("tty: cyclades, remove this orphan")
Cc: stable@vger.kernel.org # v5.13+
---
Changes from v2:

- Add #warning directives.

Changes from v1:

- Adjust heading from "tty: Revert the removal of the Cyclades public API".

- Only revert `struct cyclades_monitor' and ioctl numbers.

- Properly format the change given that it's not a plain revert anymore.
---
 include/uapi/linux/cyclades.h |   35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

linux-uapi-cyclades.diff

Comments

Christoph Hellwig Jan. 26, 2022, 1:43 p.m. UTC | #1
Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>
Greg Kroah-Hartman Jan. 26, 2022, 1:50 p.m. UTC | #2
On Wed, Jan 26, 2022 at 09:22:54AM +0000, Maciej W. Rozycki wrote:
> Fix a user API regression introduced with commit f76edd8f7ce0 ("tty: 
> cyclades, remove this orphan"), which removed a part of the API and 
> caused compilation errors for user programs using said part, such as 
> GCC 9 in its libsanitizer component[1]:
> 
> .../libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc:160:10: fatal error: linux/cyclades.h: No such file or directory
>   160 | #include <linux/cyclades.h>
>       |          ^~~~~~~~~~~~~~~~~~
> compilation terminated.
> make[4]: *** [Makefile:664: sanitizer_platform_limits_posix.lo] Error 1
> 
> As the absolute minimum required bring `struct cyclades_monitor' and 
> ioctl numbers back then so as to make the library build again.  Add a 
> preprocessor warning as to the obsolescence of the features provided.
> 
> References:
> 
> [1] GCC PR sanitizer/100379, "cyclades.h is removed from linux kernel 
>     header files", <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100379>
> 
> Signed-off-by: Maciej W. Rozycki <macro@embecosm.com>
> Fixes: f76edd8f7ce0 ("tty: cyclades, remove this orphan")
> Cc: stable@vger.kernel.org # v5.13+
> ---
> Changes from v2:
> 
> - Add #warning directives.

Thanks, that looks good, now queued up.

greg k-h
kernel test robot Jan. 26, 2022, 2:07 p.m. UTC | #3
Hi "Maciej,

I love your patch! Perhaps something to improve:

[auto build test WARNING on tty/tty-testing]
[also build test WARNING on linus/master hch-configfs/for-next v5.17-rc1 next-20220125]
[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/Maciej-W-Rozycki/tty-Partially-revert-the-removal-of-the-Cyclades-public-API/20220126-172520
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tty-testing
config: i386-buildonly-randconfig-r002-20220124 (https://download.01.org/0day-ci/archive/20220126/202201262147.FNYhDmDi-lkp@intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/0day-ci/linux/commit/c9e707e313f471adbe057300f4fb163113cf062c
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Maciej-W-Rozycki/tty-Partially-revert-the-removal-of-the-Cyclades-public-API/20220126-172520
        git checkout c9e707e313f471adbe057300f4fb163113cf062c
        # save the config file to linux build tree
        mkdir build_dir
        make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash

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

   In file included from <command-line>:32:
>> ./usr/include/linux/cyclades.h:6:2: warning: #warning "Support for features provided by this header has been removed" [-Wcpp]
       6 | #warning "Support for features provided by this header has been removed"
         |  ^~~~~~~
>> ./usr/include/linux/cyclades.h:7:2: warning: #warning "Please consider updating your code" [-Wcpp]
       7 | #warning "Please consider updating your code"
         |  ^~~~~~~

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

Patch

Index: linux/include/uapi/linux/cyclades.h
===================================================================
--- /dev/null
+++ linux/include/uapi/linux/cyclades.h
@@ -0,0 +1,35 @@ 
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
+
+#ifndef _UAPI_LINUX_CYCLADES_H
+#define _UAPI_LINUX_CYCLADES_H
+
+#warning "Support for features provided by this header has been removed"
+#warning "Please consider updating your code"
+
+struct cyclades_monitor {
+	unsigned long int_count;
+	unsigned long char_count;
+	unsigned long char_max;
+	unsigned long char_last;
+};
+
+#define CYGETMON		0x435901
+#define CYGETTHRESH		0x435902
+#define CYSETTHRESH		0x435903
+#define CYGETDEFTHRESH		0x435904
+#define CYSETDEFTHRESH		0x435905
+#define CYGETTIMEOUT		0x435906
+#define CYSETTIMEOUT		0x435907
+#define CYGETDEFTIMEOUT		0x435908
+#define CYSETDEFTIMEOUT		0x435909
+#define CYSETRFLOW		0x43590a
+#define CYGETRFLOW		0x43590b
+#define CYSETRTSDTR_INV		0x43590c
+#define CYGETRTSDTR_INV		0x43590d
+#define CYZSETPOLLCYCLE		0x43590e
+#define CYZGETPOLLCYCLE		0x43590f
+#define CYGETCD1400VER		0x435910
+#define CYSETWAIT		0x435912
+#define CYGETWAIT		0x435913
+
+#endif /* _UAPI_LINUX_CYCLADES_H */