Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp336426ybj; Mon, 4 May 2020 22:51:53 -0700 (PDT) X-Google-Smtp-Source: APiQypLGitcjmfaPh1Jb29nUo18Wj8x2ascjvD4YqYyfl2BNExsdbZ8K37a47uju+2XZjPjHS14B X-Received: by 2002:a17:907:4420:: with SMTP id om24mr1088715ejb.99.1588657913048; Mon, 04 May 2020 22:51:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588657913; cv=none; d=google.com; s=arc-20160816; b=onI/b8KxF6z0+XNSDFh3R7H2dvOiR85nIOE/EXFjrdp2ZXDLjdDGcotwg7hbcI0ljP 3QKsSGbrVqjHDL/MNkmtYEcDnUoqyUcubPPZUlSVAFdv1In1gDTG1+VNecF7ZliTF65U ocVp8V/q40RaVAQW0Tg8d6w5J8RKiaVdPBlDhahiKJsFbUFp9PbEuLiHBpjDWJYH99ta 0EM1q1PcjV9xwtwb67Bwq6Li8o4p1XFCxktLFmmwHEdcmfITcZoOKGwyaCpAXxJgWyGy bqwluS1LVD8f0ZrO57MWEckG5xITPUltvBwVEsRVQIO29HiyQeMJ9Pn+L+EpynYIvR7D kQwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=jB37zzTgwI47TMOI0FYcGt2ovqz6plx1N4prNTTSWkc=; b=EgEUZhpuCnLl0XmxoL0iftksPWADeRL9TW8ynL/TJbUoQJggqdv1TthGty8W09weyE H5XHoFSD3u18rQFNvKdVeaLhklA6F0MV3KFA8otJDE58pZ7Zri/jfqXJskP2xN4N0xhW zDBluruxL5AbZ9owMQITpxmsRnU8EoWnVdXK/Te70cMyZ0moFMyNmeeNVSvVFh835ASr UZF07vC6H4YVXd9hgDI9vgu2oO8aHOH5AOQ9/nRhHQgt756Rgb/R4L+koWgHcqdbHnvd Aih1NQ++cIbnEQ+qVCEteQKk3OJXQ9MKgOCzbPggc7qsTI6i0pYUAHu/hUowDRCLuI4J iw4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tUQk5WHT; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s13si470114ejd.436.2020.05.04.22.51.29; Mon, 04 May 2020 22:51:53 -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=@gmail.com header.s=20161025 header.b=tUQk5WHT; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727978AbgEEFsu (ORCPT + 99 others); Tue, 5 May 2020 01:48:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725535AbgEEFsu (ORCPT ); Tue, 5 May 2020 01:48:50 -0400 Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0253AC061A0F; Mon, 4 May 2020 22:48:49 -0700 (PDT) Received: by mail-lj1-x243.google.com with SMTP id w20so328229ljj.0; Mon, 04 May 2020 22:48:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=jB37zzTgwI47TMOI0FYcGt2ovqz6plx1N4prNTTSWkc=; b=tUQk5WHT0xp0po7KBS7AbhpZnUyQxyDSSfskMBn6KRcygua9OIkn4IroRx61Q3/Rlk 1eWEwZHNwHmBS++DlWBPt8gcw6r0pW/fpGA1dI6Tggq4QzB/hHePWECvJ5SljCrj9Zhl EiiG1Ks2T4XlFm0Je8+uXS0CbXvJ4W1kRXjHA6iS3r/4/4ipT1LDZUIpRDqCRURl3wBB SxLPNxU634eB8ZzfllUVka8M84djKF3EiH/88ulyTe9WcdA8ADA7v83cQVMNf7vbONO9 maw7GfsYfrFAJMHySRylr4Xq5LjukUXmZcD9FFNurXMmXGbrtQiBOslXahF96f645+fp KbrA== 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=jB37zzTgwI47TMOI0FYcGt2ovqz6plx1N4prNTTSWkc=; b=k5xamMYhGhV1hOyvypyvoUCesXTfrCuRzrhgLRvw7VRKhpelRFk4JZgVT/c+Ayecaw ejaXa/cXgd4COEneYntw/FjR7TIaoVJXc2sclktwoIJ3GNzXipxks6Mehc0RyhhoE3dr gKqWXCeIJ6AS61gNXkPzAGF5jJ7MfueEV7+rup9nTepWtoZN582Z/BeZLWPFMT1EfQtS sAz7u9E3uAs6EYrJMCdTa+C04Q5KAoWKJAa6ZfJ6mZVXKs7EXsajFtKZAA9ah5xQDk6L mm9MQXDPO9iqeOdPdHg1nnQiKEjng6XsEjiOP5TWb9s6fmGJYoETl/s8U6+kTNBkqT98 sh+w== X-Gm-Message-State: AGi0PuZNXOdd8GCDhS9PiiI4o81jLVoILvv7mjgfxeT3uxE0V6RsBdV+ 5RWbrKPyEgj+fFnBHQIFc4K68edKBa27PQ== X-Received: by 2002:a2e:864f:: with SMTP id i15mr750080ljj.179.1588657727848; Mon, 04 May 2020 22:48:47 -0700 (PDT) Received: from [192.168.0.103] (static-91-225-135-18.devs.futuro.pl. [91.225.135.18]) by smtp.gmail.com with ESMTPSA id g20sm989642lfj.1.2020.05.04.22.48.46 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 May 2020 22:48:47 -0700 (PDT) Subject: Re: [PATCH] Fix all coding-style warnings on lm75 driver To: Guenter Roeck Cc: jdelvare@suse.com, linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org References: <1588255534-28073-1-git-send-email-michalorzel.eng@gmail.com> <20200505015808.GA139531@roeck-us.net> From: =?UTF-8?B?TWljaGHFgiBPcnplxYI=?= Message-ID: Date: Tue, 5 May 2020 07:48:46 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: <20200505015808.GA139531@roeck-us.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05.05.2020 03:58, Guenter Roeck wrote: > On Thu, Apr 30, 2020 at 04:05:34PM +0200, Michal Orzel wrote: >> Check/fix all warnings generated by checkpatch.pl script on LM75 driver. >> >> Signed-off-by: Michal Orzel > > Applied, but for the future please prepend your patches with something like > "subsystem: driver:", or for hwmon "hwmon: (driver)". > > Also, please keep in mind that such cleanups are not encouraged unless you > also provide functional changes. > > Thanks, > Guenter > I will keep it in mind. Thanks, Michal >> --- >> drivers/hwmon/lm75.c | 8 ++++++-- >> drivers/hwmon/lm75.h | 31 +++++++++++++++++-------------- >> 2 files changed, 23 insertions(+), 16 deletions(-) >> >> diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c >> index 5e63922..ba0be48 100644 >> --- a/drivers/hwmon/lm75.c >> +++ b/drivers/hwmon/lm75.c >> @@ -797,8 +797,10 @@ static int lm75_detect(struct i2c_client *new_client, >> >> /* First check for LM75A */ >> if (i2c_smbus_read_byte_data(new_client, 7) == LM75A_ID) { >> - /* LM75A returns 0xff on unused registers so >> - just to be sure we check for that too. */ >> + /* >> + * LM75A returns 0xff on unused registers so >> + * just to be sure we check for that too. >> + */ >> if (i2c_smbus_read_byte_data(new_client, 4) != 0xff >> || i2c_smbus_read_byte_data(new_client, 5) != 0xff >> || i2c_smbus_read_byte_data(new_client, 6) != 0xff) >> @@ -849,6 +851,7 @@ static int lm75_suspend(struct device *dev) >> { >> int status; >> struct i2c_client *client = to_i2c_client(dev); >> + >> status = i2c_smbus_read_byte_data(client, LM75_REG_CONF); >> if (status < 0) { >> dev_dbg(&client->dev, "Can't read config? %d\n", status); >> @@ -863,6 +866,7 @@ static int lm75_resume(struct device *dev) >> { >> int status; >> struct i2c_client *client = to_i2c_client(dev); >> + >> status = i2c_smbus_read_byte_data(client, LM75_REG_CONF); >> if (status < 0) { >> dev_dbg(&client->dev, "Can't read config? %d\n", status); >> diff --git a/drivers/hwmon/lm75.h b/drivers/hwmon/lm75.h >> index b614e63..a398171 100644 >> --- a/drivers/hwmon/lm75.h >> +++ b/drivers/hwmon/lm75.h >> @@ -1,17 +1,15 @@ >> /* SPDX-License-Identifier: GPL-2.0-or-later */ >> /* >> - lm75.h - Part of lm_sensors, Linux kernel modules for hardware >> - monitoring >> - Copyright (c) 2003 Mark M. Hoffman >> - >> -*/ >> + * lm75.h - Part of lm_sensors, Linux kernel modules for hardware monitoring >> + * Copyright (c) 2003 Mark M. Hoffman >> + */ >> >> /* >> - This file contains common code for encoding/decoding LM75 type >> - temperature readings, which are emulated by many of the chips >> - we support. As the user is unlikely to load more than one driver >> - which contains this code, we don't worry about the wasted space. >> -*/ >> + * This file contains common code for encoding/decoding LM75 type >> + * temperature readings, which are emulated by many of the chips >> + * we support. As the user is unlikely to load more than one driver >> + * which contains this code, we don't worry about the wasted space. >> + */ >> >> #include >> >> @@ -20,18 +18,23 @@ >> #define LM75_TEMP_MAX 125000 >> #define LM75_SHUTDOWN 0x01 >> >> -/* TEMP: 0.001C/bit (-55C to +125C) >> - REG: (0.5C/bit, two's complement) << 7 */ >> +/* >> + * TEMP: 0.001C/bit (-55C to +125C) >> + * REG: (0.5C/bit, two's complement) << 7 >> + */ >> static inline u16 LM75_TEMP_TO_REG(long temp) >> { >> int ntemp = clamp_val(temp, LM75_TEMP_MIN, LM75_TEMP_MAX); >> + >> ntemp += (ntemp < 0 ? -250 : 250); >> return (u16)((ntemp / 500) << 7); >> } >> >> static inline int LM75_TEMP_FROM_REG(u16 reg) >> { >> - /* use integer division instead of equivalent right shift to >> - guarantee arithmetic shift and preserve the sign */ >> + /* >> + * use integer division instead of equivalent right shift to >> + * guarantee arithmetic shift and preserve the sign >> + */ >> return ((s16)reg / 128) * 500; >> } >> -- >> 2.7.4 >>