Re: [PATCH 26/76] tty: Add a kref count

From: Alan Cox
Date: Mon Oct 06 2008 - 06:52:50 EST


On Mon, Oct 06, 2008 at 12:20:37PM +0200, Louis Rilling wrote:
>
> I'm a bit puzzled by this 'tty_kref_put(p->signal->tty)'. AFAICS, this is a noop
> since we are not in the CLONE_THREAD case and hence p->signal->tty == NULL.

When I first did it I was seeing non NULL values, but since then I've added
the initialisation

> So, is it to make the code look more consistent? If so, is it worth adding extra
> code and cycles for this (I doubt that gcc is able to optimize this away)? What
> kind of future changes should this code protect against?

I'll take a look, you may well be right, and if so it can become a WARN_ON()
instead.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/