All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm: sun4i: Fix a uninitialized variable warning.
@ 2018-09-18  7:25 ` zhong jiang
  0 siblings, 0 replies; 10+ messages in thread
From: zhong jiang @ 2018-09-18  7:25 UTC (permalink / raw)
  To: airlied, maxime.ripard; +Cc: linux-arm-kernel, linux-kernel

Fix the following compile warning:

drivers/gpu/drm/sun4i/sun4i_tcon.c:1088: warning: 'has_lvds_alt' may be used uninitialized in this function [-Wmaybe-uninitialized]
bool has_lvds_rst, has_lvds_alt, can_lvds;

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
 drivers/gpu/drm/sun4i/sun4i_tcon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c
index c78cd35..563cc8f 100644
--- a/drivers/gpu/drm/sun4i/sun4i_tcon.c
+++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c
@@ -1086,7 +1086,7 @@ static int sun4i_tcon_bind(struct device *dev, struct device *master,
 	struct device_node *remote;
 	struct sun4i_tcon *tcon;
 	struct reset_control *edp_rstc;
-	bool has_lvds_rst, has_lvds_alt, can_lvds;
+	bool has_lvds_rst, has_lvds_alt = false, can_lvds;
 	int ret;
 
 	engine = sun4i_tcon_find_engine(drv, dev->of_node);
-- 
1.7.12.4


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH] drm: sun4i: Fix a uninitialized variable warning.
@ 2018-09-18  7:25 ` zhong jiang
  0 siblings, 0 replies; 10+ messages in thread
From: zhong jiang @ 2018-09-18  7:25 UTC (permalink / raw)
  To: linux-arm-kernel

Fix the following compile warning:

drivers/gpu/drm/sun4i/sun4i_tcon.c:1088: warning: 'has_lvds_alt' may be used uninitialized in this function [-Wmaybe-uninitialized]
bool has_lvds_rst, has_lvds_alt, can_lvds;

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
 drivers/gpu/drm/sun4i/sun4i_tcon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c
index c78cd35..563cc8f 100644
--- a/drivers/gpu/drm/sun4i/sun4i_tcon.c
+++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c
@@ -1086,7 +1086,7 @@ static int sun4i_tcon_bind(struct device *dev, struct device *master,
 	struct device_node *remote;
 	struct sun4i_tcon *tcon;
 	struct reset_control *edp_rstc;
-	bool has_lvds_rst, has_lvds_alt, can_lvds;
+	bool has_lvds_rst, has_lvds_alt = false, can_lvds;
 	int ret;
 
 	engine = sun4i_tcon_find_engine(drv, dev->of_node);
-- 
1.7.12.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] drm: sun4i: Fix a uninitialized variable warning.
  2018-09-18  7:25 ` zhong jiang
@ 2018-09-19  8:47   ` Maxime Ripard
  -1 siblings, 0 replies; 10+ messages in thread
From: Maxime Ripard @ 2018-09-19  8:47 UTC (permalink / raw)
  To: zhong jiang; +Cc: airlied, linux-arm-kernel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 655 bytes --]

On Tue, Sep 18, 2018 at 03:25:20PM +0800, zhong jiang wrote:
> Fix the following compile warning:
> 
> drivers/gpu/drm/sun4i/sun4i_tcon.c:1088: warning: 'has_lvds_alt' may be used uninitialized in this function [-Wmaybe-uninitialized]
> bool has_lvds_rst, has_lvds_alt, can_lvds;
> 
> Signed-off-by: zhong jiang <zhongjiang@huawei.com>

I can't see any code path that would lead to an uninitialized usage of
that variable.

Which compiler produced that warning? I tried building it today with
gcc 8.1.1, and I don't see that warning either.

Maxime

-- 
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH] drm: sun4i: Fix a uninitialized variable warning.
@ 2018-09-19  8:47   ` Maxime Ripard
  0 siblings, 0 replies; 10+ messages in thread
From: Maxime Ripard @ 2018-09-19  8:47 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Sep 18, 2018 at 03:25:20PM +0800, zhong jiang wrote:
> Fix the following compile warning:
> 
> drivers/gpu/drm/sun4i/sun4i_tcon.c:1088: warning: 'has_lvds_alt' may be used uninitialized in this function [-Wmaybe-uninitialized]
> bool has_lvds_rst, has_lvds_alt, can_lvds;
> 
> Signed-off-by: zhong jiang <zhongjiang@huawei.com>

I can't see any code path that would lead to an uninitialized usage of
that variable.

Which compiler produced that warning? I tried building it today with
gcc 8.1.1, and I don't see that warning either.

Maxime

-- 
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180919/4d1e8855/attachment.sig>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] drm: sun4i: Fix a uninitialized variable warning.
  2018-09-19  8:47   ` Maxime Ripard
@ 2018-09-19  9:01     ` zhong jiang
  -1 siblings, 0 replies; 10+ messages in thread
From: zhong jiang @ 2018-09-19  9:01 UTC (permalink / raw)
  To: Maxime Ripard; +Cc: airlied, linux-arm-kernel, linux-kernel

On 2018/9/19 16:47, Maxime Ripard wrote:
> On Tue, Sep 18, 2018 at 03:25:20PM +0800, zhong jiang wrote:
>> Fix the following compile warning:
>>
>> drivers/gpu/drm/sun4i/sun4i_tcon.c:1088: warning: 'has_lvds_alt' may be used uninitialized in this function [-Wmaybe-uninitialized]
>> bool has_lvds_rst, has_lvds_alt, can_lvds;
>>
>> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
> I can't see any code path that would lead to an uninitialized usage of
> that variable.
>
> Which compiler produced that warning? I tried building it today with
> gcc 8.1.1, and I don't see that warning either.
>
> Maxime
>
I indeed  hit the issue.  the gcc version is
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609

Thanks,
zhong jiang


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH] drm: sun4i: Fix a uninitialized variable warning.
@ 2018-09-19  9:01     ` zhong jiang
  0 siblings, 0 replies; 10+ messages in thread
From: zhong jiang @ 2018-09-19  9:01 UTC (permalink / raw)
  To: linux-arm-kernel

On 2018/9/19 16:47, Maxime Ripard wrote:
> On Tue, Sep 18, 2018 at 03:25:20PM +0800, zhong jiang wrote:
>> Fix the following compile warning:
>>
>> drivers/gpu/drm/sun4i/sun4i_tcon.c:1088: warning: 'has_lvds_alt' may be used uninitialized in this function [-Wmaybe-uninitialized]
>> bool has_lvds_rst, has_lvds_alt, can_lvds;
>>
>> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
> I can't see any code path that would lead to an uninitialized usage of
> that variable.
>
> Which compiler produced that warning? I tried building it today with
> gcc 8.1.1, and I don't see that warning either.
>
> Maxime
>
I indeed  hit the issue.  the gcc version is
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609

Thanks,
zhong jiang

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] drm: sun4i: Fix a uninitialized variable warning.
  2018-09-19  9:01     ` zhong jiang
@ 2018-09-21 14:26       ` Maxime Ripard
  -1 siblings, 0 replies; 10+ messages in thread
From: Maxime Ripard @ 2018-09-21 14:26 UTC (permalink / raw)
  To: zhong jiang; +Cc: airlied, linux-arm-kernel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1152 bytes --]

On Wed, Sep 19, 2018 at 05:01:32PM +0800, zhong jiang wrote:
> On 2018/9/19 16:47, Maxime Ripard wrote:
> > On Tue, Sep 18, 2018 at 03:25:20PM +0800, zhong jiang wrote:
> >> Fix the following compile warning:
> >>
> >> drivers/gpu/drm/sun4i/sun4i_tcon.c:1088: warning: 'has_lvds_alt' may be used uninitialized in this function [-Wmaybe-uninitialized]
> >> bool has_lvds_rst, has_lvds_alt, can_lvds;
> >>
> >> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
> > I can't see any code path that would lead to an uninitialized usage of
> > that variable.
> >
> > Which compiler produced that warning? I tried building it today with
> > gcc 8.1.1, and I don't see that warning either.
>
> I indeed  hit the issue.  the gcc version is
> gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609

I've tested with 4.* gcc, and it didn't report any error. It seems to
be a false positive for this particular version, so there's no need to
merge that patch. If more people are affected, we'll obviously do
something about it though.

Thanks!
Maxime

-- 
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH] drm: sun4i: Fix a uninitialized variable warning.
@ 2018-09-21 14:26       ` Maxime Ripard
  0 siblings, 0 replies; 10+ messages in thread
From: Maxime Ripard @ 2018-09-21 14:26 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Sep 19, 2018 at 05:01:32PM +0800, zhong jiang wrote:
> On 2018/9/19 16:47, Maxime Ripard wrote:
> > On Tue, Sep 18, 2018 at 03:25:20PM +0800, zhong jiang wrote:
> >> Fix the following compile warning:
> >>
> >> drivers/gpu/drm/sun4i/sun4i_tcon.c:1088: warning: 'has_lvds_alt' may be used uninitialized in this function [-Wmaybe-uninitialized]
> >> bool has_lvds_rst, has_lvds_alt, can_lvds;
> >>
> >> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
> > I can't see any code path that would lead to an uninitialized usage of
> > that variable.
> >
> > Which compiler produced that warning? I tried building it today with
> > gcc 8.1.1, and I don't see that warning either.
>
> I indeed  hit the issue.  the gcc version is
> gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609

I've tested with 4.* gcc, and it didn't report any error. It seems to
be a false positive for this particular version, so there's no need to
merge that patch. If more people are affected, we'll obviously do
something about it though.

Thanks!
Maxime

-- 
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180921/4c54ac45/attachment.sig>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] drm: sun4i: Fix a uninitialized variable warning.
  2018-09-21 14:26       ` Maxime Ripard
@ 2018-09-21 14:49         ` zhong jiang
  -1 siblings, 0 replies; 10+ messages in thread
From: zhong jiang @ 2018-09-21 14:49 UTC (permalink / raw)
  To: Maxime Ripard; +Cc: airlied, linux-arm-kernel, linux-kernel

On 2018/9/21 22:26, Maxime Ripard wrote:
> On Wed, Sep 19, 2018 at 05:01:32PM +0800, zhong jiang wrote:
>> On 2018/9/19 16:47, Maxime Ripard wrote:
>>> On Tue, Sep 18, 2018 at 03:25:20PM +0800, zhong jiang wrote:
>>>> Fix the following compile warning:
>>>>
>>>> drivers/gpu/drm/sun4i/sun4i_tcon.c:1088: warning: 'has_lvds_alt' may be used uninitialized in this function [-Wmaybe-uninitialized]
>>>> bool has_lvds_rst, has_lvds_alt, can_lvds;
>>>>
>>>> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
>>> I can't see any code path that would lead to an uninitialized usage of
>>> that variable.
>>>
>>> Which compiler produced that warning? I tried building it today with
>>> gcc 8.1.1, and I don't see that warning either.
>> I indeed  hit the issue.  the gcc version is
>> gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
> I've tested with 4.* gcc, and it didn't report any error. It seems to
> be a false positive for this particular version, so there's no need to
> merge that patch. If more people are affected, we'll obviously do
> something about it though.
Yep,  it rarely occur.  I just happen once.  Thank you for reply.

Sincerely,
zhong jiang
> Thanks!
> Maxime
>



^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH] drm: sun4i: Fix a uninitialized variable warning.
@ 2018-09-21 14:49         ` zhong jiang
  0 siblings, 0 replies; 10+ messages in thread
From: zhong jiang @ 2018-09-21 14:49 UTC (permalink / raw)
  To: linux-arm-kernel

On 2018/9/21 22:26, Maxime Ripard wrote:
> On Wed, Sep 19, 2018 at 05:01:32PM +0800, zhong jiang wrote:
>> On 2018/9/19 16:47, Maxime Ripard wrote:
>>> On Tue, Sep 18, 2018 at 03:25:20PM +0800, zhong jiang wrote:
>>>> Fix the following compile warning:
>>>>
>>>> drivers/gpu/drm/sun4i/sun4i_tcon.c:1088: warning: 'has_lvds_alt' may be used uninitialized in this function [-Wmaybe-uninitialized]
>>>> bool has_lvds_rst, has_lvds_alt, can_lvds;
>>>>
>>>> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
>>> I can't see any code path that would lead to an uninitialized usage of
>>> that variable.
>>>
>>> Which compiler produced that warning? I tried building it today with
>>> gcc 8.1.1, and I don't see that warning either.
>> I indeed  hit the issue.  the gcc version is
>> gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
> I've tested with 4.* gcc, and it didn't report any error. It seems to
> be a false positive for this particular version, so there's no need to
> merge that patch. If more people are affected, we'll obviously do
> something about it though.
Yep,  it rarely occur.  I just happen once.  Thank you for reply.

Sincerely,
zhong jiang
> Thanks!
> Maxime
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-09-21 14:49 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-18  7:25 [PATCH] drm: sun4i: Fix a uninitialized variable warning zhong jiang
2018-09-18  7:25 ` zhong jiang
2018-09-19  8:47 ` Maxime Ripard
2018-09-19  8:47   ` Maxime Ripard
2018-09-19  9:01   ` zhong jiang
2018-09-19  9:01     ` zhong jiang
2018-09-21 14:26     ` Maxime Ripard
2018-09-21 14:26       ` Maxime Ripard
2018-09-21 14:49       ` zhong jiang
2018-09-21 14:49         ` zhong jiang

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.