From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.5 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4A407C4363A for ; Tue, 27 Oct 2020 08:47:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0B58A20715 for ; Tue, 27 Oct 2020 08:47:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="eG8/V8c4" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2509296AbgJ0Irl (ORCPT ); Tue, 27 Oct 2020 04:47:41 -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-Google-Smtp-Source: ABdhPJwSIGoGMoYqh7BO/6yTHOnstNyNB842j06yL1OCf7s5uOAGBDuuLE5nNs6cULv8A6+iw+NiNA== 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