Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp3165656pxb; Mon, 18 Apr 2022 17:50:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvDB3fEk4+VTXjm2FQXVJq/+SHw4tjtdypw5u6MtxdakyWabVDreKy6iwxIPRtpzH04U+f X-Received: by 2002:a65:5181:0:b0:3aa:3668:26a9 with SMTP id h1-20020a655181000000b003aa366826a9mr785961pgq.184.1650329442263; Mon, 18 Apr 2022 17:50:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650329442; cv=none; d=google.com; s=arc-20160816; b=Xwe/vEXf94+gLQGtF0WbyPxv51NR5ZWa4uq2Bekd9KnP0NxD6uH4PSNkT1pcxIIAgK bV2tvHKSZlWHJlXkhTNVPmbr2QkYbW+TnWBj3U4539MqKCA0ZdOgAWsWewfCB85PMvNK m8SGaAXVRdqL+d0quWARrCYDy/Y1e+qvUsSzRDjTpZAJmwMoy/xAbHKunlvUJp2dlgf6 QH2gygQTZdakXDvRQD6MzIESJmOImEGvly9UM3xKzaJUjbgODNKxLAI0RENe7bFLG3Xm r4nBWYBbHeFcZTrTndTMNcTJOHTIjsu89hTo3pp09xIYM4u35VNtIpjJSY0n4jYnl5Ro Zg5Q== 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=oFZvdOVQW4411VJX7P/yOscZ0JvxqpqST51hDAxz3U4=; b=hHOrLdV0vIvztJD5AhrGv/dFPIWGTqMC52svxs5kPWXTUJLcgowURML+ziEENq1Ava Wptbd3plrN1M0+IyJevMoTggAJ+ar57nynEGSeGTAkPMS16sDi4BTqxHpf0YD6Hkbz+3 QcwPXieo4jjEHU+xV0xAZD7UXeUW8myFBlCnrIY2GRA8zrVCmizg2Ysphj9QY0/6ibe4 SELdJbRp7vMJzxghTIGHP9+DaITfCyw+dFRBhDYNdmsPSgpWTsMSzAu03knbDlOppFJV zv3jDd+UX3Z8I7JxFTJqrWiyVttrb9KxC+IF1q2EUaGPc52MWUWHFhzVbK7CRPTw///a +8zA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=X08lTcJp; 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 s3-20020a634503000000b003a9f944b0d7si4172899pga.563.2022.04.18.17.50.26; Mon, 18 Apr 2022 17:50:42 -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=X08lTcJp; 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 S238976AbiDROKu (ORCPT + 99 others); Mon, 18 Apr 2022 10:10:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244515AbiDRNzb (ORCPT ); Mon, 18 Apr 2022 09:55:31 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8441349CB1; Mon, 18 Apr 2022 06:04:40 -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 1C789B80D9C; Mon, 18 Apr 2022 13:04:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AD519C385A7; Mon, 18 Apr 2022 13:04:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650287077; bh=Laee6Z8kRgfwvSsT2/Degvk8VHCNutJv4DH/bXPpJ8E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X08lTcJpxJOXWjddJ14jVaqldhLatwLNLCNe5yxNAxsNPdIbL6/N/Iy3TlBOZ4tJZ m5jZhkNeRUbv7Q0aHuqIQqTYUlQUIYLwRHmvAatL3SdjbK3S1CRX8MMXgHCuqEpuPq W/ddsUn/YDbSct6SznI+Z3hY1z8nVGnZQUhUArGI= 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.9 051/218] clocksource: acpi_pm: fix return value of __setup handler Date: Mon, 18 Apr 2022 14:11:57 +0200 Message-Id: <20220418121201.072712001@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121158.636999985@linuxfoundation.org> References: <20220418121158.636999985@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 28037d0b8dcd..55348e7c1e6f 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