tty: return tty->name directly from tty_name
[firefly-linux-kernel-4.4.55.git] / drivers / tty / tty_io.c
index 5a49a4a80ebdb3bb0d4763cbd1ff6bdd68cf7712..1eaf0fbd99e45e0e1df8a198284347ec818ce5df 100644 (file)
@@ -235,7 +235,7 @@ static void tty_del_file(struct file *file)
 /**
  *     tty_name        -       return tty naming
  *     @tty: tty structure
- *     @buf: buffer for output
+ *     @buf: unused
  *
  *     Convert a tty structure into a name. The name reflects the kernel
  *     naming policy and if udev is in use may not reflect user space
@@ -246,10 +246,8 @@ static void tty_del_file(struct file *file)
 const char *tty_name(const struct tty_struct *tty, char *buf)
 {
        if (!tty) /* Hmm.  NULL pointer.  That's fun. */
-               strcpy(buf, "NULL tty");
-       else
-               strcpy(buf, tty->name);
-       return buf;
+               return "NULL tty";
+       return tty->name;
 }
 
 EXPORT_SYMBOL(tty_name);