All of lore.kernel.org
 help / color / mirror / Atom feed
From: Max Krasnyanskiy <maxk@qualcomm.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Vitaliy Ivanov <vitalivanov@gmail.com>,
	pavel@ucw.cz, linux-kernel@vger.kernel.org, marcel@holtmann.org,
	linux-bluetooth@vger.kernel.org
Subject: Re: hci_usb: remove macro code obfuscation
Date: Wed, 16 Apr 2008 11:37:41 -0700	[thread overview]
Message-ID: <48064775.7000902@qualcomm.com> (raw)
In-Reply-To: <20080416112909.505fe619.akpm@linux-foundation.org>

Andrew Morton wrote:
> On Wed, 16 Apr 2008 13:51:37 +0300
> "Vitaliy Ivanov" <vitalivanov@gmail.com> wrote:
> 
>> On Wed, Apr 16, 2008 at 1:42 PM, Pavel Machek <pavel@ucw.cz> wrote:
>>>  I had trouble figuring out what the code does. atomic_inc/dec
>>>  management is actually pretty simple, but it is needlessly obfuscated
>>>  with macros. Fix that.
>>>
>>>  Signed-off-by: Pavel Machek <pavel@suse.cz>
>>>
>>>  I had trouble figuring out what the code does. atomic_inc/dec
>>>  management is actually pretty simple, but it is needlessly obfuscated
>>>  with macros. Fix that.
>>>
>>>  Signed-off-by: Pavel Machek <pavel@suse.cz>
>>
>> Got it from the first time;)
>>
>> Do you think that now code looks better? As for me it's not...
>>
> 
> Yes, I expect that the original code was easier to work with and it is not
> obfuscated I don't think.  Sometimes these things take a few minutes for
> new readers to become comfortable with but are good for people who work on
> the code regularly.
> 
> Although it's a mystery why __pending_tx() and friends
> 
> a) have leading underscores and
At the time I wrote it, it made sense (to me :)) but it's been such a long 
time ago I would not remember. Probably to show that this is something 
internal and needs to be used with caution.

> 
> b) are implemented in cpp, when C is available.
> 
I'm not sure what you mean ? #define vs inline I suppose ?

Max

  reply	other threads:[~2008-04-16 18:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-16 10:42 hci_usb: remove macro code obfuscation Pavel Machek
2008-04-16 10:51 ` Vitaliy Ivanov
2008-04-16 10:58   ` Pavel Machek
2008-04-16 17:19     ` Max Krasnyanskiy
2008-04-19 16:18       ` Pavel Machek
2008-04-16 18:29   ` Andrew Morton
2008-04-16 18:37     ` Max Krasnyanskiy [this message]
2008-04-16 20:10       ` Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48064775.7000902@qualcomm.com \
    --to=maxk@qualcomm.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=pavel@ucw.cz \
    --cc=vitalivanov@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.