LCOV - code coverage report
Current view: top level - tty - n_null.c (source / functions) Coverage Total Hit
Test: TTY Combined Coverage Lines: 0.0 % 10 0
Test Date: 2025-08-26 15:45:50 Functions: 0.0 % 4 0

            Line data    Source code
       1              : // SPDX-License-Identifier: GPL-2.0
       2              : #include <linux/types.h>
       3              : #include <linux/errno.h>
       4              : #include <linux/tty.h>
       5              : #include <linux/module.h>
       6              : 
       7              : /*
       8              :  *  n_null.c - Null line discipline used in the failure path
       9              :  *
      10              :  *  Copyright (C) Intel 2017
      11              :  */
      12              : 
      13            0 : static ssize_t n_null_read(struct tty_struct *tty, struct file *file, u8 *buf,
      14              :                            size_t nr, void **cookie, unsigned long offset)
      15              : {
      16            0 :         return -EOPNOTSUPP;
      17              : }
      18              : 
      19            0 : static ssize_t n_null_write(struct tty_struct *tty, struct file *file,
      20              :                             const u8 *buf, size_t nr)
      21              : {
      22            0 :         return -EOPNOTSUPP;
      23              : }
      24              : 
      25              : static struct tty_ldisc_ops null_ldisc = {
      26              :         .owner          =       THIS_MODULE,
      27              :         .num            =       N_NULL,
      28              :         .name           =       "n_null",
      29              :         .read           =       n_null_read,
      30              :         .write          =       n_null_write,
      31              : };
      32              : 
      33            0 : static int __init n_null_init(void)
      34              : {
      35            0 :         BUG_ON(tty_register_ldisc(&null_ldisc));
      36            0 :         return 0;
      37              : }
      38              : 
      39            0 : static void __exit n_null_exit(void)
      40              : {
      41            0 :         tty_unregister_ldisc(&null_ldisc);
      42            0 : }
      43              : 
      44              : module_init(n_null_init);
      45              : module_exit(n_null_exit);
      46              : 
      47              : MODULE_LICENSE("GPL");
      48              : MODULE_AUTHOR("Alan Cox");
      49              : MODULE_ALIAS_LDISC(N_NULL);
      50              : MODULE_DESCRIPTION("Null ldisc driver");
        

Generated by: LCOV version 2.0-1