From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S940990AbdE0BMW (ORCPT ); Fri, 26 May 2017 21:12:22 -0400 Received: from mail-pf0-f182.google.com ([209.85.192.182]:33274 "EHLO mail-pf0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S944878AbdEZUS2 (ORCPT ); Fri, 26 May 2017 16:18:28 -0400 From: Kees Cook To: kernel-hardening@lists.openwall.com Cc: Kees Cook , =?UTF-8?q?Christian=20K=C3=B6nig?= , Eric Huang , Alex Deucher , Laura Abbott , x86@kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 14/20] drm/amd/powerplay: Use designated initializers Date: Fri, 26 May 2017 13:17:18 -0700 Message-Id: <1495829844-69341-15-git-send-email-keescook@chromium.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1495829844-69341-1-git-send-email-keescook@chromium.org> References: <1495829844-69341-1-git-send-email-keescook@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The randstruct plugin requires designated initializers for structures that are entirely function pointers. Cc: Christian König Cc: Eric Huang Cc: Alex Deucher Signed-off-by: Kees Cook --- .../gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c | 28 ++++++++++++++-------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c index d5f53d04fa08..cfa187185dcc 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c @@ -709,17 +709,22 @@ static int tf_vega10_thermal_disable_alert(struct pp_hwmgr *hwmgr, static struct phm_master_table_item vega10_thermal_start_thermal_controller_master_list[] = { - {NULL, tf_vega10_thermal_initialize}, - {NULL, tf_vega10_thermal_set_temperature_range}, - {NULL, tf_vega10_thermal_enable_alert}, + { .isFunctionNeededInRuntimeTable = NULL, + .tableFunction = tf_vega10_thermal_initialize }, + { .isFunctionNeededInRuntimeTable = NULL, + .tableFunction = tf_vega10_thermal_set_temperature_range }, + { .isFunctionNeededInRuntimeTable = NULL, + .tableFunction = tf_vega10_thermal_enable_alert }, /* We should restrict performance levels to low before we halt the SMC. * On the other hand we are still in boot state when we do this * so it would be pointless. * If this assumption changes we have to revisit this table. */ - {NULL, tf_vega10_thermal_setup_fan_table}, - {NULL, tf_vega10_thermal_start_smc_fan_control}, - {NULL, NULL} + { .isFunctionNeededInRuntimeTable = NULL, + .tableFunction = tf_vega10_thermal_setup_fan_table }, + { .isFunctionNeededInRuntimeTable = NULL, + .tableFunction = tf_vega10_thermal_start_smc_fan_control }, + { } }; static struct phm_master_table_header @@ -731,10 +736,13 @@ vega10_thermal_start_thermal_controller_master = { static struct phm_master_table_item vega10_thermal_set_temperature_range_master_list[] = { - {NULL, tf_vega10_thermal_disable_alert}, - {NULL, tf_vega10_thermal_set_temperature_range}, - {NULL, tf_vega10_thermal_enable_alert}, - {NULL, NULL} + { .isFunctionNeededInRuntimeTable = NULL, + .tableFunction = tf_vega10_thermal_disable_alert }, + { .isFunctionNeededInRuntimeTable = NULL, + .tableFunction = tf_vega10_thermal_set_temperature_range }, + { .isFunctionNeededInRuntimeTable = NULL, + .tableFunction = tf_vega10_thermal_enable_alert }, + { } }; struct phm_master_table_header -- 2.7.4