netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michał Mirosław" <mirqus@gmail.com>
To: Joe Perches <joe@perches.com>
Cc: Sergei Shtylyov <sshtylyov@mvista.com>,
	Oliver Neukum <oneukum@suse.de>,
	David Brownell <dbrownell@users.sourceforge.net>,
	Greg Kroah-Hartman <gregkh@suse.de>,
	netdev@vger.kernel.org, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] usbnet: Convert dbg to dev_dbg and neatening
Date: Wed, 4 May 2011 14:42:16 +0200	[thread overview]
Message-ID: <BANLkTikW8W8ZVSYMyOSJxiWouLE1_tEiDQ@mail.gmail.com> (raw)
In-Reply-To: <1304511102.1788.91.camel@Joe-Laptop>

2011/5/4 Joe Perches <joe@perches.com>:
> On Wed, 2011-05-04 at 15:35 +0400, Sergei Shtylyov wrote:
>> Hello.
>
> And hello to you Sergei.
>
> On 03-05-2011 22:17, Joe Perches wrote:
>> > Use the more standard logging form.
>> > Add a bit more tidying style.
>>     Style changes look rather doubtful to me...
>> >   drivers/net/usb/usbnet.c |   23 +++++++++++------------
>> > diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
> []
>> > @@ -192,8 +192,8 @@ static int init_status(struct usbnet *dev, struct usb_interface *intf)
>> >             return 0;
>> >
>> >     pipe = usb_rcvintpipe(dev->udev,
>> > -                         dev->status->desc.bEndpointAddress
>> > -                   & USB_ENDPOINT_NUMBER_MASK);
>> > +                         (dev->status->desc.bEndpointAddress
>> > +                   & USB_ENDPOINT_NUMBER_MASK));
>>
>>     Why add parens?
>
> Leading & uses are almost always addressof.
> This makes it easier for me to see that it's not an addressof use.

This is a clear case where 80-char limit impairs code readability. Why
not just use another variable?

int epn = dev->status->desc.bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
pipe = usb_rcvintpipe(dev->udev, epn);

Best Regards,
Michał Mirosław

      reply	other threads:[~2011-05-04 12:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-03 18:17 [PATCH 0/2] usbnet: style cleaning and logging Joe Perches
2011-05-03 18:17 ` [PATCH 1/2] usbnet: Style cleanups Joe Perches
2011-05-03 18:49   ` Oliver Neukum
2011-05-03 19:05     ` Joe Perches
2011-05-03 18:17 ` [PATCH 2/2] usbnet: Convert dbg to dev_dbg and neatening Joe Perches
2011-05-03 18:51   ` Oliver Neukum
2011-05-04 11:35   ` Sergei Shtylyov
2011-05-04 12:11     ` Joe Perches
2011-05-04 12:42       ` Michał Mirosław [this message]

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=BANLkTikW8W8ZVSYMyOSJxiWouLE1_tEiDQ@mail.gmail.com \
    --to=mirqus@gmail.com \
    --cc=dbrownell@users.sourceforge.net \
    --cc=gregkh@suse.de \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=oneukum@suse.de \
    --cc=sshtylyov@mvista.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).