Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2941350rdg; Mon, 16 Oct 2023 22:28:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE4AJt3SG05/LFxxlrw7zQAu2jY2q3M0aNbG4boQumrAghgYu91VKLH1D1DXvXf1E9x0pi1 X-Received: by 2002:a05:6359:4296:b0:139:c75f:63eb with SMTP id kp22-20020a056359429600b00139c75f63ebmr1467338rwb.21.1697520516413; Mon, 16 Oct 2023 22:28:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697520516; cv=none; d=google.com; s=arc-20160816; b=AUpDQ5kFkN0ym1VkJ+eDSkr/YLXfja95g8Tvx3Y0fzRLOGkDMA4yn8lY3KxwjI2bRU FRlAc8r6ixqGvRf0+t6+DNR5zsVaYrGnfGl0Gv+Ww7oPDf0GAvwcP71v2jlSDIczEY34 90idLerb9msqxujo3iZJoIaZEnv+wUtlAubM4NwTeY9y9FnfNvtCXrQH7nYSEZQHRz3c DyxJy01caRhEhhkVbKNTOUMIV83NzI/czy8R7Os4CVcS+sqdBK7dPHeF0yYRjLFZ2r5Y tb4I8O6dtkEJFq8l55lSkJvk00c0HGnRwaPeFjUxE52R0dGzFZoBhgScR1iRb4w13Ayz VTQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:references:in-reply-to :message-id:mime-version:user-agent:feedback-id:dkim-signature :dkim-signature; bh=wLHP+Qz8LerU3OeWBpyC5y5t5EdW0tB4tzStnDJPFtI=; fh=6zqC6jwmzDRQnT4XhQ98lKRuluOIycWHJZzrTpJ17DA=; b=Ys75PVHUoMemJMV0UELEvjYvNmU47yzFryG99jQ1D/USixqurp0V0IwoH/3WmcP3dk xjlrle/OEukojJ9BDLgSA5OjV56Yfzc63TaEeAOTKK5YN3ZSlhi8JgCiy/CPzQg4fi1z pfNbIYPa763fyhTOoBG27Qja1jgmFKUUPtCmSAyG81Qfu+ELg1cLCUaT1TU0g4uhV6YW vN2Yg/ujYGoDX4LjraH7bKxjE+1SXcJjvHTo1Qj1LbkgmS/JqAJWzuTW7W9rDJhONj08 Ax+ZHLwFX3uVB2OwYw31WqPZVqQcWEoSWlSEunyDeYzOzz8PYQ3TRA9jBT54kTZNPGUw OUjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm2 header.b=M8K0zK+H; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=QdG9wYc2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id b7-20020a62cf07000000b00690258a9766si830368pfg.373.2023.10.16.22.28.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 22:28:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm2 header.b=M8K0zK+H; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=QdG9wYc2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 3681B80924B4; Mon, 16 Oct 2023 22:28:30 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233862AbjJQF2W (ORCPT + 99 others); Tue, 17 Oct 2023 01:28:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233654AbjJQF2V (ORCPT ); Tue, 17 Oct 2023 01:28:21 -0400 Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F3CFF1 for ; Mon, 16 Oct 2023 22:28:20 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id B4F0A5C022F; Tue, 17 Oct 2023 01:28:17 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute5.internal (MEProxy); Tue, 17 Oct 2023 01:28:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1697520497; x=1697606897; bh=wL HP+Qz8LerU3OeWBpyC5y5t5EdW0tB4tzStnDJPFtI=; b=M8K0zK+H0tq9hHhm5m lyVB8xlP+WOypWt5XdK/WsMgB20W/+vdRYLIk6a9f0WstfXbIzcI3qtuLFTphEwG Di5YWQB85/cha9PlMGG1kZJduTrlrHil/m20uXAQhdBEwOXXXbzmKEb6QV3EGLTt HzRl32yiPs2rR0z4nMNEql668IZK05HItfN9re7l3Hxd3uXwvopQK58dKxBD1UOL zviPXlCLWphrDtZAW0FaicrmAtqeC0f7wAPObyBHOdLxnWmS1dw3/uS/ritgnuHK 2Xc7csKtJWfJupFl06D8DX4a8cqQR6GQrZSA1EPk4W2EK40z/DHfKuH+vzxmt/48 Ltqg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1697520497; x=1697606897; bh=wLHP+Qz8LerU3 OeWBpyC5y5t5EdW0tB4tzStnDJPFtI=; b=QdG9wYc2YXKhUUrlp7UkAJ3cMP1P9 HoodHnsLVXQZf3Ws9FQujtIEe1yCuRewRCpWq+/rRK01yXpDu4dto7KMfSN2Tw9l dblqRg1Ib/7JIq4UjHBs0tyUHBH8VBgKWWQ+7bf+n7shZ6zk/9T1QeYGNtByCk0y vEXivOeyw0OpZip3roucrls8HQEn0UdQZFaXd92Khh7toC1FGhCFTaZtsd1WJz4h JTYQ0yw1TGXEkPB54/KDnnC00EJ3paZ7vlPKsl+ov22/nBONgGnzvTFskjejVIog lUHO+qD8sPOh5JvBJUEEXONaVmhpJJSycso3dyYy0S/5mCSa6AzyiPKOw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrjedugdelgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvvefutgesthdtredtreertdenucfhrhhomhepfdetrhhn ugcuuegvrhhgmhgrnhhnfdcuoegrrhhnugesrghrnhgusgdruggvqeenucggtffrrghtth gvrhhnpeffheeugeetiefhgeethfejgfdtuefggeejleehjeeutefhfeeggefhkedtkeet ffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrrh hnugesrghrnhgusgdruggv X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 4BB9AB60089; Tue, 17 Oct 2023 01:28:17 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-1019-ged83ad8595-fm-20231002.001-ged83ad85 MIME-Version: 1.0 Message-Id: In-Reply-To: References: <20231016201012.1022812-1-arnd@kernel.org> Date: Tue, 17 Oct 2023 07:27:56 +0200 From: "Arnd Bergmann" To: "Andi Shyti" , "Arnd Bergmann" Cc: "Jani Nikula" , "Joonas Lahtinen" , "Rodrigo Vivi" , "Tvrtko Ursulin" , "Dave Airlie" , "Daniel Vetter" , "Badal Nilawar" , "Ashutosh Dixit" , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, "Matt Roper" Subject: Re: [Intel-gfx] [PATCH] drm/i915/mtl: avoid stringop-overflow warning Content-Type: text/plain X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Mon, 16 Oct 2023 22:28:30 -0700 (PDT) On Tue, Oct 17, 2023, at 00:10, Andi Shyti wrote: > Hi Arnd, > >> static void rc6_res_reg_init(struct intel_rc6 *rc6) >> { >> - memset(rc6->res_reg, INVALID_MMIO_REG.reg, sizeof(rc6->res_reg)); > > This is a complex initialization, indeed... how about just > > memset(rc6->res_reg, 0, sizeof(rc6->res_reg)); > >> + i915_reg_t res_reg[INTEL_RC6_RES_MAX] = { >> + [0 ... INTEL_RC6_RES_MAX - 1] = INVALID_MMIO_REG, >> + }; > > This is basically a > > i915_reg_t res_reg[INTEL_RC6_RES_MAX] = { }; > > Don't know which one is clearer. Right, the original code went out of its way to use INVALID_MMIO_REG instead of assuming it is zero, so I tried to preserve that for consistency. Arnd