Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp3379032pxb; Tue, 19 Apr 2022 00:45:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyjuk1ATD1SUkOOXZh+geewYPIQloG2JUMyWIUYNTVxvEi6+dEq9xNzCHpwEXYGaQKGhLyR X-Received: by 2002:a17:902:8a95:b0:156:a40a:71e5 with SMTP id p21-20020a1709028a9500b00156a40a71e5mr14254987plo.144.1650354357741; Tue, 19 Apr 2022 00:45:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650354357; cv=none; d=google.com; s=arc-20160816; b=LPoUDBFqu6F1YGVkzgIeAiEXlKwHAGnNKa7Cm1ZnoRLJPZWuSQBjg90LVSWmypvzip WYEG/jsUC5qMUt+6oPN1YF292LTSo3ZEq4CvZC+m/GFfvlbHe3KznFZVVIcARgoG+Vf3 wIsHz7De6o9Lu964Em/nN9IuZCq+WElgXXw/PeNdFxZCL2+2GlwhH6QDxUkqoBf3jbSs LHLs4dS3xYoJrA0TaVi5iDrPr81SC/DpsmdErvdk9Uuk3X3pvyRhNJKTwO2sKbGqeOF+ 8S6MWxFq4bYgVbc2WJ6fZYYW+ENhA3IcE+ukFLGekhk559d2QNPhAbFQUivWQbgFXzh5 oq8g== 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=4WmYkw/MD4JbD6pvwq+B8E5q1CrZZ1rb+zj/5eXJ66I=; b=qVo2EeFRGQpB1ufVpoPMDNCaT1RTHCP9lgNGfoC2hWZKMQIDw3IxrRPwT19YahrQVQ Gl00OMAPTY0DMJns/TP8B03sKyQOkGpL52Zr03Et7/K4Nf1IZZFmswYeJAKR29bYw0dh KICQ+xQ3Y5pEg45dS3gvEaiX1qf0wNhXLc/XjaTxQzmmsQjWIa9mD+19Uo4J3ljOaHAi PTTDGJiTXNufB9agiv4D7HHdpDN4ZtwyT4tbR58IbbGeMPOvXqSf4wRp8Yy/dRxopzY9 rnaSlmwogOtzJm2dLU4UBLzZqCrlgHdzB6etuIEaTgbePYTeGbm+L1xbheH/qvZ6bJM9 YntQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mdX0f0wz; 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 m2-20020a170902db0200b00158a297b1fesi11750879plx.560.2022.04.19.00.45.28; Tue, 19 Apr 2022 00:45:57 -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=mdX0f0wz; 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 S242736AbiDRNjR (ORCPT + 99 others); Mon, 18 Apr 2022 09:39:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240524AbiDRNKz (ORCPT ); Mon, 18 Apr 2022 09:10:55 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA06439815; Mon, 18 Apr 2022 05:50:28 -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 4A92D61257; Mon, 18 Apr 2022 12:50:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 44E62C385A8; Mon, 18 Apr 2022 12:50:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286227; bh=n4XZKIqAnxf38ktFeInvlW1RzeqznHZYpBRS8tv0/98=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mdX0f0wz6LR71ubo++dzfnASesPaoxClnXZ+nm29qvnzY3fh+VyXqwOmd+a7ueU/Y 6QqfI8DkxrhwrlZbYcsQjbRBM5IyTONbym/T4G1jeKJW4+lOu9KoG9pmkh1+kdXXb4 XmChR/PPxgX2aee8pjhTS9P/Aato1XnbGTtuQ7U0= 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 4.14 067/284] clocksource: acpi_pm: fix return value of __setup handler Date: Mon, 18 Apr 2022 14:10:48 +0200 Message-Id: <20220418121212.595244590@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@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.7 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 1961e3539b57..05cc8d4e49ad 100644 --- a/drivers/clocksource/acpi_pm.c +++ b/drivers/clocksource/acpi_pm.c @@ -230,8 +230,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