From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B84C1CDB474 for ; Tue, 17 Oct 2023 05:28:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 32D5410E096; Tue, 17 Oct 2023 05:28:20 +0000 (UTC) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by gabe.freedesktop.org (Postfix) with ESMTPS id DE5EF10E096; Tue, 17 Oct 2023 05:28:18 +0000 (UTC) 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" Content-Type: text/plain Subject: Re: [Intel-gfx] [PATCH] drm/i915/mtl: avoid stringop-overflow warning X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Matt Roper , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Daniel Vetter , Rodrigo Vivi , Dave Airlie Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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