Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp187979ybj; Mon, 4 May 2020 19:00:03 -0700 (PDT) X-Google-Smtp-Source: APiQypIFn1ghpIfUQ2BFDuRjECClykStFevC2hXMRHGWvcHltq1QptwO0MPtKWPaeXfTquaLK9bS X-Received: by 2002:a17:906:2488:: with SMTP id e8mr564283ejb.157.1588644003079; Mon, 04 May 2020 19:00:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588644003; cv=none; d=google.com; s=arc-20160816; b=TWV2d/BD2gq4vNPdj1VORNXd6cL/j4uW/Zd2NFU7iLIrGrrrEpnXo/0Myclyl17q80 KpyQlGTaL0CgUmn19XnXzQCA2HwDinS4I/AjC2Stqyers5zKAna4yKKD+hhLf1yHWD7t +a7UcSI9jepAlE9X0Daslj6qv9ybJkkQk5f7YsrRIWEpHLZYpc12v6XmK5eiq6I/s9Au x+L6LHMs2GpUwc1rPls1GT+1SWAR5AK6FxICeQZQ8vmvuieFuLXo+piKakqp//auHhWQ 06b/1mDA50cdpZkvKFWooFY6sEy0pmcJsMZiMAiuvCpHVvQU74y4ux6CimyBjwosesw8 l1sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=iFj80LRwMRvCtXO1RDtLVy/aid0h2CgjaTRQRdfP1mU=; b=t6fNoFMEunQE41/h+8XSsC24U5ArMb3qO7gplrWfvIQmN+0v0dYuhWD11FydjlDCov lxVByTsMm3joicXDhwNC4FwH/4JnPfEeEhqJg3DvoM40UvBqUO/PNvHRif7zn6JvHd8J wu5g6vYfCnlJcW/5yERwzgpvnebZXk+/jfr1zidHrjpYihmwFTcei/z6CZtKOc3dQcg5 jXsQnO8cxK3z2UUfKNIhbUr/O++OOUUJhYYPERa9N06WB15HHG20wkb9GzK0YPGLD6Nl 7yknRmaSr8AHCYSe+7XVNRDJgBzXSAxb+9yD/r0ojftYcaTxKHHr76FA5UMQOVNTe5mW VV9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=sMGEMCl0; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i17si526805edu.511.2020.05.04.18.59.39; Mon, 04 May 2020 19:00:03 -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=fail header.i=@gmail.com header.s=20161025 header.b=sMGEMCl0; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727102AbgEEB6M (ORCPT + 99 others); Mon, 4 May 2020 21:58:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726482AbgEEB6M (ORCPT ); Mon, 4 May 2020 21:58:12 -0400 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E613C061A0F; Mon, 4 May 2020 18:58:10 -0700 (PDT) Received: by mail-pl1-x643.google.com with SMTP id h11so165143plr.11; Mon, 04 May 2020 18:58:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=iFj80LRwMRvCtXO1RDtLVy/aid0h2CgjaTRQRdfP1mU=; b=sMGEMCl0KBrFfVmFnIgHJjbeeE9+mxkaSMyj2H/U4/qsfiJo3bjt42kPbeU1C7bi4N DR0rRPV1p2ycQI9nX6WgVyT3poc68xlUXsi8BNO2aE60kLfOeEltvR9Aq7TzqZ4aGQJy kk753Zjpp+fdHKZONWhyhRu5unKWyZkkge0ggW4hL3onny954QlbIx6GrwS48gHgWTl0 Uh8gEQYZtNEq7i/+iQBmUGkkaQXa9F+N296OE/4bsENzVq3FRmPMsjZ4Bg73P7iJfb0N e6fte1gt/2arV4i7cf5CTMz3Fdo7GRunZ1TEz7zSqUyj9Rl74ojcBPesL1VoJQVKpFW2 qU/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=iFj80LRwMRvCtXO1RDtLVy/aid0h2CgjaTRQRdfP1mU=; b=LlCQMiO8/m8Ly5WFbVItUADr7KricYz9+CKKRXDuvaFXE1H11uVuOtyTN+ALDTAha6 z1vVHF5Jta8ARUsRurUCVSKVeiM/F/WIBGF34uj0ZisXOYeXoQz7jmdxi8z4uNxEgFCh 2O7hm4EVMmqXoFyheJInky9vs3UW1Dx8sQgfAj2vjxOYSnx9dgnVxrXcbE2TG80ZUJqy pd0o17L7kAABixL8sV+jFCFgvmPDjQt0nEsHv6ackJfMfsSLDv25mqwdK87JBUOR1xVk oqdVCQRWvacKkgeWQI8L7no/YfFJcXPlyBAZplG7ALu617qNBaSvOUR2m/KN76s6QeuE /UJw== X-Gm-Message-State: AGi0Pua9DQ8b2G+E14UFL2DV7vRt16jaW+xChP82C955UYGIIUFNVve/ wxyUbvlY1mTd8JUpG063h4Q= X-Received: by 2002:a17:90a:5aa7:: with SMTP id n36mr21456pji.45.1588643889930; Mon, 04 May 2020 18:58:09 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id r26sm376481pfq.75.2020.05.04.18.58.09 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 May 2020 18:58:09 -0700 (PDT) Date: Mon, 4 May 2020 18:58:08 -0700 From: Guenter Roeck To: Michal Orzel Cc: jdelvare@suse.com, linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Fix all coding-style warnings on lm75 driver Message-ID: <20200505015808.GA139531@roeck-us.net> References: <1588255534-28073-1-git-send-email-michalorzel.eng@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1588255534-28073-1-git-send-email-michalorzel.eng@gmail.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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 >