From patchwork Fri May 26 20:17:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 9751101 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1761660246 for ; Fri, 26 May 2017 20:19:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0A5D728334 for ; Fri, 26 May 2017 20:19:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F334328347; Fri, 26 May 2017 20:19:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.wl.linuxfoundation.org (Postfix) with SMTP id 2FC9128334 for ; Fri, 26 May 2017 20:19:58 +0000 (UTC) Received: (qmail 9242 invoked by uid 550); 26 May 2017 20:18:40 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 8169 invoked from network); 26 May 2017 20:18:39 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HJrnXApxuHBXbCVx4sXwCzSB2Xlsw7GPtQoV38DQmZQ=; b=VzkUxHaw4yRtN+DcKFn/bUiegG2/6zXbBZAHdv9vJM2gFJtjhKNFqZqSPgCFCBiC04 bKzIRclswHyOhEzhTsRXibYTFxQVjUWOUEhrc5dUPTvDqE/JVnoZIn79KLTWhZ9W7mT4 zBTGVyqeWfx2viDTZHn6fxFbS8KM2wwQ/9VSA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HJrnXApxuHBXbCVx4sXwCzSB2Xlsw7GPtQoV38DQmZQ=; b=e2UlNpLOTQ5D8R7JRvRh5dLk0XTnrlw37/2xvTJ1y2xeRnVwbdo4qGRJcnQU82ztN/ AmoQehT7tZGLbPLgZ+YftSBHmBc80tLmTNt/HigQ4O0JejcX85mzHwn2dryJY12qveRl TwM9dcGIhrhfExGQ5hVPJWXedebxV2OBiE7AQmgeCONE+Wntq/a1LbLFaLno+hUN++hb krxp+/oa0H3oLTiQIfcEAX+ylJ8uCryywK9rONAb0w5h59a2zd5O5uNlU2k2IV4CJPhp cOLjChWRSKaEEXUI0Tf11F1gU8/Bj64ImhW4gc2LasA91G2Qrb8idQaN5FVLU+YBOYKc Py/Q== X-Gm-Message-State: AODbwcDj9XBPdNQM9JmqDrKBibRkzDnCYhdnKTq2+pjIehXZP0ti4+c8 RlqkfKg3Ioa+ZeJ8 X-Received: by 10.98.137.93 with SMTP id v90mr4408749pfd.69.1495829907739; Fri, 26 May 2017 13:18:27 -0700 (PDT) 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 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 Subject: [kernel-hardening] [PATCH v2 14/20] drm/amd/powerplay: Use designated initializers X-Virus-Scanned: ClamAV using ClamSMTP 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