From: "Christian König" <christian.koenig@amd.com>
To: Alex Deucher <alexdeucher@gmail.com>, Kees Cook <keescook@chromium.org>
Cc: "David Airlie" <airlied@linux.ie>,
LKML <linux-kernel@vger.kernel.org>,
"Maling list - DRI developers" <dri-devel@lists.freedesktop.org>,
"amd-gfx list" <amd-gfx@lists.freedesktop.org>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Rex Zhu" <Rex.Zhu@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"Hawking Zhang" <Hawking.Zhang@amd.com>
Subject: Re: [PATCH] drm/amd/powerplay: rv: Use designated initializers
Date: Fri, 28 Jul 2017 11:13:01 +0200 [thread overview]
Message-ID: <04db0bba-bf20-27dc-06ec-b99ce2df7fc8@amd.com> (raw)
In-Reply-To: <CADnq5_N=PK=k7Q9QGCqoQ0Bx5YnRRw1WjXijtxqhfKmFoh3MTg@mail.gmail.com>
Am 28.07.2017 um 03:43 schrieb Alex Deucher:
> On Tue, Jul 25, 2017 at 5:47 PM, Kees Cook <keescook@chromium.org> wrote:
>> As done for vega10 in commit 3ddd396f6b57 ("drm/amd/powerplay: Use
>> designated initializers") mark other tableFunction entries with designated
>> initializers. The randstruct plugin requires designated initializers for
>> structures that are entirely function pointers.
>>
>> Cc: Rex Zhu <Rex.Zhu@amd.com>
>> Cc: Hawking Zhang <Hawking.Zhang@amd.com>
>> Cc: Alex Deucher <alexander.deucher@amd.com>
>> Signed-off-by: Kees Cook <keescook@chromium.org>
>> ---
>> If I can get an Ack for this, I'll carry it in the gcc-plugins tree, unless
>> you think this is worth landing for v4.13, in which case, please take it
>> now. :)
>>
> Acked-by: Alex Deucher <alexander.deucher@amd.com>
>
> I'm happy to take this through my tree if that is ok with you.
I'm wondering a bit how the plugin detects that it can randomize a
structure layout?
We have a couple of structs where this would be fatal.
Christian.
>
> Alex
>
>> Thanks!
>> ---
>> drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c | 8 ++++----
>> 1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c
>> index 4c7f430b36eb..8e6cfd89c7e0 100644
>> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c
>> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c
>> @@ -308,8 +308,8 @@ static int rv_tf_set_num_active_display(struct pp_hwmgr *hwmgr, void *input,
>> }
>>
>> static const struct phm_master_table_item rv_set_power_state_list[] = {
>> - { NULL, rv_tf_set_clock_limit },
>> - { NULL, rv_tf_set_num_active_display },
>> + { .tableFunction = rv_tf_set_clock_limit },
>> + { .tableFunction = rv_tf_set_num_active_display },
>> { }
>> };
>>
>> @@ -382,7 +382,7 @@ static int rv_tf_disable_gfx_off(struct pp_hwmgr *hwmgr,
>> }
>>
>> static const struct phm_master_table_item rv_disable_dpm_list[] = {
>> - {NULL, rv_tf_disable_gfx_off},
>> + { .tableFunction = rv_tf_disable_gfx_off },
>> { },
>> };
>>
>> @@ -407,7 +407,7 @@ static int rv_tf_enable_gfx_off(struct pp_hwmgr *hwmgr,
>> }
>>
>> static const struct phm_master_table_item rv_enable_dpm_list[] = {
>> - {NULL, rv_tf_enable_gfx_off},
>> + { .tableFunction = rv_tf_enable_gfx_off },
>> { },
>> };
>>
>> --
>> 2.7.4
>>
>>
>> --
>> Kees Cook
>> Pixel Security
>> _______________________________________________
>> amd-gfx mailing list
>> amd-gfx@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2017-07-28 9:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-25 21:47 [PATCH] drm/amd/powerplay: rv: Use designated initializers Kees Cook
2017-07-28 1:43 ` Alex Deucher
2017-07-28 9:13 ` Christian König [this message]
2017-07-28 17:10 ` Kees Cook
2017-07-28 17:15 ` Kees Cook
2017-07-28 17:26 ` Deucher, Alexander
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=04db0bba-bf20-27dc-06ec-b99ce2df7fc8@amd.com \
--to=christian.koenig@amd.com \
--cc=Hawking.Zhang@amd.com \
--cc=Rex.Zhu@amd.com \
--cc=airlied@linux.ie \
--cc=alexander.deucher@amd.com \
--cc=alexdeucher@gmail.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=keescook@chromium.org \
--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