Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp587335pxb; Tue, 5 Apr 2022 15:03:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJySRF3cgq67vR6Rz+eTWYwv1hKJbYWmdoaMoRW0KDHN9+NEtPZmMELwOTkY5kRVs1j7COYn X-Received: by 2002:a05:6a00:1341:b0:4fb:3292:bc82 with SMTP id k1-20020a056a00134100b004fb3292bc82mr5719409pfu.45.1649196219033; Tue, 05 Apr 2022 15:03:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649196219; cv=none; d=google.com; s=arc-20160816; b=Zwv0gbQj14rpO2FZ4kK/IUqke+dK4v1X+SUYWay1nIqscSGMCUnW2EFoJUcvdtA/jo w3y1Zg9rmCwuAzz+5HRSuUML5ptHGYAmGq8mqaqLA3JfJNz5Iyb9V4GzeiH1RbxoFC16 PXKQH3CyviY+ax9kSTZ79tMzA8KHQKvDprsffd4h5KB4W0BB8go8W4OGFCD7w7+6hDgg kvdkS/C8149hIkjo/ZzlPoeC5or2wIyljy+yNRjXSDQ3t+8UInNWZc1mf5aDrdsW4wtE M1CIwKH9GiP3W/DA0lkjGQLKqpffeuVEh58E/xJcSSrLXPh7khFECkF8F2o5UHw/kpqK Qu0Q== 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=AxG+W4LrKaqONBdJrlN8Li5ffG9FMlyGYCD3Dd6g/IIh/0JYkGgaz0+93CU150QynR d9SFKXUwgVuKVSihnj8/1NufG4RqP3hENRs1eaaDAYpVV6wvf7J47GVTEA6KwoFx0j/j mTHQ3ILbWIVLg5FdyXkMhUtZEMw6IJpTdkIvuRpHm0k6o+MYnGk0Ke1KvKHIyKzyD59z ZTglamdYbuXM1X8sBmYclo0qcaW3VGj7C9hgB49XuKq4d4fPWrEMYYCxafbp/NOsJSR/ +wpw7KQZoK8CWJm7R29zpbKQXFJqF+9GVbHamYQaer9qPsdq7i4QWVILXhFgxjEv0Xkm 1zdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nBWUqc2o; 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 m5-20020a654385000000b003816043efcdsi12938295pgp.450.2022.04.05.15.03.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 15:03:39 -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=nBWUqc2o; 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D47E32A71F; Tue, 5 Apr 2022 14:49:43 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343990AbiDEPKj (ORCPT + 99 others); Tue, 5 Apr 2022 11:10:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345640AbiDEJnm (ORCPT ); Tue, 5 Apr 2022 05:43:42 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E978C1CBE; Tue, 5 Apr 2022 02:29:26 -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 ams.source.kernel.org (Postfix) with ESMTPS id 64201B81CAC; Tue, 5 Apr 2022 09:29:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA834C385A0; Tue, 5 Apr 2022 09:29:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649150957; bh=xMuBtpSMi0tR4uqVjAuMkRQrPn1kVymN+i1l75YiSig=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nBWUqc2oeU7PLo/X8jlJefJvXVBRqfFRJfCcmQRvUiRwLTVXNa2P1ksF/B2BK9ksO OROciOf4OIHXZc5AUvJPtwh19QUMW8xIIOlSVXQTGM1NnCIhNlb6bEgZ9YfjgXgjHI Vl+mQMycoJSPGUgc/VerCYNSRGPGxtDWsom4IqSA= 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.15 241/913] clocksource: acpi_pm: fix return value of __setup handler Date: Tue, 5 Apr 2022 09:21:43 +0200 Message-Id: <20220405070347.080719624@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@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