lkml.org 
[lkml]   [2008]   [Oct]   [6]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateMon, 6 Oct 2008 10:58:06 +0200 (CEST)
FromGeert Uytterhoeven <>
SubjectRe: [PATCH 67/76] tty: Remove lots of NULL checks
On Sun, 5 Oct 2008, Alan Cox wrote:
> Many tty drivers contain 'can't happen' checks against NULL pointers passed
> in by the tty layer. These have never been possible to occur. Even more
> importantly if they ever do occur we want to know as it would be a serious
> bug.

> diff --git a/drivers/char/n_r3964.c b/drivers/char/n_r3964.c
> index ae377aa..c0a1df9 100644
> --- a/drivers/char/n_r3964.c
> +++ b/drivers/char/n_r3964.c
> @@ -372,15 +372,8 @@ static void remove_from_rx_queue(struct r3964_info *pInfo,
>  static void put_char(struct r3964_info *pInfo, unsigned char ch)
>  {
>  	struct tty_struct *tty = pInfo->tty;
> -
> -	if (tty == NULL)
> -		return;
> -
>  	/* FIXME: put_char should not be called from an IRQ */
> -	if (tty->ops->put_char) {
> -		tty->ops->put_char(tty, ch);
> -	}
> -	pInfo->bcc ^= ch;
        ^^^^^^^^^^^^^^^^
> +	tty_put_char(tty, ch);
>  }

I have no idea what this `bcc' thingy does, but its removal just struck
my eye...

Gr{oetje,eeting}s,
						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds


\
 
 \ /
  Last update: 2008-10-06 11:01    [from the cache]
©2003-2008