Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp685531pxb; Tue, 5 Apr 2022 18:44:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxdFALHMMQ6zD/pWKfpPXdzNiFfY1ypyQfGfuqSiUDHWuSsbD9y7sNKFMkSzgtomX1is3as X-Received: by 2002:a17:906:434e:b0:6d0:ed9c:68bc with SMTP id z14-20020a170906434e00b006d0ed9c68bcmr5891649ejm.70.1649209390798; Tue, 05 Apr 2022 18:43:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649209390; cv=none; d=google.com; s=arc-20160816; b=n4aZUSaZAQYAdvnfT1lpDZX/ZzCVK99kKQMDRNDwkvu44d6JqaaZ+BRtBZXlc+awQa QNZ5eHV2IpX59wpcCWEjx91+J6ItCxHdp+brtoQHf81noHqcZlQy+wwK4V2RbA0DGH8h P305Fh657aB46mgTXGtWyYsHWvpEYn/z0ZlSb/F30fSCXVaOyhpP45p2PdLGjO4gRD/S ieKowS43SeM7uYmA5So7sBdgS0QtPjyFCRwNuKk2TTBX5f5swt/uH9HcD9k08ZDCurfL NQvqtb+SNBCr6QaD/IFN0aJZp3jroPR6RVW+hj/C4FFhDw6yRaUahfo6QnmxInoKg4Od mBlQ== 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=E8seLXWIpnDZ/7UqiU/cqBE1ttYRz+Tbni5sz9biNteAlLjUGAV5JiIKGtXWIUvVvr wPzj99h810FNxjnz/g+ZYbmeKadvI3pLby7Sf+aWjzfDL/j4mHt/vp+KuhxEoRNlFpd6 Kv4HV304qVQPVsmrifAVKL/55W37eyuAtycUnb1Q/onR9KEQtTCF3DejC2Q1BQ1f3wtg gfXCwxxgfBJTabzLgJy1/GURu5wvSFguuh2hxzbLrEfav+E2vRxfUb7c4i2RK2BjxCpP A3ZlVHg7t0QwHpN4lfSxqaHAD//rOEoBkCNUz2Si2h+slAQ1bnuoYfeJs38CCG2mkpoi He5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fdDdDn3k; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t13-20020a170906a10d00b006df76385b71si10350819ejy.17.2022.04.05.18.42.43; Tue, 05 Apr 2022 18:43:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fdDdDn3k; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241964AbiDEIgO (ORCPT + 99 others); Tue, 5 Apr 2022 04:36:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234414AbiDEH6O (ORCPT ); Tue, 5 Apr 2022 03:58:14 -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 B79ABA2040; Tue, 5 Apr 2022 00:52:27 -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 E166E615C3; Tue, 5 Apr 2022 07:52:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EF5B1C340EE; Tue, 5 Apr 2022 07:52:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649145146; bh=xMuBtpSMi0tR4uqVjAuMkRQrPn1kVymN+i1l75YiSig=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fdDdDn3kVSeD6jlaqig18SbmfC1nIDTVpUiEnMRJgMwLIExh/1fDDlUK266dvusUT 4NwpUA1mxROFyG7+9IXtOos1TzNi/GXYXbTCYTkKqIkaqpXsQk1FN7Bf7He04rHCNB nY0/KqW4YYzuUj+h5IdP7D4r9UZOMWfo0mCJ37Kk= 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.17 0263/1126] clocksource: acpi_pm: fix return value of __setup handler Date: Tue, 5 Apr 2022 09:16:50 +0200 Message-Id: <20220405070415.330085387@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070407.513532867@linuxfoundation.org> References: <20220405070407.513532867@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=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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