From patchwork Wed Feb 23 19:46:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 12757470 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2ADEBC433F5 for ; Wed, 23 Feb 2022 19:47:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=K0EtHrWUT+643bd3vgguMjl/2MbMlJ2xFjOZl9pVL9o=; b=AnQj/GRFzJpl8w lz33x0RPUZ60rv8NBNk15fIfhhcBNezhLg9/qIIak79BsWZYkkRKeuUR8jQwcUdceMY0ehllUOFzy 3NWu16Ika4tSn80U2GcWXYo+Tzp8FZx2OMLZeT1SRIP/j3GkfplCmwlsOgrDyo9lskVfLpAyCFjCO emdQGvn6H324nRfB6R1VqUo2kdSYERtHpeuyS4N7Spjqwx9dEwLl5UQT/D6BUKBXijheKwrxNCCT/ azb8K3sKvYBi8eeidG1MLnqUk0qwZLsXzED4QvcX6Ip36EkpjsFHUIZjpICz1tRQB/nyyrA0W+PR6 ruscjraMWJi7zVaYGJpw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nMxb0-00Fv2s-8K; Wed, 23 Feb 2022 19:46:42 +0000 Received: from [2601:1c0:6280:3f0::aa0b] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nMxau-00Fv28-5h; Wed, 23 Feb 2022 19:46:36 +0000 From: Randy Dunlap To: linux-kernel@vger.kernel.org Cc: Randy Dunlap , Igor Zhbanov , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Russell King , linux-arm-kernel@lists.infradead.org, patches@armlinux.org.uk Subject: [PATCH] arm: mmu: fix returns from early_param() and __setup() functions Date: Wed, 23 Feb 2022 11:46:35 -0800 Message-Id: <20220223194635.4044-1-rdunlap@infradead.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org early_param() handlers should return 0 on success. __setup() handlers should return 1 on success, i.e., the parameter has been handled. A return of 0 would cause the "option=value" string to be added to init's environment strings, polluting it. ../arch/arm/mm/mmu.c: In function 'test_early_cachepolicy': ../arch/arm/mm/mmu.c:215:1: error: no return statement in function returning non-void [-Werror=return-type] ../arch/arm/mm/mmu.c: In function 'test_noalign_setup': ../arch/arm/mm/mmu.c:221:1: error: no return statement in function returning non-void [-Werror=return-type] Fixes: b849a60e0903 ("ARM: make cr_alignment read-only #ifndef CONFIG_CPU_CP15") Signed-off-by: Randy Dunlap Reported-by: Igor Zhbanov Cc: Uwe Kleine-König Cc: Russell King Cc: linux-arm-kernel@lists.infradead.org Cc: patches@armlinux.org.uk --- KernelVersion: v5.16 arch/arm/mm/mmu.c | 2 ++ 1 file changed, 2 insertions(+) --- next-2022-0222.orig/arch/arm/mm/mmu.c +++ next-2022-0222/arch/arm/mm/mmu.c @@ -212,12 +212,14 @@ early_param("ecc", early_ecc); static int __init early_cachepolicy(char *p) { pr_warn("cachepolicy kernel parameter not supported without cp15\n"); + return 0; } early_param("cachepolicy", early_cachepolicy); static int __init noalign_setup(char *__unused) { pr_warn("noalign kernel parameter not supported without cp15\n"); + return 1; } __setup("noalign", noalign_setup);