From: Sasha Levin <sashal@kernel.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
Mauro Carvalho Chehab <mchehab+samsung@kernel.org>,
devel@driverdev.osuosl.org, linux-media@vger.kernel.org
Subject: Re: [PATCH AUTOSEL 4.20 056/117] media: cedrus: don't initialize pointers with zero
Date: Wed, 23 Jan 2019 09:04:47 -0500 [thread overview]
Message-ID: <20190123140447.GK202535@sasha-vm> (raw)
In-Reply-To: <20190109084854.GA1743@kadam>
On Wed, Jan 09, 2019 at 11:48:54AM +0300, Dan Carpenter wrote:
>This is a pure cleanup patch, it doesn't affect runtime.
>
>On Tue, Jan 08, 2019 at 02:25:24PM -0500, Sasha Levin wrote:
>> From: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
>>
>> [ Upstream commit e4d7b113fdccde1acf8638c5879f2a450d492303 ]
>>
>> A common mistake is to assume that initializing a var with:
>> struct foo f = { 0 };
>>
>> Would initialize a zeroed struct. Actually, what this does is
>> to initialize the first element of the struct to zero.
>>
>> According to C99 Standard 6.7.8.21:
>>
>> "If there are fewer initializers in a brace-enclosed
>> list than there are elements or members of an aggregate,
>> or fewer characters in a string literal used to initialize
>> an array of known size than there are elements in the array,
>> the remainder of the aggregate shall be initialized implicitly
>> the same as objects that have static storage duration."
>
>Static storage is initialized to zero so this is fine. It's just
>that Sparse complains if you mix NULL and zero.
I'll drop it, thank you.
--
Thanks,
Sasha
prev parent reply other threads:[~2019-01-23 14:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20190108192628.121270-1-sashal@kernel.org>
2019-01-08 19:25 ` [PATCH AUTOSEL 4.20 046/117] media: uvcvideo: Refactor teardown of uvc on USB disconnect Sasha Levin
2019-01-08 19:25 ` [PATCH AUTOSEL 4.20 050/117] media: firewire: Fix app_info parameter type in avc_ca{,_app}_info Sasha Levin
2019-01-08 19:25 ` [PATCH AUTOSEL 4.20 054/117] media: venus: core: Set dma maximum segment size Sasha Levin
2019-01-08 19:25 ` [PATCH AUTOSEL 4.20 056/117] media: cedrus: don't initialize pointers with zero Sasha Levin
2019-01-09 8:48 ` Dan Carpenter
2019-01-23 14:04 ` Sasha Levin [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=20190123140447.GK202535@sasha-vm \
--to=sashal@kernel.org \
--cc=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab+samsung@kernel.org \
--cc=stable@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