From: Cody P Schafer <cody@linux.vnet.ibm.com>
To: Venu Byravarasu <vbyravarasu@nvidia.com>
Cc: Shubhrajyoti D <shubhrajyoti@ti.com>,
"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"julia.lawall@lip6.fr" <julia.lawall@lip6.fr>,
Shubhrajyoti Datta <omaplinuxkernel@gmail.com>
Subject: Re: [PATCHv2 6/6] media: Convert struct i2c_msg initialization to C99 format
Date: Tue, 18 Sep 2012 13:09:02 -0700 [thread overview]
Message-ID: <5058D4DE.6060007@linux.vnet.ibm.com> (raw)
In-Reply-To: <D958900912E20642BCBC71664EFECE3E6DDEFB9480@BGMAIL02.nvidia.com>
On Tue 18 Sep 2012 03:02:42 AM PDT, Venu Byravarasu wrote:
>> -----Original Message-----
>> From: Shubhrajyoti Datta [mailto:omaplinuxkernel@gmail.com]
>> Sent: Tuesday, September 18, 2012 3:30 PM
>> To: Venu Byravarasu
>> Cc: Shubhrajyoti D; linux-media@vger.kernel.org; linux-
>> kernel@vger.kernel.org; julia.lawall@lip6.fr
>> Subject: Re: [PATCHv2 6/6] media: Convert struct i2c_msg initialization to C99
>> format
>
>>>> struct i2c_msg test[2] = {
>>>> - { client->addr, 0, 3, write },
>>>> - { client->addr, I2C_M_RD, 2, read },
>>>> + {
>>>> + .addr = client->addr,
>>>> + .flags = 0,
>>>
>>> Does flags not contain 0 by default?
>>>
>>
>> It does however I felt that 0 means write so letting it be explicit.
>>
>> In case a removal is preferred that's doable too however felt it is
>> more readable this way.
>
> Though it adds readability, it carries an overhead of one write operation too.
> So, better to remove it.
Partially initialized structs will have their unmentioned members
initialized to zero.
So there is no "overhead of one write operation" by mentioning it
explicitly.
next prev parent reply other threads:[~2012-09-18 20:10 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-18 9:50 [PATCHv2 0/6] media: convert to c99 format Shubhrajyoti D
2012-09-18 9:50 ` [PATCHv2 1/6] media: Convert struct i2c_msg initialization to C99 format Shubhrajyoti D
2012-09-18 9:50 ` [PATCHv2 2/6] " Shubhrajyoti D
2012-09-18 9:50 ` [PATCHv2 3/6] " Shubhrajyoti D
2012-09-18 9:50 ` [PATCHv2 4/6] " Shubhrajyoti D
2012-09-18 9:50 ` [PATCHv2 5/6] " Shubhrajyoti D
2012-09-18 9:50 ` [PATCHv2 6/6] " Shubhrajyoti D
2012-09-18 9:56 ` Venu Byravarasu
2012-09-18 10:00 ` Shubhrajyoti Datta
2012-09-18 10:02 ` Venu Byravarasu
2012-09-18 20:09 ` Cody P Schafer [this message]
2012-09-18 10:00 ` [PATCHv2 0/6] media: convert to c99 format Hans Verkuil
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=5058D4DE.6060007@linux.vnet.ibm.com \
--to=cody@linux.vnet.ibm.com \
--cc=julia.lawall@lip6.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=omaplinuxkernel@gmail.com \
--cc=shubhrajyoti@ti.com \
--cc=vbyravarasu@nvidia.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).