From patchwork Mon Oct 3 20:24:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 12997766 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5012FC4332F for ; Mon, 3 Oct 2022 20:24:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229588AbiJCUYn (ORCPT ); Mon, 3 Oct 2022 16:24:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229597AbiJCUYl (ORCPT ); Mon, 3 Oct 2022 16:24:41 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 505CE2AE8; Mon, 3 Oct 2022 13:24:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:In-Reply-To:References; bh=JRXvgrD3pH5/cR8O4XMTwokUJc0cwbJcPUmd9Gahf4o=; b=n9fkPbywwKH2/jSKoFdzNPgLb/ 1cKaxJAhIjZafIsTDKcUygdaDj97mXI+qKCNObCFPEi4NtFdCuaJJg3pwnjVtmLsYzUASP9BHqnGA ueV3UTCeIRmaqxNqNLZerWYsqCL4aAXTHjILol81131nNbug2cMt8K47oA7hoZNk5wur5R2Y+cPx1 8uIxaHBzv+GrD4HHcq7iZMvqEgywMqBmEEDK7Q7mmp1UusDvdLht59qeynNREPBivbr8rCNeDQ7sg NyAHE9i3otyZTX40+8ZEAixl6xNkV77usWoBXirDTCMiIfWivf0dGJAu0lC7gS01+0T1D+ZcAI72H WYidAURw==; Received: from [2601:1c2:d80:3110::a2e7] (helo=casper.infradead.org) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1ofRzQ-00GdVD-Ux; Mon, 03 Oct 2022 20:24:37 +0000 From: Randy Dunlap To: linux-kernel@vger.kernel.org Cc: Randy Dunlap , Igor Zhbanov , Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org, Andrew Morton , stable@vger.kernel.org, Arnd Bergmann Subject: [PATCH v3] sh: nmi_debug: fix return value of __setup handler Date: Mon, 3 Oct 2022 13:24:25 -0700 Message-Id: <20221003202425.11130-1-rdunlap@infradead.org> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org __setup() handlers should return 1 to obsolete_checksetup() in init/main.c to indicate that the boot option has been handled. A return of 0 causes the boot option/value to be listed as an Unknown kernel parameter and added to init's (limited) argument or environment strings. Also, error return codes don't mean anything to obsolete_checksetup() -- only non-zero (usually 1) or zero. So return 1 from nmi_debug_setup(). Fixes: 1e1030dccb10 ("sh: nmi_debug support.") Signed-off-by: Randy Dunlap Reported-by: Igor Zhbanov Cc: Yoshinori Sato Cc: Rich Felker Cc: linux-sh@vger.kernel.org Cc: Andrew Morton Cc: stable@vger.kernel.org Cc: Arnd Bergmann --- v2: add more Cc's; refresh and resend; v3: add Arnd to Cc: list arch/sh/kernel/nmi_debug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/arch/sh/kernel/nmi_debug.c +++ b/arch/sh/kernel/nmi_debug.c @@ -49,7 +49,7 @@ static int __init nmi_debug_setup(char * register_die_notifier(&nmi_debug_nb); if (*str != '=') - return 0; + return 1; for (p = str + 1; *p; p = sep + 1) { sep = strchr(p, ','); @@ -70,6 +70,6 @@ static int __init nmi_debug_setup(char * break; } - return 0; + return 1; } __setup("nmi_debug", nmi_debug_setup);