Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp252851pxb; Fri, 29 Oct 2021 09:13:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTXlcKv+IpLNHd+1kJ/wTX+5pK+/thc37fx8U6HQ6UgyGQivhE0730BgDR/EY4iVQ1jSbj X-Received: by 2002:a05:6e02:1c43:: with SMTP id d3mr8390121ilg.116.1635523993268; Fri, 29 Oct 2021 09:13:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635523993; cv=none; d=google.com; s=arc-20160816; b=nMiMGdIx8nx/jiCy8aA8Q7urr+EQ043NochzjwIR1xCLNEFt5O6aEX94NaKuPOZPcK /EWoSldBqHsm7xmG+NmTAIe9IbdLl9qN7UKpaPTMnISW/9bDKtOyMszhSVQ+bnNdAxf9 zl0qXJWDnI6UkGd7PKCRbrPddrjOWtLzyq6EVRFdnq+4/4XpZmmFLzZ0muSVT7qczeSk 3tBMT4hIuEbXDNXn8E/vh0UQ5scDgI6mb1z2EFbJ7T4vsev6FjGi4ok7+vfJH9yqOq+o c78iVDcVgx7zS3pbikuCVOillbliSpWClvTlwADmr8Z4I38aSPSicThK4I1oX3b414+B 6Gvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=Yd9yTVl0mzMu8CxNtY/NSg2Fd5BmOwS2ev++cNAViEI=; b=ZKBJ49uFhPJOQxo4niYB/CwyQGTqlo4obPYFHZm62qqtYSul8nSYIPvc2o92oMzGag uxzg6zUGq8S1bxhAErz+fYG08lJzwJq1rp4hgGV/+PkFlTm9Pjo69kU02jLMy1x3sgCZ iYqFYTKlek1XRKFguwL2yy++I5czl8FZqX8Lw4n3MlAIq5eLfOcugKtmODs439J1bkOf 15GLBricvPwnKxo6odc2fRc+fV2j/IoP8Rv6Sv0lhYNZmYLdwAH6l8i4RHUkhzmgI9sO 3/vP3rIKJe1a49oTmZGUIWHy1N+HpPevtHmCa6VBeS5Sngxl5FS2d9PjWvUk12js/HZw 9Xng== ARC-Authentication-Results: i=1; mx.google.com; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i3si3285864ilv.98.2021.10.29.09.13.00; Fri, 29 Oct 2021 09:13:13 -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; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229712AbhJ2QLb (ORCPT + 99 others); Fri, 29 Oct 2021 12:11:31 -0400 Received: from mail-oi1-f178.google.com ([209.85.167.178]:34802 "EHLO mail-oi1-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229607AbhJ2QL1 (ORCPT ); Fri, 29 Oct 2021 12:11:27 -0400 Received: by mail-oi1-f178.google.com with SMTP id w193so14075655oie.1; Fri, 29 Oct 2021 09:08:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Yd9yTVl0mzMu8CxNtY/NSg2Fd5BmOwS2ev++cNAViEI=; b=UfVyve/AcWDCDtHCG3v/7H5+l2pevJufm0Zf9AxbY86e/vG4WtdXkKP4Wh8M2zpcjM CtZGfxr9dU5aoon8ZGgBO2wowHhd7FUhKqepJws06IX6VV+3Yx9dlmAd/EQ6SDUmCsL2 Zo0gbvZNbuUr3pq071ThkvTelh9o3MAqyQQw1SjglwDICsMxeRvViTsru/2jWq9JtHkN 8EiBdFccF6CB7Ip96WtHuaM1RE1xcTsgT99SS402xs3TKr6ELjdBtsWj4yk2suKRAWIo IuZeCiVRJVYdIgcPpv065vArP18a+mEaX+jdlIrq6l3zViAd40vS3XD/sKmrDETtOwFB 8sfQ== X-Gm-Message-State: AOAM531LRU81WkJCi2nSFXL33SAlPO1wbflrCbXFTo4IqK+uTeaD+t6M Gz2JuTRkUrdHMbfOi1Qy3Pzb74C6M5EjwfdcD1A= X-Received: by 2002:a05:6808:e90:: with SMTP id k16mr8544666oil.166.1635523739007; Fri, 29 Oct 2021 09:08:59 -0700 (PDT) MIME-Version: 1.0 References: <1635391292-2879179-1-git-send-email-jiasheng@iscas.ac.cn> In-Reply-To: <1635391292-2879179-1-git-send-email-jiasheng@iscas.ac.cn> From: "Rafael J. Wysocki" Date: Fri, 29 Oct 2021 18:08:48 +0200 Message-ID: Subject: Re: [PATCH] thermal: Fix implicit type conversion To: Jiasheng Jiang Cc: "Zhang, Rui" , Daniel Lezcano , Amit Kucheria , Linux PM , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 28, 2021 at 5:22 AM Jiasheng Jiang wrote: > > The parameter 'cpu' is defined as unsigned int. > However in the cpumask_next() it is implicitly type conversed > to int. > It is universally accepted that the implicit type conversion is > terrible. > Also, having the good programming custom will set an example for > others. > Thus, it might be better to change the type of 'cpu' from > unsigned int to int. > > Fixes: 3e8c4d3 ("drivers: thermal: Move various drivers for intel platforms into a subdir") > Signed-off-by: Jiasheng Jiang > --- > drivers/thermal/intel/intel_powerclamp.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/thermal/intel/intel_powerclamp.c b/drivers/thermal/intel/intel_powerclamp.c > index b0eb5ec..ed46b5e 100644 > --- a/drivers/thermal/intel/intel_powerclamp.c > +++ b/drivers/thermal/intel/intel_powerclamp.c > @@ -578,7 +578,7 @@ static int powerclamp_cpu_online(unsigned int cpu) > return 0; > } > > -static int powerclamp_cpu_predown(unsigned int cpu) > +static int powerclamp_cpu_predown(int cpu) > { > if (clamping == false) > return 0; > -- I'm not going to consider any patches of this type, because IMO they are not improvements. Thanks!