Re: [PATCH] n_tty: fix redirected_tty_write checks after write_iter conversion

From: Linus Torvalds
Date: Tue Jan 26 2021 - 05:16:47 EST


On Mon, Jan 25, 2021 at 11:09 AM Sami Tolvanen <samitolvanen@xxxxxxxxxx> wrote:
>
> Commit 9bb48c82aced ("tty: implement write_iter") converted the tty
> layer to use write_iter. Fix the redirected_tty_write declaration
> also in n_tty and change the comparisons to use write_iter instead of
> write.

Duh.

Obvious ACK from me.

The only thing I'd ask is that the declaration for
redirected_tty_write() be moved to a proper header file
(<linux/tty.h>.

Because the reason I didn't notice this was literally that n_tty.c did
its own private 'extern' declaration of that function. Which is
horribly wrong, exactly because it doesn't then ever notice when the
declaration is changed.

So I'd suggest doing the patch as attached - but please keep Sami's
credit, this is purely a "declare the function in the proper place"
fix.

Linus

Attachment: patch
Description: Binary data