Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp592910pxb; Thu, 19 Aug 2021 06:54:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+OWAAi+7fbBO0ZRoi3IG+It61/iI+aPOdbprsg2tg1E1yfEjhCfoRzzpmdA9ohY87IGaU X-Received: by 2002:a17:906:2305:: with SMTP id l5mr16062617eja.72.1629381254326; Thu, 19 Aug 2021 06:54:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629381254; cv=none; d=google.com; s=arc-20160816; b=YyPaJE8tF0BxtENm9sQjHmZ6IbqNRxCMSR5FAgXjBnvpQu1L/SmQo5sWa7LWSzxtJ5 /jcciCgLfPMlXwnT4Tb/Bf6gMX02VETGGe3Yi+bfS0qFStmxKb6Us9GmBaMHMO5/e3Av h+1w+UXgU1YBk1GWRH6yES0YMFROCzNmZ707YMubHqFTaNdXN+71RqbFJrqj5bpha3Ym eUd14SrQjZ1USqebh37BS/oRqjm8ShxeE7cpyKIq4+z6LMhkg+tebKy43/0BsVM5Nuj5 u0/0QRy6nxqd0KtQTr29pRU0+EGCZj84OesKxnTPFbzivozmgQku7tPJmsKKmoW1F0v4 OoBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=AmzzjqVB7N737yFuViQ4Omwqha8fE7NEJgEwRSwRt3U=; b=cQKb5rPAAAaYxOWHeEmyERTm4ZAG6UPQZn4cYPeBVXh39tLBbMGdzyZgvkxoKJVFeR FPUDwAdRo37ffM1C1vrmuD9OsbWSJQogHmUl5s+gstYV5sZShfXwwnMiydcuRrfuoCv6 MzUoZ6ahJ8IZjWTLdikksmaFYMnp+LfxNKzMINCgtg4S3RsEEOjdvIH4Jyn1fUBipRGT U4d2V2EO8ZiGpJ+M0XDqxb8+UKcfPz1kPXJy04Up94+58xu0sF14ecPMzduN84YprfaJ i7kAI2fqReDImfD1gacYUMjmvfUOagJF3lpugEna5+N1xlpej9hrZDRJdDNrLrGc2+j7 Rujg== ARC-Authentication-Results: i=1; mx.google.com; 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 dr8si4227329ejc.307.2021.08.19.06.53.45; Thu, 19 Aug 2021 06:54:14 -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; 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 S240141AbhHSNwE (ORCPT + 99 others); Thu, 19 Aug 2021 09:52:04 -0400 Received: from smtprelay0211.hostedemail.com ([216.40.44.211]:46198 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S238498AbhHSNwD (ORCPT ); Thu, 19 Aug 2021 09:52:03 -0400 Received: from omf01.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay04.hostedemail.com (Postfix) with ESMTP id D56531801BD9B; Thu, 19 Aug 2021 13:51:26 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf01.hostedemail.com (Postfix) with ESMTPA id ED88A17276; Thu, 19 Aug 2021 13:51:24 +0000 (UTC) Message-ID: <0a2ea4e54d7bfd61b45cc070eee6b62e8da82190.camel@perches.com> Subject: Re: [PATCH] drm/bridge/tc358767: make the array ext_div static const, makes object smaller From: Joe Perches To: Colin King , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Date: Thu, 19 Aug 2021 06:51:23 -0700 In-Reply-To: <20210819133839.10745-1-colin.king@canonical.com> References: <20210819133839.10745-1-colin.king@canonical.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.40.0-1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspamout01 X-Rspamd-Queue-Id: ED88A17276 X-Spam-Status: No, score=1.31 X-Stat-Signature: xtq9wskgg9q5yk38hqm1ujdryh91ffcd X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX18LudW2irYBHTNEvn3FXoPtQaMsnxKJhc4= X-HE-Tag: 1629381084-16190 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2021-08-19 at 14:38 +0100, Colin King wrote: > From: Colin Ian King > > Don't populate the array ext_div on the stack but instead it > static const. Makes the object code smaller by 118 bytes: > > Before: > ???text data bss dec hex filename > ??39449 17500 128 57077 def5 ./drivers/gpu/drm/bridge/tc358767.o > > After: > ???text data bss dec hex filename > ??39235 17596 128 56959 de7f ./drivers/gpu/drm/bridge/tc358767.o Why is text smaller and data larger with this change? > > (gcc version 10.3.0) > > Signed-off-by: Colin Ian King > --- > ?drivers/gpu/drm/bridge/tc358767.c | 2 +- > ?1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c > index 23a6f90b694b..599c23759400 100644 > --- a/drivers/gpu/drm/bridge/tc358767.c > +++ b/drivers/gpu/drm/bridge/tc358767.c > @@ -468,7 +468,7 @@ static int tc_pxl_pll_en(struct tc_data *tc, u32 refclk, u32 pixelclock) > ? int div, best_div = 1; > ? int mul, best_mul = 1; > ? int delta, best_delta; > - int ext_div[] = {1, 2, 3, 5, 7}; > + static const int ext_div[] = {1, 2, 3, 5, 7}; > ? int best_pixelclock = 0; > ? int vco_hi = 0; > ? u32 pxl_pllparam;