[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20110603230836.061d5a78@lxorguk.ukuu.org.uk>
Date: Fri, 3 Jun 2011 23:08:36 +0100
From: Alan Cox <alan@...rguk.ukuu.org.uk>
To: Russ Gorby <russ.gorby@...el.com>
Cc: Greg Kroah-Hartman <gregkh@...e.de>, linux-kernel@...r.kernel.org,
suhail.ahmed@...el.com
Subject: Re: [PATCH 3/5] tty: n_gsm: Added refcount usage to gsm_mux and
gsm_dlci structs
> To avoid this, gsm_mux and dlcis now have a reference counter
> ldisc open takes a reference on the mux and all the dlcis
> gsmtty_open takes a reference on the mux, dlci0 and its specific
> dlci. Dropping the last reference initiates the actual free.
Definitely the right direction. Only comment really is style related
We usualyl define
struct foo *foo_get(struct foo *)
void foo_put(struct foo *)
helpers/inlines just make it clearer and keep the knowledge of the
function pointer etc in one place
Also when you take a reference this lets you write the more natural
reading
bar->foo = foo_get(foo);
Alan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists