Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp103938pxx; Tue, 27 Oct 2020 22:58:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOqu9d9I4+GsmrzzH+lHB6loBQjjx01DrCM9gsOMoP5HO0ZeuX21+8303ovlV9TRmnBUSq X-Received: by 2002:a17:906:280a:: with SMTP id r10mr5872750ejc.58.1603864687478; Tue, 27 Oct 2020 22:58:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603864687; cv=none; d=google.com; s=arc-20160816; b=jD5gwTxZfDSpw6Q//Lb7VmRH7T0Cwe3TVMs19/qfwtNs7cz8E/AHp8/Y5DTgqTFHEV Ys0GRJcPHmqApeLn+19jn13EQ+bVCpsVTfMF8hluCJYhEUdDBqs4xS4Vuqso2XCFNTvJ yhPqdtE8xKfKvtCnpeAHfb/Nf5UkPwKxq7vRsePqaZI7zeQAZajxubD4pHJ+A+QD7jfK eAXyOX9exEaY+EhU35Gmrqiyctt+jl1FUNrduLiC9Y0IUOQVBBkGbubCE9cU47s5/WMQ zdV8Ui4bdX1TGr4zvnVesPbe2lkd8CUBtZalEFhCc0ApltY907TGXdkNCG2TIxXQ8JAa a8TA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=BwW+REPlxIwDJltL1navo4FmuG7WENsYC7PlrzbSxJs=; b=ko2epHPQejjQ3LGqg98pUw3g6EseC6JB3gX6oJW2V+64g7D/6EY2jI6VDoj+rhBwSu asJ83lBF58ZW4l97bOaIzwqzNDbvXusFGe+wXjRv3fHcTurJJ6ZoVMjKq0FiL3ga574c 6s7fG0AU3Sys8zd8s5wt7mKXojCtqj97b/yJlZc34NVGz9oxxeUTh01hYmr83V1tL8Td uRsOFDd2/rHHhjtcvdJQxwbyyIpOKnpQww5hGIX0CJQm1O8rKa8A6M1R1Dv48IrsI1rH Ry2ocw+LPNHYpIxRS7vlqE/AKDG42satFimApE5EatL4i2Toof0syBKVVVmfTsvHXBBT 1rww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="eG8/V8c4"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e7si2679835edu.247.2020.10.27.22.57.45; Tue, 27 Oct 2020 22:58:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="eG8/V8c4"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2509292AbgJ0Irk (ORCPT + 99 others); Tue, 27 Oct 2020 04:47:40 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:41737 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2444587AbgJ0Irj (ORCPT ); Tue, 27 Oct 2020 04:47:39 -0400 Received: by mail-wr1-f67.google.com with SMTP id s9so890452wro.8 for ; Tue, 27 Oct 2020 01:47:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=BwW+REPlxIwDJltL1navo4FmuG7WENsYC7PlrzbSxJs=; b=eG8/V8c4DVEAApf+O6xuEHJuWqrBl7sD1H6CeCVvGqST338OffYoR9+YT8k67V833I v/mhib1IagL7stWz8z8tRZqh1xmoM9t9ZI+dtWJVg6YFNwOilaqzUHszv0ExQq+gKLj+ 9N8VIA90R9egKfcC852pvEP9ufftvZEJbbCWN6rygVpjiqPEFB9GNXm5TZI/zXG4SFFS 4bnQy71Gm/XjvOGoFKumvWIaDA67gU6QZETAjHlxnSmPgvFsgwKBOZlRnRxmmKIEh/AW lYcyxpKeQq67bQtQynNWWuqDbDug2weONj2sZfwdl/D9b9UJ1i5q6guurrnIBPhxvL+b +ZhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=BwW+REPlxIwDJltL1navo4FmuG7WENsYC7PlrzbSxJs=; b=jFZn1l8BgTsf7RFPmDGcPDIWxzkSSeRslMrBYUj+9cTnukVNvnd/wqpiC+QkA6JHHj eaK0FbC0pSp60j7wMmWAbbklCnaqnv6oweQZ8b1KMJDj0YN8b8yyZpnkhpXNk6r8UjLJ ONCxldTBQidk59MotjsFYEy+PTFgek21Sl8Cmp9rT+Z3Hhz9sEcG5X9hVRjXGyrlWKDq X4CGHSPIOfpp4aBzVsVBbvQoVru2I7Xir2GpyWzBytt+S0IXkaP86TSvnO5lqz/nmpNX LotEK/DLNlJbGljXpM4/rDWeNSc1IdqLqy5cmbyscpTPqBI13p62Z2fIbbg80j77SZLM 92Bg== X-Gm-Message-State: AOAM5316cQ+PgFiYBa+Lw0uWDr9oLvd0TRrdBjMsHYGxqzkxTSfHMyBj 6jpa05vtugxVhGtPSiXiHfHT6w== X-Received: by 2002:adf:f3d2:: with SMTP id g18mr1440994wrp.367.1603788456978; Tue, 27 Oct 2020 01:47:36 -0700 (PDT) Received: from ?IPv6:2a01:e34:ed2f:f020:6cbc:1a3:aabd:d451? ([2a01:e34:ed2f:f020:6cbc:1a3:aabd:d451]) by smtp.googlemail.com with ESMTPSA id m4sm1187778wrr.47.2020.10.27.01.47.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 27 Oct 2020 01:47:36 -0700 (PDT) Subject: Re: [Resend][PATCH] drivers/thermal: optimize the for circle to run a bit fast To: Bernard Cc: Zhang Rui , Amit Kucheria , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, opensource.kernel@vivo.com References: From: Daniel Lezcano Message-ID: Date: Tue, 27 Oct 2020 09:47:35 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 27/10/2020 02:19, Bernard wrote: > > From: Daniel Lezcano > Date: 2020-10-27 02:35:18 > To: Bernard ,Zhang Rui ,Amit Kucheria ,linux-pm@vger.kernel.org,linux-kernel@vger.kernel.org > Cc: opensource.kernel@vivo.com > Subject: Re: [Resend][PATCH] drivers/thermal: optimize the for circle to run a bit fast>On 26/10/2020 02:49, Bernard wrote: >>> Function thermal_zone_device_register, in the for circle, if the >>> first if branch set the count bit in tz->trips_disabled, there is >>> no need to set in the other if branch again. >>> This change is to make the code run a bit fast and readable. >>> >>> Signed-off-by: Bernard Zhao >>> --- >>> drivers/thermal/thermal_core.c | 8 ++++++-- >>> 1 file changed, 6 insertions(+), 2 deletions(-) >>> >>> diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c >>> index c6d74bc1c90b..03577794eea3 100644 >>> --- a/drivers/thermal/thermal_core.c >>> +++ b/drivers/thermal/thermal_core.c >>> @@ -1446,10 +1446,14 @@ thermal_zone_device_register(const char *type, int trips, int mask, >>> goto release_device; >>> >>> for (count = 0; count < trips; count++) { >>> - if (tz->ops->get_trip_type(tz, count, &trip_type)) >>> + if (tz->ops->get_trip_type(tz, count, &trip_type)) { >>> set_bit(count, &tz->trips_disabled); >>> - if (tz->ops->get_trip_temp(tz, count, &trip_temp)) >>> + continue; >>> + } >>> + if (tz->ops->get_trip_temp(tz, count, &trip_temp)) { >>> set_bit(count, &tz->trips_disabled); >>> + continue; >>> + } >>> /* Check for bogus trip points */ >>> if (trip_temp == 0) >>> set_bit(count, &tz->trips_disabled); >> >> >> What about ? >> if (tz->ops->get_trip_type(tz, count, &trip_type) || >> tz->ops->get_trip_temp(tz, count, &trip_temp) || >> !trip_temp) >> set_bit(count, &tz->trips_disabled); >> > > Hi > > Sure, I will resubmit this patch, thanks! Please, take the opportunity to fix the author name to be the same as the signed-off-by. Thanks -- Daniel -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog