From: Dan Carpenter <dan.carpenter@oracle.com>
To: H Hartley Sweeten <hartleys@visionengravers.com>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>,
"devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>,
"fmhess@users.sourceforge.net" <fmhess@users.sourceforge.net>,
"abbotti@mev.co.uk" <abbotti@mev.co.uk>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>
Subject: Re: [PATCH 8/8] staging: comedi: cleanup comedi_alloc_subdevices
Date: Wed, 13 Jun 2012 09:23:35 +0300 [thread overview]
Message-ID: <20120613062334.GS13539@mwanda> (raw)
In-Reply-To: <ADE657CA350FB648AAC2C43247A983F0020698DBC78B@AUSP01VMBX24.collaborationhost.net>
On Tue, Jun 12, 2012 at 03:20:32PM -0500, H Hartley Sweeten wrote:
> On Tuesday, June 12, 2012 12:50 PM, Dan Carpenter wrote:
> > On Tue, Jun 12, 2012 at 11:59:55AM -0700, H Hartley Sweeten wrote:
> >> for (i = 0; i < num_subdevices; ++i) {
> >> - dev->subdevices[i].device = dev;
> >> - dev->subdevices[i].async_dma_dir = DMA_NONE;
> >> - spin_lock_init(&dev->subdevices[i].spin_lock);
> >> - dev->subdevices[i].minor = -1;
> >> + s = dev->subdevices + i;
> >
> > You don't have to resend, but I think this would look better as:
> >
> > s = &dev->subdevices[i];
>
> I don't disagree but the "dev->subdevices +i" format is consistently
> used in all the comedi stuff. If the format above is preferred we
> should probably update everything,
To me the one is way more clear than the other. If we wanted we
could write any array in terms of pointer math, but arrays are
easier to understand.
regards,
dan carpenter
prev parent reply other threads:[~2012-06-13 6:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-12 18:59 [PATCH 8/8] staging: comedi: cleanup comedi_alloc_subdevices H Hartley Sweeten
2012-06-12 19:49 ` Dan Carpenter
2012-06-12 20:20 ` H Hartley Sweeten
2012-06-13 6:23 ` Dan Carpenter [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=20120613062334.GS13539@mwanda \
--to=dan.carpenter@oracle.com \
--cc=abbotti@mev.co.uk \
--cc=devel@driverdev.osuosl.org \
--cc=fmhess@users.sourceforge.net \
--cc=gregkh@linuxfoundation.org \
--cc=hartleys@visionengravers.com \
--cc=linux-kernel@vger.kernel.org \
/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