Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp632615pxb; Tue, 5 Apr 2022 16:39:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxIlTtLB4MR4KZPghoQ9o4j/LeuRDeC6FBbbFwrhHCLYtxdDrz4tfgaSJJheHZOAgDVJKF X-Received: by 2002:a17:90a:a509:b0:1ca:c48e:a795 with SMTP id a9-20020a17090aa50900b001cac48ea795mr6710921pjq.165.1649201954050; Tue, 05 Apr 2022 16:39:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649201954; cv=none; d=google.com; s=arc-20160816; b=MUC7KGnyvJqQVl6S8u0F5Bxv4hYHffmo9yFRXmAIreqUyCHeb7e+LDvdWEg3iKxr0s XvA7YuyPh9ZOxVTCWpXLWFzZCS0YTjhTnLXqF+VnTXlxyS+ela7CYXjG2vmB0QWb+YKB VeAKfbNq/kgLbXSc9OYTqU3F2oVw4MqWiMWwX170hs8rki/BD2sE75ilQSE83b6CJe0N kXVKuyv6KKYkQQuRlWJlDRxZpRHr837sAVCBTCsdlnc89cQWdXiCAh5uMdCSrZRXHoHM ifX7nPrN6sZ/0FntMZqP5ZC/3X6k+CD2Kj/Mc29PmrRleipdB2Y+evRr8TK4nBQtUd7C k6/A== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=/B0Ub2kaeYuxnxPa1GC7TjJxE6LDX/5EoyTmc6zsDZ0=; b=TQTgzzstNWcOqvPbPM5RbP5sL2ks1FUtsvPRNtvwGKnfgHmdlIZQoNwxBiXCTF4yWm aPtKnd0AopW685JM+A5gOD0AufDKZUuW+BlEtpcsTjWzELy1CMB9GgaiS3aE9ZMFzJCA ZY07TUCUxvOKIrHYo70hT4F02tr01eVpfIx5JoTesxTGsCGYOTOEoQVYnowogCT2hA7G 0SJZwk5UJ0vwirk9uDmLjWgfstCwXZru8Q8lW3VF3me+MUX83O7O9kpJgzr0K0LLzQgF 06lW9WXTEmpZr5Mgf0EOUTEJdN6JIxOUAghoic/kA4/rM8WjF0t3dXYkfUV+k0l3kMOT sEKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=p6owczWL; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id z14-20020a056a00240e00b004fa3a8dffb9si14388291pfh.112.2022.04.05.16.39.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 16:39:14 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=p6owczWL; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CBC311BE13E; Tue, 5 Apr 2022 16:23:40 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356377AbiDEMJx (ORCPT + 99 others); Tue, 5 Apr 2022 08:09:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244713AbiDEIwf (ORCPT ); Tue, 5 Apr 2022 04:52:35 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7EA5D1ADB1; Tue, 5 Apr 2022 01:42:38 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1E5306117A; Tue, 5 Apr 2022 08:42:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 30685C385A1; Tue, 5 Apr 2022 08:42:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649148157; bh=xMuBtpSMi0tR4uqVjAuMkRQrPn1kVymN+i1l75YiSig=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p6owczWL5EsFm6bVraEq3wf+fKmI95m/Jj7rsPLpDojV9mpUDDzs2lNIAqpmkk0KB /t0PBm/d98z8zdQNtd7jw6Imdq9rI61A1IhCTlMwg75QBQyqRtXla5mtQfxDXpz+s+ bGTA7J6+O7o9XyjUy4PxVj/1Gt47+fcNoJXppvxg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Randy Dunlap , Igor Zhbanov , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 5.16 0254/1017] clocksource: acpi_pm: fix return value of __setup handler Date: Tue, 5 Apr 2022 09:19:27 +0200 Message-Id: <20220405070401.802649863@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Randy Dunlap [ Upstream commit 6a861abceecb68497dd82a324fee45a5332dcece ] __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) environment strings. The __setup() handler interface isn't meant to handle negative return values -- they are non-zero, so they mean "handled" (like a return value of 1 does), but that's just a quirk. So return 1 from parse_pmtmr(). Also print a warning message if kstrtouint() returns an error. Fixes: 6b148507d3d0 ("pmtmr: allow command line override of ioport") Signed-off-by: Randy Dunlap Reported-by: Igor Zhbanov Link: lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- drivers/clocksource/acpi_pm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/clocksource/acpi_pm.c b/drivers/clocksource/acpi_pm.c index eb596ff9e7bb..279ddff81ab4 100644 --- a/drivers/clocksource/acpi_pm.c +++ b/drivers/clocksource/acpi_pm.c @@ -229,8 +229,10 @@ static int __init parse_pmtmr(char *arg) int ret; ret = kstrtouint(arg, 16, &base); - if (ret) - return ret; + if (ret) { + pr_warn("PMTMR: invalid 'pmtmr=' value: '%s'\n", arg); + return 1; + } pr_info("PMTMR IOPort override: 0x%04x -> 0x%04x\n", pmtmr_ioport, base); -- 2.34.1