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=-6.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 9D7B1C4361B for ; Wed, 9 Dec 2020 11:06:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5773B23406 for ; Wed, 9 Dec 2020 11:06:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730452AbgLILGI (ORCPT ); Wed, 9 Dec 2020 06:06:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:58548 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730371AbgLILFw (ORCPT ); Wed, 9 Dec 2020 06:05:52 -0500 X-Gm-Message-State: AOAM532FxAIWtrz3GcSyx8ySr6w4NVRAuNl3+Yw2/Go2Qoxe4JcouzN2 jqzgKGpF1/Qt2pg2OT7C4FHzxSyrQmnmPBquyy8= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1607511910; bh=iHRngC0ANhFxQ/UVZdui4aIYpUOkA29G/4HhBsdC2io=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=R3Dmty8vAYJKDiZUPF1JhJ/fkjvu0FhjsyBn5KjqeSujEf6PHTNzyF+WXZ/w76xNg QS+fe+Efir3U1mO7MR1r5psbffnGBO/51pjVdNN2MbZ3G5h5uUNQIx+KsGYuw5KtWU vW0zaQr7ETLlHN8lNEGbzDZ+z543kEozSdv2WDChe55Pnmgrr37nJBqHI6WqI6SHPq y99YomOV0Dk9i8y21F7gJ8XLaIifIlWXOG/j1puForpugoXaf3ekzTHrhVQamBLSfh bjhCYQDhx0hHgqM5nOmG5LstUgXtDzlYhZlc6Bup6iZS5Yo5Rl8C0XFMbjw3hBPKaW ntlLsccWVXYJA== X-Google-Smtp-Source: ABdhPJw4nzqzhKDzwtsLZDLztoFI6ZeiCH2UTXAydkS35zR5J+dVfmgmICP5TGbv6BtesRfz9ElkAS+JEn2VttiomRY= X-Received: by 2002:a9d:7a4b:: with SMTP id z11mr1211764otm.305.1607511909951; Wed, 09 Dec 2020 03:05:09 -0800 (PST) MIME-Version: 1.0 References: <20201208164821.2686082-1-paul@crapouillou.net> <20201208164821.2686082-2-paul@crapouillou.net> In-Reply-To: From: Arnd Bergmann Date: Wed, 9 Dec 2020 12:04:53 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/2] pinctrl: ingenic: Only support SoCs enabled in config To: Daniel Palmer Cc: Paul Cercueil , Linus Walleij , od@zcrc.me, linux-arm-kernel , "open list:BROADCOM NVRAM DRIVER" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 9, 2020 at 11:13 AM Daniel Palmer wrote: > > Hi Paul and others, > > Sorry to hijack this but I actually want to do something similar to > this in some other drivers. > The targets I'm working with have only 64MB of ram so I want to remove > code wherever possible. > Is there any reason to do it like this instead of wrapping the whole > unneeded of_device_id struct in an #ifdef? > For example there is a rule that the compatible strings have to be > present even if the driver isn't usable or something? No, there is no such rule, but adding lots of #ifdef checks in this file would be much less readable and more error-prone, as you'd have to make sure the two #ifdef blocks around the structure match the one for the ID table, and any function that is called by more than one SoC has the correct combination of A || B || D checks, and nobody ever gets that right. Arnd 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=-4.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 04FC1C433FE for ; Wed, 9 Dec 2020 11:06:24 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 7B4EF233EA for ; Wed, 9 Dec 2020 11:06:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7B4EF233EA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=527vDkSSarfZ+Kad+urYbnQc9Rihs6gz3QbyxQ1+55Q=; b=rl30vt4Kbc190S6HkHpJW/juV BFJicChZDU2vGd+QxyYlTIFEBZ5+a9XqofggVJ8v84zQzrpE4NQwm4zD77ohOfizXKb6poLeZcADo DA+QTSi/c/Ce9lbKZxY9m3em5gtKwku142Nhv38nFFXV0iQB8nLgx/oZWxEBIBuZN/sc9fVLSM4F8 pf6Psf7sR9p9AQPvhWVv4CzxCzSvFq7doHmwI28QXPza4Rd6cn3CrAK0lS53Esg1+CzKpy6sjrVG9 i41fAjw7vCVTc41rU+xtsq6MCqv74m5nBbO89elLcjAe7P6+0aPxvghINaTiCAwTkShDgElN3UQDT JDgCHRW6A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kmxHY-0004mR-84; Wed, 09 Dec 2020 11:05:16 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kmxHT-0004kl-S9 for linux-arm-kernel@lists.infradead.org; Wed, 09 Dec 2020 11:05:12 +0000 X-Gm-Message-State: AOAM53197Uvl5pFqIh0oONKmR7E8rc6T0bgbH1GS7njiAZm4eVJov9oz BvwFmNhwLh8pXHxva2QrrvDi3ezyOMss9loj+Io= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1607511910; bh=iHRngC0ANhFxQ/UVZdui4aIYpUOkA29G/4HhBsdC2io=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=R3Dmty8vAYJKDiZUPF1JhJ/fkjvu0FhjsyBn5KjqeSujEf6PHTNzyF+WXZ/w76xNg QS+fe+Efir3U1mO7MR1r5psbffnGBO/51pjVdNN2MbZ3G5h5uUNQIx+KsGYuw5KtWU vW0zaQr7ETLlHN8lNEGbzDZ+z543kEozSdv2WDChe55Pnmgrr37nJBqHI6WqI6SHPq y99YomOV0Dk9i8y21F7gJ8XLaIifIlWXOG/j1puForpugoXaf3ekzTHrhVQamBLSfh bjhCYQDhx0hHgqM5nOmG5LstUgXtDzlYhZlc6Bup6iZS5Yo5Rl8C0XFMbjw3hBPKaW ntlLsccWVXYJA== X-Google-Smtp-Source: ABdhPJw4nzqzhKDzwtsLZDLztoFI6ZeiCH2UTXAydkS35zR5J+dVfmgmICP5TGbv6BtesRfz9ElkAS+JEn2VttiomRY= X-Received: by 2002:a9d:7a4b:: with SMTP id z11mr1211764otm.305.1607511909951; Wed, 09 Dec 2020 03:05:09 -0800 (PST) MIME-Version: 1.0 References: <20201208164821.2686082-1-paul@crapouillou.net> <20201208164821.2686082-2-paul@crapouillou.net> In-Reply-To: From: Arnd Bergmann Date: Wed, 9 Dec 2020 12:04:53 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/2] pinctrl: ingenic: Only support SoCs enabled in config To: Daniel Palmer X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201209_060512_003480_FEB3584D X-CRM114-Status: GOOD ( 16.83 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linus Walleij , "open list:BROADCOM NVRAM DRIVER" , Linux Kernel Mailing List , Paul Cercueil , od@zcrc.me, linux-arm-kernel 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 Wed, Dec 9, 2020 at 11:13 AM Daniel Palmer wrote: > > Hi Paul and others, > > Sorry to hijack this but I actually want to do something similar to > this in some other drivers. > The targets I'm working with have only 64MB of ram so I want to remove > code wherever possible. > Is there any reason to do it like this instead of wrapping the whole > unneeded of_device_id struct in an #ifdef? > For example there is a rule that the compatible strings have to be > present even if the driver isn't usable or something? No, there is no such rule, but adding lots of #ifdef checks in this file would be much less readable and more error-prone, as you'd have to make sure the two #ifdef blocks around the structure match the one for the ID table, and any function that is called by more than one SoC has the correct combination of A || B || D checks, and nobody ever gets that right. Arnd _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel