From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Subject: Re: [PATCH v10 10/12] hwmon: Add PECI cputemp driver References: <20190107214136.5256-1-jae.hyun.yoo@linux.intel.com> <20190107214136.5256-11-jae.hyun.yoo@linux.intel.com> From: Jae Hyun Yoo Message-ID: <8ef997aa-2971-2907-3821-e71f9e8dd53a@linux.intel.com> Date: Fri, 18 Jan 2019 09:52:50 -0800 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit To: Miguel Ojeda Cc: Lee Jones , Rob Herring , Jean Delvare , Guenter Roeck , Mark Rutland , Joel Stanley , Andrew Jeffery , Jonathan Corbet , Greg Kroah-Hartman , Gustavo Pimentel , Kishon Vijay Abraham I , Lorenzo Pieralisi , "Darrick J . Wong" , Eric Sandeen , Arnd Bergmann , Wu Hao , Tomohiro Kusumi , "Bryant G . Ly" , Frederic Barrat , "David S . Miller" , Mauro Carvalho Chehab , Andrew Morton , Randy Dunlap , Philippe Ombredanne , Vinod Koul , Stephen Boyd , David Kershner , Uwe Kleine-Konig , Sagar Dharia , Johan Hovold , Thomas Gleixner , Juergen Gross , Cyrille Pitchen , linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel , Linux Doc Mailing List , openbmc@lists.ozlabs.org, Alan Cox , Andy Shevchenko , Jason M Biils , Andrew Lunn , Stef van Os , Haiyue Wang , James Feist , Vernon Mauery List-ID: Hi Miguel, On 1/9/2019 4:57 AM, Miguel Ojeda wrote: > Hi, > > A few minor nitpicks that you may consider. > > On Mon, Jan 7, 2019 at 10:41 PM Jae Hyun Yoo > wrote: >> >> + if (priv->temp_config[channel] & BIT(attr)) >> + if (channel < DEFAULT_CHANNEL_NUMS || >> + (channel >= DEFAULT_CHANNEL_NUMS && >> + (priv->core_mask & BIT(channel - DEFAULT_CHANNEL_NUMS)))) >> + return 0444; > > Maybe if ((...) && (...)) instead of double if? > Okay, that would be neater. Will change it. >> + for (i = 0; i < priv->gen_info->core_max; i++) >> + if (priv->core_mask & BIT(i)) >> + while (i + DEFAULT_CHANNEL_NUMS >= priv->config_idx) >> + priv->temp_config[priv->config_idx++] = >> + config_table[channel_core]; > > priv->config_idx <= i + DEFAULT_CHANNEL_NUMS seems more readable (i.e. > the while-loop variable first). > Yeah, that would be better for readability. Will change it too. >> +static inline bool peci_temp_need_update(struct temp_data *temp) >> +{ >> + if (temp->valid && >> + time_before(jiffies, temp->last_updated + UPDATE_INTERVAL)) >> + return false; >> + >> + return true; >> +} > > Simply return the condition result. > I'm assuming you meant: return !(temp->valid && time_before(jiffies, temp->last_updated + UPDATE_INTERVAL)); Will change it as well. Thanks for your review! Regards, Jae