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=-8.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,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 27A37C47256 for ; Tue, 5 May 2020 05:48:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F154720663 for ; Tue, 5 May 2020 05:48:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="tUQk5WHT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725768AbgEEFsu (ORCPT ); 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-Google-Smtp-Source: APiQypLrS97ESMZ1bmwkR1k5TAF+7cc8KaEokiEguxHbpPIWE6LxWEmXImDJ2ul57nuERrvl+BkZzA== 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-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@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 >>