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 X-Spam-Level: X-Spam-Status: No, score=-5.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 74684C433ED for ; Wed, 5 May 2021 19:43:34 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E85F6613BA for ; Wed, 5 May 2021 19:43:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E85F6613BA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=canonical.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=aDv5zpUZcUr/EQ6mwwCl6+KOMiwQ+mlim8y+QKcAj5g=; b=Snhltv0gHq5KZCIpsrnBXs2Dd vS6umz3kf8fHNLT80u1MGBHtCuFSXCTAq25NCBEhRRYw9y+or2VWj72HK1o9h8r2eg4h4d68/+cN0 hc6Q1hzkB1Q2HDHSC8Pdl+jCF56IYb3jZ8gowl89nWNCkrpNSmRkosOkJKNz3Sy5mN5H9hWW2FdX/ 45EKZu6HoVSKPSZ4OMUGWM12FHC9Zr10usdtRuhX7srF5slrwHpwU5hCMfWxBl7YR3Mzh4ka+LYky TO3WXZy+ltI5DbLOprStqLseS1HwzbED3jdP3KPmgg/NJJVERlos2iqRCVwTLh7SUJwAtBGP0ETeB NSxRQaLpQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1leNP1-002Aft-Ki; Wed, 05 May 2021 19:41:48 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1leNOy-002AfD-Ru for linux-arm-kernel@desiato.infradead.org; Wed, 05 May 2021 19:41:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To: Subject:Sender:Reply-To:Content-ID:Content-Description; bh=KMfcNsjXlZ+tgGRkWqvnbenP9g4xeEBy1YBavjn3OpA=; b=U/DTLSaYzPLupEOiv52H6rD2Ur Az3UfkFeipFy+xEWLAg0tCIXsFgTzBX5d9s0yGaaiOa4pDNgkwxpSIHettfYNfM8cIgV7snL37cL/ YAFlinuSh9NzhQNc22RYW17RmWR0DOT4T8ERl4eqCc8eAUmf3H8shJJmZxSDGxxv1TxNQEidJRbp4 sftLDSsdP7lls5tuAPFANV73be9Wl75+SjlzyB4DomCS9glxGrQPdkPWWQfY5gBXiqYZ3tTToq20m KFmpevAGyA5HNA+W2k9yuK3RRbhHecLqbPo+0bUHX1CJL5i/zux/IfsQ3J3MijnJe3k8sFMRhTkzL hKXTLjmw==; Received: from youngberry.canonical.com ([91.189.89.112]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1leNOw-005Cwb-AM for linux-arm-kernel@lists.infradead.org; Wed, 05 May 2021 19:41:43 +0000 Received: from mail-qv1-f71.google.com ([209.85.219.71]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1leNOt-00038y-13 for linux-arm-kernel@lists.infradead.org; Wed, 05 May 2021 19:41:39 +0000 Received: by mail-qv1-f71.google.com with SMTP id c5-20020a0ca9c50000b02901aede9b5061so2443865qvb.14 for ; Wed, 05 May 2021 12:41:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=KMfcNsjXlZ+tgGRkWqvnbenP9g4xeEBy1YBavjn3OpA=; b=H9zqfIf7swOB+VTZH7uMggBBHvcOHqT/7FljIjieBpf3KR46ZIqK/4CU3diK1bTs65 Nnms6GtLZNxCHUWaVc16gjV5dG+C3EqhubeDPmX21MnxHTpJskyfiOfqIByoKMwSYsbU OQvLUHrjlBJA990HJbkVCsJBleMumZ6lA8Rfh+E41mdXhUGVsfRXdn89JHOcZ1va7OxJ 2ta/D00oq/Nsfge7e2UGCSqzpuBaC8JeHcchjktICbmqaJapzFRIC0CKTPKLVTJODFei I4RG21d93g6lsVivglWG3FkKs8NL1+SuBKGYdmZh2iiFY2jGGzs7/R+9rldjRIZhtNt+ 9tVA== X-Gm-Message-State: AOAM531q8chER6BK2Wmxjule+4l9+63qkZ87jGc8DCm7WvN5jKDa27FM VSyey5hTvgLGxUlC7vwk3/bZrc92nI55X69G0qcKxQmZraKFEEsvU6JK7fGtwRWPeMwnlP7dBYx 0q4ZyCNJ6STGQBuXBJb29TG55avMBwkh8VSNT/gL4oAVtG8mEbBTL X-Received: by 2002:a05:620a:118a:: with SMTP id b10mr381186qkk.263.1620243698212; Wed, 05 May 2021 12:41:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjB1fkQLdzlaXKjnl6zTIgJDOAyEuudFSA92e4UuJZVegXPWitGuVebLofp0UL7pHqzFoZZg== X-Received: by 2002:a05:620a:118a:: with SMTP id b10mr381174qkk.263.1620243698062; Wed, 05 May 2021 12:41:38 -0700 (PDT) Received: from [192.168.1.4] ([45.237.49.2]) by smtp.gmail.com with ESMTPSA id e5sm172640qtg.96.2021.05.05.12.41.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 05 May 2021 12:41:37 -0700 (PDT) Subject: Re: [PATCH] scsi: ufs: ufs-exynos: make a const array static, makes object smaller To: Colin King , Alim Akhtar , Avri Altman , "James E . J . Bottomley" , "Martin K . Petersen" , linux-scsi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org References: <20210505190104.70112-1-colin.king@canonical.com> From: Krzysztof Kozlowski Message-ID: <0e90b057-3a87-bec5-c0b2-46c49b191651@canonical.com> Date: Wed, 5 May 2021 15:41:36 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <20210505190104.70112-1-colin.king@canonical.com> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210505_124142_386367_926BC95E X-CRM114-Status: GOOD ( 12.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 05/05/2021 15:01, Colin King wrote: > From: Colin Ian King > > Don't populate the const array granularity_tbl on the stack but instead it > static. Makes the object code smaller by 190 bytes: > > Before: > text data bss dec hex filename > 25563 6908 0 32471 7ed7 ./drivers/scsi/ufs/ufs-exynos.o > > After: > text data bss dec hex filename > 25213 7068 0 32281 7e19 ./drivers/scsi/ufs/ufs-exynos.o > > (gcc version 10.3.0) I am not sure what's the benefit here - you moved the code from text to data. In total you decreased the size for this compilation settings (e.g. compiler + optimizations) but that might not be always true, right? This has effect on the code readability - line is longer and reader would think "why this was made static since it is simple one-time const?". Best regards, Krzysztof _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel