Re: [PATCH 11/14] mac802154: slaves manipulation routine

2 messages, 2 authors, 2011-12-20 · open the first message on its own page

Re: [PATCH 11/14] mac802154: slaves manipulation routine

From: David Miller <hidden>
Date: 2011-12-19 19:43:53

From: Alexander Smirnov <redacted>
Date: Mon, 19 Dec 2011 19:33:51 +0300
+struct ieee802154_dev *ieee802154_alloc_device(size_t priv_size,
+					struct ieee802154_ops *ops);
Line up the arguments properly.
+	if (priv->hw->open_count++ == 0) {
+	res = priv->hw->ops->start(&priv->hw->hw);
That's terrible, fix up the indentation.
+	if ((--priv->hw->open_count) == 0)
This is more canonical as "if (!--priv->hw->open_count)".

------------------------------------------------------------------------------
Learn Windows Azure Live!  Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for 
developers. It will provide a great way to learn Windows Azure and what it 
provides. You can attend the event by watching it streamed LIVE online.  
Learn more at http://p.sf.net/sfu/ms-windowsazure

Re: [PATCH 11/14] mac802154: slaves manipulation routine

From: Joe Perches <joe@perches.com>
Date: 2011-12-20 01:08:41

On Mon, 2011-12-19 at 14:43 -0500, David Miller wrote:
From: Alexander Smirnov <redacted>
quoted
+	if ((--priv->hw->open_count) == 0)
This is more canonical as "if (!--priv->hw->open_count)".
Shrug.   I think this is more readable and
intelligible with the == 0.

A test of a non-bool or non-ptr to a specific value
seems reasonable to me.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help