Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp2698254rdb; Tue, 12 Sep 2023 09:23:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFE1HBpcYggyUFoYKzvWG3szsOPpDqJkPgQEnnRTpB8U7nLCwGB9IZpooZ1G5NRI+7wteag X-Received: by 2002:a05:6a20:5611:b0:140:a6ec:b55f with SMTP id ir17-20020a056a20561100b00140a6ecb55fmr13499885pzc.16.1694535829480; Tue, 12 Sep 2023 09:23:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694535829; cv=none; d=google.com; s=arc-20160816; b=lOIEgPFnp7V/2IU/zU0+ypjb9glyyGgB7P5ocBXJklK6E735SSG6ZiDWV/AYw3+j2v mnEphpvt1DH8d/ZcRq/r1Uh74hnS2C1T6BZrewCz3AzfD12akE5sbvdiU+Og35omteP/ ryYRn15nIFhEwVbVOGrxrNuT01sNXiyv3W1t4dnCUoqLS0jtwjmUlDhjxwMUfXqr4XIP PvafkgQZfrFGdCQEqPFIGXdBlXQkIiX+vBFdU+/EJLzwxzSDMBu62aDl6F/Kh6aW9YWF WpufA+8ujA9vR0oJy05yvIp2+R26B2gVexzTShqCfaz6T4T+yTPytb8fZ4h9QykJlNOH 7plQ== 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 :message-id:date:subject:cc:to:from; bh=l9b3tc/f4uNDk8aQeez9KwPw9HpQXqGyYvX3c8CP2R8=; fh=0vaYOzzn3Z5SQEjgoqvxffIotvjIeDSv5QGTvx6cK/U=; b=zv0bAHokshlHqqj51V+qBymcUwkFpE78g/WcMyI4uwKx2qGB2omgkEuAAR5w9SOdYK pN43+Ess+6CT6bNTzfoTIwp5z85nUGJjW5Gqkxf6u0wiX33l6oirRrRdCTzKDsw72egO kHAJPCxMn181GIeLLG9MTYvg4Zv1kuH7aaknVI27lPTzYxHPITjK4MDzc8B4UJG6jtG2 gK7jNL3r1nhjRgz27xYftd5M7eFVUPwJfbivI0OkxdxRRZwVoMZ/SONdpTTj9Hn0sNoD DnjJIpVrx0lxVhjAAwn39s3eqT+YDwsk8zlALRUORj4v0OQ7KQF7zqaZ5xDQDdZQ6zJy pKZw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id n31-20020a63591f000000b00573f9d916fbsi8161737pgb.784.2023.09.12.09.23.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 09:23:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 586338526817; Mon, 11 Sep 2023 23:12:06 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229625AbjILGMH (ORCPT + 99 others); Tue, 12 Sep 2023 02:12:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229461AbjILGMG (ORCPT ); Tue, 12 Sep 2023 02:12:06 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62869AF; Mon, 11 Sep 2023 23:12:02 -0700 (PDT) Received: from kwepemd200002.china.huawei.com (unknown [172.30.72.57]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4RlCnX6qYjzMlBJ; Tue, 12 Sep 2023 14:08:32 +0800 (CST) Received: from huawei.com (10.67.174.28) by kwepemd200002.china.huawei.com (7.221.188.186) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.1258.23; Tue, 12 Sep 2023 14:11:58 +0800 From: Liao Chang To: , CC: , Subject: [PATCH] cpufreq: conservative: Simplify the condition of storing 'down_threshold' Date: Tue, 12 Sep 2023 06:09:42 +0000 Message-ID: <20230912060942.2516761-1-liaochang1@huawei.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.67.174.28] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemd200002.china.huawei.com (7.221.188.186) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 11 Sep 2023 23:12:06 -0700 (PDT) The governor currently checks if the input new down_threshold is less than 100 before storing it. However, the up_threshold field of dbs_data structure is also limited to be less than 100, so this check is unnecessary and remove it. Signed-off-by: Liao Chang --- drivers/cpufreq/cpufreq_conservative.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c index b6bd0ff35323..56500b25d77c 100644 --- a/drivers/cpufreq/cpufreq_conservative.c +++ b/drivers/cpufreq/cpufreq_conservative.c @@ -187,8 +187,7 @@ static ssize_t down_threshold_store(struct gov_attr_set *attr_set, ret = sscanf(buf, "%u", &input); /* cannot be lower than 1 otherwise freq will not fall */ - if (ret != 1 || input < 1 || input > 100 || - input >= dbs_data->up_threshold) + if (ret != 1 || input < 1 || input >= dbs_data->up_threshold) return -EINVAL; cs_tuners->down_threshold = input; -- 2.34.1