Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp1447177pxy; Mon, 2 Aug 2021 01:37:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxBemCNVw3oBhigANduCogu/jagnivJcnbUOyIANTDdxpBsgnMkMxAeLONt9nAUlcmk1huI X-Received: by 2002:a05:6602:5de:: with SMTP id w30mr619708iox.199.1627893421686; Mon, 02 Aug 2021 01:37:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627893421; cv=none; d=google.com; s=arc-20160816; b=KAOeINTKGe0vSWLCsD4PU8Kj49bi4cdnt0ZiaoAaG6IHygwzgNB2regZPylSkbsX02 dD4/M+dViNuH+fOZmmhtTVEFqk+bvLXMwxkOYxuuDvmsjAE2JUx6l8PjbBIWX6OfPTud 6tal8Lphd8xTsrJwusyvNHhCt5ku8HFBshfffej9mG60Su7j4qGU3lI3rbEJN+lFSwY1 TTahJzN0l3gf/vCl88ZFP0Hkoeftk6ECHPXvnOacZMRacEGKvnF9cAlMZRrTFNImjJDZ mYGAuoESruacLFk1JLQK/gjUUOUkunNgC7PhfEPqdE3zPClykUQ/Gzi36NCBph1tdsyT SdTA== 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=ZuS3B5M9Atb/+iW+i2TfKWtpc3UYcTbW2ZjKSEQfLfM=; b=Fy0DSjZPGB9FHkVXQHtBhaA7B89FuCO4mqMnehExPqcx+R3fowtikd0x0w3iecO/kQ qM2vDorvsDAttCYo/aveuVqbCPnIV9C5O64KomjMMHgWiWN9u6woI4fE6rCjJ2IB4n/k zxWo9v+DpPlAhSINAa/TNJuvrDXSnG/G4nvmlGCh0y3d5Gh7sHHiK4DzniEcSXYYgzUc YArvbrlWmvrIAeiFz/kG5HVtS4fr3vAtFgYYj5l6hVnxp9xE9JKBGsTkgC3bjwjRe5gq h4DlMTD+vNuehU6D97vFaDFVwppZpm+D+jb2oObsM2tyB3ZtuIbK6sdY6mXo0HPFAxn7 JJ8w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-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 v19si12400831jat.76.2021.08.02.01.36.50; Mon, 02 Aug 2021 01:37:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-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-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232842AbhHBIgA (ORCPT + 99 others); Mon, 2 Aug 2021 04:36:00 -0400 Received: from smtprelay0128.hostedemail.com ([216.40.44.128]:43994 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232799AbhHBIf7 (ORCPT ); Mon, 2 Aug 2021 04:35:59 -0400 Received: from omf12.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay04.hostedemail.com (Postfix) with ESMTP id 67A71180A7FE9; Mon, 2 Aug 2021 08:35:49 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf12.hostedemail.com (Postfix) with ESMTPA id F04A024023B; Mon, 2 Aug 2021 08:35:47 +0000 (UTC) Message-ID: Subject: Re: [PATCH 2/2] rtlwifi: rtl8192de: make arrays static const, makes object smaller From: Joe Perches To: Colin King , Ping-Ke Shih , Kalle Valo , "David S . Miller" , Jakub Kicinski , linux-wireless@vger.kernel.org, netdev@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Date: Mon, 02 Aug 2021 01:35:46 -0700 In-Reply-To: <20210731124044.101927-2-colin.king@canonical.com> References: <20210731124044.101927-1-colin.king@canonical.com> <20210731124044.101927-2-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-Spam-Status: No, score=1.84 X-Rspamd-Server: rspamout04 X-Rspamd-Queue-Id: F04A024023B X-Stat-Signature: phr4y8pb9rudtjkroxy4dhqhgh7x1pp5 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX18CUAd1kqMqv9Dylht6+9ZozDbNCxg9Scw= X-HE-Tag: 1627893347-499552 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Sat, 2021-07-31 at 13:40 +0100, Colin King wrote: > From: Colin Ian King > > Don't populate arrays the stack but instead make them static const > Makes the object code smaller by 852 bytes. [] > diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c [] > @@ -1354,7 +1354,7 @@ static void _rtl92d_phy_switch_rf_setting(struct ieee80211_hw *hw, u8 channel) > ? > > ?u8 rtl92d_get_rightchnlplace_for_iqk(u8 chnl) > ?{ > - u8 channel_all[59] = { > + static const u8 channel_all[59] = { > ? 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, > ? 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, > ? 60, 62, 64, 100, 102, 104, 106, 108, 110, 112, > @@ -3220,7 +3220,7 @@ void rtl92d_phy_config_macphymode_info(struct ieee80211_hw *hw) > ?u8 rtl92d_get_chnlgroup_fromarray(u8 chnl) > ?{ > ? u8 group; > - u8 channel_info[59] = { > + static const u8 channel_info[59] = { > ? 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, > ? 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, > ? 58, 60, 62, 64, 100, 102, 104, 106, 108, These two arrays (channel_info and channel_all) are identical but laid out differently and could be combined and use a single name.