Received: by 2002:a05:7412:518d:b0:e2:908c:2ebd with SMTP id fn13csp411254rdb; Thu, 5 Oct 2023 09:19:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFr8LcDkQ1odENFfLgCcoiK4k/2esBJNzaW+jU4g5EVy6Z5JT1oG1p8uQ3vOyd3kKV1Soun X-Received: by 2002:a17:90b:4a07:b0:279:7963:cdf2 with SMTP id kk7-20020a17090b4a0700b002797963cdf2mr5383292pjb.0.1696522753690; Thu, 05 Oct 2023 09:19:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696522753; cv=none; d=google.com; s=arc-20160816; b=m5pNT6ptACVzxG/uZVpglUm/15R2vLXf/Y7NFRCVM1tAak7p9g9ZMhZb4TUjB368m7 3/olKDNO1BftfssivSXxx8YT9qJJjd6MAgKvcmzRn0g0G7fFcYX80ledXDWzCsyaFFIJ u71/3XDfH+k8TT0TpHoaJNr+adixyRCYdx0YGSjF7zdIskUB7D2KwVrcYrHlZu6JOZr+ 0bFSHqZIszDvKR21nQJpYon2sWipxBwZMuhIT1awK608Xl/xm1QIiiamxZf6VI/86EIZ 0wKPpttE1zR7ICSv/au73um3z2RGptDueNZb4phmfHIrNerHTi8fPF6NaonGzoR4659L NrzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=JNyCQ67xdT96qFsLCo+WWGtR8HPuUjeLj+uqNqnLI8g=; fh=LMimJJHAGJQAxa8ES6PZTGBEDzrZfy9j1/0wCeHmW1k=; b=lKj/TPMb6fxFtx+o2L0CTOztlbu4QfIyNvABlOHKlGg/0FcXNWZ0OyPb4KegN3lPxp xhSxOE5Lgn/8X9yDX+a0rmFedmO+96PYeasnEQEVQHVrmuZc4NrV0/o3Vi7weMkxFg9D +J7KseoJW8nTuUVIR8jJtLsyEWSIhvBYeLmrJ4nHyjtXQzYY94bdspw8W0b9e90cXTxY Z1jshwc9kOQZvDGxr2R21rzwqZ40JEXfmxjadyl5CoyglNAf8A6JI9zxtn+6TIx/+ItC Bg4MiLK8ncsRtX5g1AF+46T65Q2K1i2BZ9A9VvgkuRAKWgJ7LZFNBHkoDs3/+yOtPSuA c+GQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Tp5lTQkk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id gz19-20020a17090b0ed300b0026b0c3f1506si3766971pjb.155.2023.10.05.09.19.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 09:19:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Tp5lTQkk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 19FE282F09BF; Thu, 5 Oct 2023 09:18:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240855AbjJEQPe (ORCPT + 99 others); Thu, 5 Oct 2023 12:15:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240476AbjJEQNH (ORCPT ); Thu, 5 Oct 2023 12:13:07 -0400 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4EA123537 for ; Thu, 5 Oct 2023 03:59:03 -0700 (PDT) Received: by mail-pj1-x102c.google.com with SMTP id 98e67ed59e1d1-27763c2c22eso557228a91.3 for ; Thu, 05 Oct 2023 03:59:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696503543; x=1697108343; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=JNyCQ67xdT96qFsLCo+WWGtR8HPuUjeLj+uqNqnLI8g=; b=Tp5lTQkkRcFT7HVAS5m2wq+oEvkf5NYnCcmBwt8gRlk9H1wsDQNU25D+f+rb7CI8IQ XCEjaSXvf9YjMufPTULOByVskjvlLsrut9vlPCVLibdzaEvLOA/Ryucsjfv3JE2QC3DB 4+4dcq4mVaWK3h6hNG50FVCFQfbntE1WVnfGZqoKOBCeNqNxtypBfCsFtGb2tkArW9Gr ZLfGpgt2TAS6S1jCp+cAvgqs+UlgNtoD7da/rAd1N9o4wIe95joiHqz9qaat6tE5HIsW tKJLsjkYP6sFWpEvIjvAZpth91OPynBqQoUABQhyLhXhxm7/CR4g8OCvbv7r2vXlF9Jk E68Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696503543; x=1697108343; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=JNyCQ67xdT96qFsLCo+WWGtR8HPuUjeLj+uqNqnLI8g=; b=cz3CWCvdNIVb6IaYN4tKV0jGh+66TlGRDunzFfM5zkjvZx75XR8vn0Uoi91EwWDWhz tVaOwl0pG+92EVbAfEKq+3EgBXhy4bwUIdlLFYxGyZMNczZyOtsqFLTQyKhCpjKgKQlX zF63ijbg+ketjpPIzm5phlkM/t324zjFrwgzmIheaLY8wcS/7KsV4GQ4ReykX8ht64Cn duoBY39Hfo51pianVZ81YKd9EefLKHNVKEhgXrnZFpFpFzUQWM1abYUXaeaq0YxE00XR fRGPGrZydFiqe/GPXa8KSHtX8M258XMVwlZopj4xqKhD6WYUQf7ZECQP4gqgi/AAzJeN 5Y3w== X-Gm-Message-State: AOJu0Ywox2Tx6kEz8wyE4aF5l/1teYVlfP3mWi7PCSltK4L6gjK8VhCD S7KSoW6XQNOWpWr4pzcP/8lyjA== X-Received: by 2002:a17:90a:850b:b0:274:3d7d:e793 with SMTP id l11-20020a17090a850b00b002743d7de793mr4575546pjn.47.1696503543399; Thu, 05 Oct 2023 03:59:03 -0700 (PDT) Received: from localhost ([122.172.81.92]) by smtp.gmail.com with ESMTPSA id g4-20020a17090ace8400b00274b9dd8519sm1254350pju.35.2023.10.05.03.59.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 03:59:02 -0700 (PDT) Date: Thu, 5 Oct 2023 16:29:00 +0530 From: Viresh Kumar To: Liao Chang Cc: rafael@kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] cpufreq: conservative: Simplify the condition of storing 'down_threshold' Message-ID: <20231005105900.uctt4jna4wovt5g6@vireshk-i7> References: <20230912060942.2516761-1-liaochang1@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230912060942.2516761-1-liaochang1@huawei.com> X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email 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 (agentk.vger.email [0.0.0.0]); Thu, 05 Oct 2023 09:18:49 -0700 (PDT) On 12-09-23, 06:09, Liao Chang wrote: > 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; Acked-by: Viresh Kumar -- viresh