Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp308176pxb; Wed, 18 Aug 2021 02:58:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpVfLLJNo9Qpt9Vy1UDh/dIANgIYMA10tHqG46cPJJpETm4QwNCYHN8KOS0LF6UrVFiXzi X-Received: by 2002:a5d:97cc:: with SMTP id k12mr6430439ios.4.1629280686612; Wed, 18 Aug 2021 02:58:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629280686; cv=none; d=google.com; s=arc-20160816; b=RTtWQwJkIwLwWe6s12aPb9Z4uLMCAe1gVNXy1m/rXW9GYW1Csx8xLlARITvZrRjKng gWuhMDF0OIoUip8e+aE8JMzfuwQh2HVJhhpaQ/PPrnSKKkT9q7/NrZ6cvp1t3MKpxfrM zsV5xI7xTTAW8Gt1pvmRNfWk7gN8RoQfWmoiEGP07aZg+mAu49bhKVxdqLZJuqqTmQAW uu+QCMaPsm8REoVuvUrh7U/xQXe2JcS/We15z6gvLRnUEIvM2231Kv/XZQ5OOq1TCJjY vYD3zCgppLlhjRn8E4TO7G9ZC5kUMkDAKxmjmy0vyhn1ST9dLXOwmPJDeKQhuBiyzuhz 31Mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature; bh=Rn4A30qTQOxkstQYw62Y3prioOpHXXbJvzGKouAI1jo=; b=lSW1Ibc0KIWs48bILavMKcuqk4kQMiD3VSYNfPRbHS6MPRjD9Srv3ulN1clvMLxVJk aiHweY59kRSwZhPL8D7A4ALcpzHGYTusoytM1WPEdKV6VyjiHprq+d7qatY9aar9aOYA duSbxRwxLHbPqWvxCAgzdBllNxkxe7lKOEP9uDsg1jbZFd+gLgfq0ytGmtxMLzO9020/ L0+yylaGjeK2DGfqBW35hkjhStZ71CQD1CBR7JvJcClI9VgY1RaoavwkcvrCuxqqcvAj 9SPosTlqa9EHRhQBR0lhpsJZ5c41kXzDkKPJKSgQ2pHijYB2UkRn+HfhWY03CE7t/76H Xsnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=HxuZ7amf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z9si4856687iow.13.2021.08.18.02.57.55; Wed, 18 Aug 2021 02:58:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=HxuZ7amf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231218AbhHRJ5s (ORCPT + 99 others); Wed, 18 Aug 2021 05:57:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231910AbhHRJ5p (ORCPT ); Wed, 18 Aug 2021 05:57:45 -0400 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F2B4C0613CF for ; Wed, 18 Aug 2021 02:57:11 -0700 (PDT) Received: by mail-ed1-x534.google.com with SMTP id bo19so2213396edb.9 for ; Wed, 18 Aug 2021 02:57:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=Rn4A30qTQOxkstQYw62Y3prioOpHXXbJvzGKouAI1jo=; b=HxuZ7amf0x5rDg8Pv2sDkTar7KFdTSrkayed1hQb/rSNUcLT73vKapTE8H9oodlrl+ XrKtbghyhAs5x9vzvwVUrXrR09KztnaG2Yh4SVOy5u7XPIz8jTtUtcddn80S6gYaezG8 v4/iegN2atmH28uNfVXvvavIu21o+9JE6gq04= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=Rn4A30qTQOxkstQYw62Y3prioOpHXXbJvzGKouAI1jo=; b=fii1UEfj/mUA1wLkbsCejCabj1TO8RfxXsMonp8jFg2HcAHPqqeD539LxhtaJhhfqf Bd/DmEOzRJE7+n/R7o7KajN3Lk3mUwbfi6g1xV1NBDTEe6HJbRxran7KVu0IwnwWzFoX xEfBtZb/JuqXd9deBNJLiZt6aFY9im/E4K0hTQIWDyyrrlCTbnditpf7BWus4METNCmn Dv1UqixMUYrlB0KqglP7Bf3H13YXCXpNT+GNHiy7/RHLBKkYIMePvMJcbcchsdMer/TK nvMT/BpXrlIENzVY4ySAZb6XbxyqU7lE+wMIVIkXWO441U5tEsvdcz+vTaHWQ6kBFY4n aSXg== X-Gm-Message-State: AOAM533Q4M/Ke4Gu6J9saELQNe8VMDaJbL8QfV9DwGOOfK1vljNQWXdG ZjamvEk8Wan7DRfDBR833qaJcg== X-Received: by 2002:a05:6402:29a:: with SMTP id l26mr9269082edv.347.1629280629996; Wed, 18 Aug 2021 02:57:09 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id q21sm1789736eji.59.2021.08.18.02.57.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Aug 2021 02:57:09 -0700 (PDT) Date: Wed, 18 Aug 2021 11:57:07 +0200 From: Daniel Vetter To: Kees Cook Cc: Jani Nikula , Daniel Vetter , Joonas Lahtinen , Rodrigo Vivi , David Airlie , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Jason Ekstrand , linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH] drm/i915: Use designated initializers for init/exit table Message-ID: Mail-Followup-To: Kees Cook , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , David Airlie , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Jason Ekstrand , linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org References: <20210817233357.2379455-1-keescook@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210817233357.2379455-1-keescook@chromium.org> X-Operating-System: Linux phenom 5.10.0-7-amd64 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 17, 2021 at 04:33:57PM -0700, Kees Cook wrote: > The kernel builds with -Werror=designated-init, and __designated_init > is used by CONFIG_GCC_PLUGIN_RANDSTRUCT for automatically selected (all > function pointer) structures. Include the field names in the init/exit > table. Avoids warnings like: > > drivers/gpu/drm/i915/i915_module.c:59:4: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init] > > Cc: Jani Nikula > Cc: Joonas Lahtinen > Cc: Rodrigo Vivi > Cc: David Airlie > Cc: intel-gfx@lists.freedesktop.org > Cc: dri-devel@lists.freedesktop.org > Fixes: a04ea6ae7c67 ("drm/i915: Use a table for i915_init/exit (v2)") > Signed-off-by: Kees Cook Applied to drm-intel-gt-next, should show up in linux-next/next merge window eventually (that branch isn't in linux-next for reasons). -Daniel > --- > drivers/gpu/drm/i915/i915_module.c | 37 +++++++++++++++++++----------- > 1 file changed, 24 insertions(+), 13 deletions(-) > > diff --git a/drivers/gpu/drm/i915/i915_module.c b/drivers/gpu/drm/i915/i915_module.c > index c578ea8f56a0..d8b4482c69d0 100644 > --- a/drivers/gpu/drm/i915/i915_module.c > +++ b/drivers/gpu/drm/i915/i915_module.c > @@ -47,19 +47,30 @@ static const struct { > int (*init)(void); > void (*exit)(void); > } init_funcs[] = { > - { i915_check_nomodeset, NULL }, > - { i915_active_module_init, i915_active_module_exit }, > - { i915_buddy_module_init, i915_buddy_module_exit }, > - { i915_context_module_init, i915_context_module_exit }, > - { i915_gem_context_module_init, i915_gem_context_module_exit }, > - { i915_objects_module_init, i915_objects_module_exit }, > - { i915_request_module_init, i915_request_module_exit }, > - { i915_scheduler_module_init, i915_scheduler_module_exit }, > - { i915_vma_module_init, i915_vma_module_exit }, > - { i915_mock_selftests, NULL }, > - { i915_pmu_init, i915_pmu_exit }, > - { i915_register_pci_driver, i915_unregister_pci_driver }, > - { i915_perf_sysctl_register, i915_perf_sysctl_unregister }, > + { .init = i915_check_nomodeset }, > + { .init = i915_active_module_init, > + .exit = i915_active_module_exit }, > + { .init = i915_buddy_module_init, > + .exit = i915_buddy_module_exit }, > + { .init = i915_context_module_init, > + .exit = i915_context_module_exit }, > + { .init = i915_gem_context_module_init, > + .exit = i915_gem_context_module_exit }, > + { .init = i915_objects_module_init, > + .exit = i915_objects_module_exit }, > + { .init = i915_request_module_init, > + .exit = i915_request_module_exit }, > + { .init = i915_scheduler_module_init, > + .exit = i915_scheduler_module_exit }, > + { .init = i915_vma_module_init, > + .exit = i915_vma_module_exit }, > + { .init = i915_mock_selftests }, > + { .init = i915_pmu_init, > + .exit = i915_pmu_exit }, > + { .init = i915_register_pci_driver, > + .exit = i915_unregister_pci_driver }, > + { .init = i915_perf_sysctl_register, > + .exit = i915_perf_sysctl_unregister }, > }; > static int init_progress; > > -- > 2.30.2 > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch