AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/display: Initialize stream_update with memset
@ 2019-03-22 13:15 Nicholas Kazlauskas
       [not found] ` <20190322131512.22103-1-nicholas.kazlauskas-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Nicholas Kazlauskas @ 2019-03-22 13:15 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
  Cc: Sun peng Li, Harry Wentland, Nicholas Kazlauskas

The brace initialization used here generates errors on some
compilers. Use memset to make this more portable.

Cc: Sun peng Li <Sunpeng.Li@amd.com>
Cc: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 5b7a85e28fab..9cdd52edfc3d 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -5982,7 +5982,9 @@ dm_determine_update_type_for_commit(struct dc *dc,
 	}
 
 	for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {
-		struct dc_stream_update stream_update = { 0 };
+		struct dc_stream_update stream_update;
+
+		memset(&stream_update, 0, sizeof(stream_update));
 
 		new_dm_crtc_state = to_dm_crtc_state(new_crtc_state);
 		old_dm_crtc_state = to_dm_crtc_state(old_crtc_state);
-- 
2.17.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH] drm/amd/display: Initialize stream_update with memset
       [not found] ` <20190322131512.22103-1-nicholas.kazlauskas-5C7GfCeVMHo@public.gmane.org>
@ 2019-03-22 13:49   ` Paul Menzel
       [not found]     ` <2afb73d6-2baf-880a-6f4e-49303f4ccded-KUpvgZVWgV9o1qOY/usvUg@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Menzel @ 2019-03-22 13:49 UTC (permalink / raw)
  To: Nicholas Kazlauskas
  Cc: Sun peng Li, Harry Wentland,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW


[-- Attachment #1.1: Type: text/plain, Size: 308 bytes --]

Dear Nicholas,


On 03/22/19 14:15, Nicholas Kazlauskas wrote:
> The brace initialization used here generates errors on some
> compilers. Use memset to make this more portable.

Could you please specify the problematic compiler/toolchain in
the commit message?

[…]


Kind regards,

Paul


[-- Attachment #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 5174 bytes --]

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH] drm/amd/display: Initialize stream_update with memset
       [not found]     ` <2afb73d6-2baf-880a-6f4e-49303f4ccded-KUpvgZVWgV9o1qOY/usvUg@public.gmane.org>
@ 2019-03-22 13:54       ` Kazlauskas, Nicholas
  0 siblings, 0 replies; 3+ messages in thread
From: Kazlauskas, Nicholas @ 2019-03-22 13:54 UTC (permalink / raw)
  To: Paul Menzel
  Cc: Li, Sun peng (Leo), Wentland, Harry,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org

On 3/22/19 9:49 AM, Paul Menzel wrote:
> Dear Nicholas,
> 
> 
> On 03/22/19 14:15, Nicholas Kazlauskas wrote:
>> The brace initialization used here generates errors on some
>> compilers. Use memset to make this more portable.
> 
> Could you please specify the problematic compiler/toolchain in
> the commit message?
> 
> […]
> 
> 
> Kind regards,
> 
> Paul
> 

I actually meant warning in this case - since I usually build amdgpu 
with warnings as errors. In this case it was an older version of GCC 
that generated the warning (4.9). Though I think clang does as well, I 
forgot to make this patch after I saw the email from Nils Wallménius a 
while back. There were similar issues in a few other places:

https://lists.freedesktop.org/archives/amd-gfx/2019-February/031116.html

I'll update the commit message and post a v2, thanks!

Nicholas Kazlauskas
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

end of thread, other threads:[~2019-03-22 13:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-22 13:15 [PATCH] drm/amd/display: Initialize stream_update with memset Nicholas Kazlauskas
     [not found] ` <20190322131512.22103-1-nicholas.kazlauskas-5C7GfCeVMHo@public.gmane.org>
2019-03-22 13:49   ` Paul Menzel
     [not found]     ` <2afb73d6-2baf-880a-6f4e-49303f4ccded-KUpvgZVWgV9o1qOY/usvUg@public.gmane.org>
2019-03-22 13:54       ` Kazlauskas, Nicholas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox