Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp18916346rwd; Wed, 28 Jun 2023 02:26:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4ex4TXdDSn9cHPkq3wUGkz1zYWkyvhOx6g3wL2M6AMDrOQA5R+UyofBbPLHmRh/GMO/Ztr X-Received: by 2002:aa7:d749:0:b0:51d:b7a4:1106 with SMTP id a9-20020aa7d749000000b0051db7a41106mr838041eds.12.1687944361700; Wed, 28 Jun 2023 02:26:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687944361; cv=none; d=google.com; s=arc-20160816; b=Z5D8/X7ZUQ6sikpv6umxXp9VTArDFrPFVne1JNxmUQPwMWvaEgF3f71Li29b/IZInx u7agSE0i9vxdOL+mjX8woFfse3toMueH/o8A4wKtcvAp55PK0EnRc3rOgh1aEKUBG6FV /WTN91fGbhhLYZn88NbU0e17FwgtZG8Q3JdVG1jyuxYkTsSCLLGruH5dEeGeDswcTFjs r85qsd5+ZL8MlS9d+yJXsTczEG4EqLOz7Nwf7sGotFa7M+zBhpv49FZ5Yyr5nY/piH0R 5gg7WwannSYbs6GokOwOaTgTlY14lx5BVr0Q+h5VjkG9/uv4+lieWF6PO0PdvT2tr2US gGHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :organization:in-reply-to:subject:cc:to:from:dkim-signature; bh=B3GmPmmy9WcBDgjUjZOF3VAN/zwwdh8LBVgyWOCzK0M=; fh=47aMlgzaykXZO0zg5G+L+7d6u2dKMx/PxFdlCnbTPsM=; b=w9a00iKmN+9rKHVNSJkptQgKOMx9ipE5ei5udRIuOxLfUDlfTUt3Wl+2S6E+mvkAjH Wx3fj315AjNsFN5ybsMIiKyKXOZqrOrjBwSxR6f06iDlYk35ftJvVJB+5IYyme7UQfds dYYokVetwz2cp0w1gT4yFhTVvef0YyJ13vG8gho3VxqtthhFcRPVJoP6bgdCpHcnrLAS 2aA8ixwhTIoBW+o2dG9cH9rJEd3eEMa2rt6rJyrpxHzJhQ6RHR3b9PuyQKAJVOCtS5ZB cYENP96bTmHHP83VEAg7G06Exn6wrMQOFZSbf7eKjfdDVPFVeGgXlZZf5Nw/1/Lu3W4O UX4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=dY5fQYXU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z9-20020aa7cf89000000b0051a3702d11fsi4945558edx.621.2023.06.28.02.25.37; Wed, 28 Jun 2023 02:26:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=dY5fQYXU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235546AbjF1IhO (ORCPT + 99 others); Wed, 28 Jun 2023 04:37:14 -0400 Received: from mga04.intel.com ([192.55.52.120]:39906 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234476AbjF1Idw (ORCPT ); Wed, 28 Jun 2023 04:33:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1687941232; x=1719477232; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=BXkseK/7Ha+I5qFw0bg5W7x6wKpug2h9qv3tmbroptE=; b=dY5fQYXUHKNGtQw6TWceHifBgT75dJByEOaXUlDkWKUmjgk0KIINYcBz N6sdV8ZzZxARUPiygb6IEe+4lpuTw5owiBBaRhiTBsBSsEW7APfPCE7il h6Kl5ff2tDq52bCcepW/u7QmoEOqCTQ19H8jRCrI0YJeFFSNRRDToUcaB pXit2FjkbGBrl637j6NZsyFOhxrkRLp01Bj566CkCJdqMzswzXL7osPqp ZffZG9hhJ7moGfSj1lseJPMpTFfWeaTVVszGwnm+L8XOmzC2NSw8S9jE8 y9jp9LR4wtRjpeLE2oB5JqDCzbsbCw7xVsaOQKPtNqnE/CJyQIVhfqwQJ w==; X-IronPort-AV: E=McAfee;i="6600,9927,10754"; a="360637123" X-IronPort-AV: E=Sophos;i="6.01,165,1684825200"; d="scan'208";a="360637123" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jun 2023 01:25:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10754"; a="840980913" X-IronPort-AV: E=Sophos;i="6.01,165,1684825200"; d="scan'208";a="840980913" Received: from lzhiguno-mobl.ger.corp.intel.com (HELO localhost) ([10.252.63.165]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jun 2023 01:25:44 -0700 From: Jani Nikula To: Colin Ian King , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH][next] drm/edid: make read-only const array static In-Reply-To: <20230627170109.751829-1-colin.i.king@gmail.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20230627170109.751829-1-colin.i.king@gmail.com> Date: Wed, 28 Jun 2023 11:25:26 +0300 Message-ID: <87ttusro21.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 27 Jun 2023, Colin Ian King wrote: > Don't populate the const array on the stack, instead make it static. > > Signed-off-by: Colin Ian King Thanks, pushed to drm-misc-next. > --- > drivers/gpu/drm/drm_edid.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c > index e0dbd9140726..39b13417b749 100644 > --- a/drivers/gpu/drm/drm_edid.c > +++ b/drivers/gpu/drm/drm_edid.c > @@ -3962,7 +3962,7 @@ static int drm_cvt_modes(struct drm_connector *connector, > struct drm_display_mode *newmode; > struct drm_device *dev = connector->dev; > const struct cvt_timing *cvt; > - const int rates[] = { 60, 85, 75, 60, 50 }; > + static const int rates[] = { 60, 85, 75, 60, 50 }; > const u8 empty[3] = { 0, 0, 0 }; Side note, this could be removed by replacing if (!memcmp(cvt->code, empty, 3)) with if (!memchr_inv(cvt->code, 0, 3)) or even if (!cvt->code[0] && !cvt->code[1] && !cvt->code[2]) BR, Jani. > > for (i = 0; i < 4; i++) { -- Jani Nikula, Intel Open Source Graphics Center