From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4C25F1B5ED8 for ; Wed, 21 Aug 2024 07:59:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724227160; cv=none; b=tAX+h41EWGSxt8YhQi3Pj9WuAa8i3+6y149SqIGhmkoFle1VkbSW+Oc6qbSFSFMxBK4iIWq3htRaJ3pxoholcQYyWA4g/d9K6PMmbCT2L0bTZ4ObWv2lo8U868PjmDItyVfu8AgoP4cIQ7amdgOOrcKtHl7/3Hf2KipK1Rl0MDI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724227160; c=relaxed/simple; bh=vmZoQ1uV1Pp2U5AwGUjIKnclRbitDC4/b0S9tawjIZ8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=PQvAT/JE1jUCVwz1vOtNO7+iJO3PpvJPJj+SZZzuOKIq2RywBPs6StYWeppmbHDhyjt8F4TwLh/YP+nsp8QbrEeiZkXqKqjMI0MNhclvqEeONRUf+RX/bAge7LJtznIUUVEGQdizdCHKxroNY6WDYxoy1uNBF6lWN/NCaZIF3Es= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=jk+g1Oug; arc=none smtp.client-ip=209.85.221.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="jk+g1Oug" Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-371a13c7c80so268212f8f.0 for ; Wed, 21 Aug 2024 00:59:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1724227157; x=1724831957; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=pSadfNXEdeNozhNQXiSBtdB01rrKvu5hoPMu5VmvLQA=; b=jk+g1OugDVmRmGNO2pV75ZELJTjAb/1aalyUrINmhEwRw3q0ekcslrsgOZFtBD7+l0 pisJ4dTseAmnri0y2ucmxj7847GOrtdPYZo1oYrTi3ykP4ityNbE7Upg9q/gPnoV4Gft uEhhrdJ4oxwc2X/UZC0CiIdYBhThXstQu/SMy/AcZc2f1fgROjI7mSzVzw7FX0VPetGd +vDM/N0HkRwyLFjeEsO+zPWCd59RreR8F+Ifhf2zyNJCDRy2ZU8BrDEW6SNs6boJEw/A TFf0dWb0PDaYJ9P6A5+YV8BslhsIIZ3by6ceEq+D8Wz/NrAdQBCm5uLG0GXoYlyDzXwQ 3iNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724227157; x=1724831957; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=pSadfNXEdeNozhNQXiSBtdB01rrKvu5hoPMu5VmvLQA=; b=cMav/fgj+bVX0V7vbrz/AWa+YEb0RfJwNNYFClINbXZF8YQvl5xwc8IDkNLJzW8BqD 73JkHurmfijpHzbAqMui6onekBoFm6PMZnfT7OIjRvEsRWueY4uhaWjQFjBmxy2uI3TW BVYhRbQJEfBaQdjIIOsZsC6C+QyP4V+2WtsT1MIpO4LDgJQg5IYjFXBWDbCES4TxcFu+ oco6CdoAs+mdkTL8X6ryXMJyRE0NbstKZ20/snVRNphPbSrN7WtvX0HYix4O5wCRPibk wbXLGuLx2Xhu/2DJDACoE+lZ2sKUT0dg0oZxrpPgY0sqxLyJ9VhOolmAG/Wun37Svdew 3UbA== X-Gm-Message-State: AOJu0Yy7ZcfiUhn27ZbtzYN1oWtqVjMYaA9zqZCNGZm5IT/RzgFtu5+s qPbyzjjItKVHJGTfdBFWgZsMhq14RXu6O6yJdBoMZS8HmXyhwNYp0aR1MT1hAEI= X-Google-Smtp-Source: AGHT+IFM8X6ScfzQNt29Q3dK9ZN0yu11nlgXNiQcyfIignJgbUypEk/hFTrj4+VprEYUb2eAB3gEew== X-Received: by 2002:a5d:538b:0:b0:367:9049:da2e with SMTP id ffacd0b85a97d-372fdd6d646mr785696f8f.8.1724227156030; Wed, 21 Aug 2024 00:59:16 -0700 (PDT) Received: from [192.168.10.46] (146725694.box.freepro.com. [130.180.211.218]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-371898abf2csm14887449f8f.107.2024.08.21.00.59.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 21 Aug 2024 00:59:15 -0700 (PDT) Message-ID: <699f1bb5-c3f1-48f7-83bf-184bf6a04402@linaro.org> Date: Wed, 21 Aug 2024 09:59:15 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 02/14] thermal: core: Rearrange checks in thermal_bind_cdev_to_trip() To: "Rafael J. Wysocki" , Linux PM Cc: LKML , Lukasz Luba , Zhang Rui References: <2205737.irdbgypaU6@rjwysocki.net> <3324214.44csPzL39Z@rjwysocki.net> Content-Language: en-US From: Daniel Lezcano In-Reply-To: <3324214.44csPzL39Z@rjwysocki.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 19/08/2024 17:51, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki > > It is not necessary to look up the thermal zone and the cooling device > in the respective global lists to check whether or not they are > registered. It is sufficient to check whether or not their respective > list nodes are empty for this purpose. > > Use the above observation to simplify thermal_bind_cdev_to_trip(). In > addition, eliminate an unnecessary ternary operator from it. > > Moreover, add lockdep_assert_held() for thermal_list_lock to it because > that lock must be held by its callers when it is running. > > No intentional functional impact. > > Signed-off-by: Rafael J. Wysocki Good catch Reviewed-by: Daniel Lezcano -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog