Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp1089483rdb; Sat, 18 Nov 2023 02:41:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IFe0YlszdO4vnMjVUfMVahChKTsKDo+H4g8slc4XnUN7AIwABByCdOPqVxUjzHjxJYWxrko X-Received: by 2002:a05:6a20:441f:b0:181:7d6d:c10b with SMTP id ce31-20020a056a20441f00b001817d6dc10bmr2741482pzb.7.1700304087558; Sat, 18 Nov 2023 02:41:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700304087; cv=none; d=google.com; s=arc-20160816; b=srG9+ryFdBuJRjVUBdeoW8Gvq20eHG3N89EMcHH3J7cAqMGfD8caHSIlI7hh7LI56K 07VZLCDIfx0qKTCc7AR7IwWw8I+KTr/9ovADwLvgYOLcyP/SPEaNf4s0h+nptLlO6VtH gej8bjyr/puz26C3IVjG0fwby4PIy+3HLyvtY6ZyaRqEDTS2Z9A7ibMn5fOFsfk9eqSf ZFsGQWdfFV1XqRmvtHVc32G6fErpGq+6j2cymz7+dq+huivX8QmCTgUksgRdnJ9luLWK FWyoQgHhQqqqDtRL8I9b5GEB6Fuo9BqyuNiAdRokmTp9wRrOaJ0xTVKiZq1cIiWeIn/i oXgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:references:message-id:subject:cc:to :from:date:content-transfer-encoding:mime-version:dkim-signature; bh=s+vmYEizRzf8bfVVb97xzqzCYoZPJrcnKRY1W4UPAgs=; fh=0swXziBxSLSNi4Ceof73m9RPCrLiCrNmi7gkLgIE1wo=; b=Q0GClxDftfFnFPT1jpwfo6fzoERmXjoqUZd/jCeYxwgYux/iG0+03Zx0h+L7ZItyyl 5pI626MZKG+hkc/1+f0t92Dx40QhhxmW2l8MZt0tRbGsYf8xMLmgsYvW65/VYCFSsmfQ MXrtwCSid5yXnaNBIBNQq+5sum7YffDk9q0xmB+WgPEOIEryVEawgksOGfdvWWDDYQSp Bnm8oJIHwcy/+rquR8cd0tqzzky1ohyCLQJQfCONTlU1bVuTTJdWlsLwg6gXXBTLGthn vYXOSXHhpLEclga9nKFlDNWwz8jFZSrFUaAltgQuDw5sCp2QxxqruZts/VHkTmaJ/4m+ zYQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=oLWhOnzJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id 1-20020a631041000000b00565dd108fd4si3839362pgq.115.2023.11.18.02.41.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Nov 2023 02:41:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=oLWhOnzJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 2FEFD801F4FA; Sat, 18 Nov 2023 02:41:24 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229469AbjKRKg2 (ORCPT + 99 others); Sat, 18 Nov 2023 05:36:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229449AbjKRKg1 (ORCPT ); Sat, 18 Nov 2023 05:36:27 -0500 Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.66]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4F53D75 for ; Sat, 18 Nov 2023 02:36:19 -0800 (PST) Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 7FB44240105 for ; Sat, 18 Nov 2023 11:36:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1700303777; bh=NX9gCi73wwTwdwKip7o7APQwlao0YIT5W8yeNUhkgck=; h=Mime-Version:Content-Transfer-Encoding:Date:From:To:Cc:Subject: Message-Id:From; b=oLWhOnzJU5LxXKLAETBkTbP7vrjooCWKW2qk/pLuBRAPQPhwHzpOAw0JFQujy++0H DtpkIRZqz/Vebs8uPCogAEp1YICgAM0pAs9QbUJFQpqBLGhlWmK0bV4fFVs9cOm7PD n0eVWOR+9bIN9RWNTjHKJncmGhGzYGMAS4kC89z1TLy86VqbAtmTYb/tGAjQvZbtBI 8YzN0uSGk16cefMw5hO0KVt37tRgSPdNkXeyFYK+53TziHQw0nvqaOG7sGdFZaZMgK GjvqevLJkTBSuJPo6Kucbjs0lBOOEUpjnSXgoZfEBWRu6iBR4ix6jZqj+oFOVEMiK1 G+wkDcdmiYOhw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4SXVYV2hG0z6twV; Sat, 18 Nov 2023 11:36:14 +0100 (CET) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Sat, 18 Nov 2023 10:36:16 +0000 From: "Charalampos Mitrodimas" To: "Bagas Sanjaya" , "Sebastian Reichel" , "Rafael J. Wysocki" , "Mario Limonciello" , "qinyu" , "Nick Alcock" , "Greg Kroah-Hartman" , "Huacai Chen" , "Kai-Heng Feng" , "Andreas Kemnade" , "Ian Molton" , "Szabolcs Gyurko" , "Anton Vorontsov" Cc: "Linux Power Management" , "Linux Kernel Mailing List" Subject: Re: [PATCH] power: supply: Fix indentation and some other warnings Message-Id: References: <20231117230658.65809-1-charmitro@posteo.net> In-Reply-To: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Sat, 18 Nov 2023 02:41:24 -0800 (PST) Hi Bagas, On Sat Nov 18, 2023 at 1:36 AM EET, Bagas Sanjaya wrote: > On Fri, Nov 17, 2023 at 11:06:58PM +0000, Charalampos Mitrodimas wrote: > > These were mentioned by checkpatch: > > Errors: > > (1) code indent should use tabs where possible > > (2) switch and case should be at the same indent > > Warnings: > > (1) quoted string split across lines > > (2) Missing a blank line after declarations > >=20 > > Based on this comment from "include/linux/module.h", modules with > > multiple authors should use multiple MODULE_AUTHOR() statements. > > /* > > * Author(s), use "Name " or just "Name", for multiple > > * authors use multiple MODULE_AUTHOR() statements/lines. > > */ > > #define MODULE_AUTHOR(_author) MODULE_INFO(author, _author) > > Shouldn't MODULE_AUTHOR fix be separate patch? Sorry, I should have mentioned in the commit that the warnings "quoted string split across lines" pertained to the MODULE_AUTHOR line.=20 In the commit message I'm just clarifying why I used multiple MODULE_AUTHOR statements. Should I send a v2 patch with a revised commit description? > > >=20 > > Signed-off-by: Charalampos Mitrodimas > > --- > > drivers/power/supply/power_supply_core.c | 167 ++++++++++++----------- > > 1 file changed, 84 insertions(+), 83 deletions(-) > >=20 > > diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/s= upply/power_supply_core.c > > index 73265001dd4b..ecef35ac3b7e 100644 > > --- a/drivers/power/supply/power_supply_core.c > > +++ b/drivers/power/supply/power_supply_core.c > > @@ -861,44 +861,44 @@ const size_t power_supply_battery_info_properties= _size =3D ARRAY_SIZE(power_supply > > EXPORT_SYMBOL_GPL(power_supply_battery_info_properties_size); > > =20 > > bool power_supply_battery_info_has_prop(struct power_supply_battery_in= fo *info, > > - enum power_supply_property psp) > > + enum power_supply_property psp) > > Looks OK. > > > { > > if (!info) > > return false; > > =20 > > switch (psp) { > > - case POWER_SUPPLY_PROP_TECHNOLOGY: > > - return info->technology !=3D POWER_SUPPLY_TECHNOLOGY_UNKNOWN; > > - case POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN: > > - return info->energy_full_design_uwh >=3D 0; > > - case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN: > > - return info->charge_full_design_uah >=3D 0; > > - case POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN: > > - return info->voltage_min_design_uv >=3D 0; > > - case POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN: > > - return info->voltage_max_design_uv >=3D 0; > > - case POWER_SUPPLY_PROP_PRECHARGE_CURRENT: > > - return info->precharge_current_ua >=3D 0; > > - case POWER_SUPPLY_PROP_CHARGE_TERM_CURRENT: > > - return info->charge_term_current_ua >=3D 0; > > - case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX: > > - return info->constant_charge_current_max_ua >=3D 0; > > - case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX: > > - return info->constant_charge_voltage_max_uv >=3D 0; > > - case POWER_SUPPLY_PROP_TEMP_AMBIENT_ALERT_MIN: > > - return info->temp_ambient_alert_min > INT_MIN; > > - case POWER_SUPPLY_PROP_TEMP_AMBIENT_ALERT_MAX: > > - return info->temp_ambient_alert_max < INT_MAX; > > - case POWER_SUPPLY_PROP_TEMP_ALERT_MIN: > > - return info->temp_alert_min > INT_MIN; > > - case POWER_SUPPLY_PROP_TEMP_ALERT_MAX: > > - return info->temp_alert_max < INT_MAX; > > - case POWER_SUPPLY_PROP_TEMP_MIN: > > - return info->temp_min > INT_MIN; > > - case POWER_SUPPLY_PROP_TEMP_MAX: > > - return info->temp_max < INT_MAX; > > - default: > > - return false; > > + case POWER_SUPPLY_PROP_TECHNOLOGY: > > + return info->technology !=3D POWER_SUPPLY_TECHNOLOGY_UNKNOWN; > > + case POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN: > > + return info->energy_full_design_uwh >=3D 0; > > + case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN: > > + return info->charge_full_design_uah >=3D 0; > > + case POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN: > > + return info->voltage_min_design_uv >=3D 0; > > + case POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN: > > + return info->voltage_max_design_uv >=3D 0; > > + case POWER_SUPPLY_PROP_PRECHARGE_CURRENT: > > + return info->precharge_current_ua >=3D 0; > > + case POWER_SUPPLY_PROP_CHARGE_TERM_CURRENT: > > + return info->charge_term_current_ua >=3D 0; > > + case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX: > > + return info->constant_charge_current_max_ua >=3D 0; > > + case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX: > > + return info->constant_charge_voltage_max_uv >=3D 0; > > + case POWER_SUPPLY_PROP_TEMP_AMBIENT_ALERT_MIN: > > + return info->temp_ambient_alert_min > INT_MIN; > > + case POWER_SUPPLY_PROP_TEMP_AMBIENT_ALERT_MAX: > > + return info->temp_ambient_alert_max < INT_MAX; > > + case POWER_SUPPLY_PROP_TEMP_ALERT_MIN: > > + return info->temp_alert_min > INT_MIN; > > + case POWER_SUPPLY_PROP_TEMP_ALERT_MAX: > > + return info->temp_alert_max < INT_MAX; > > + case POWER_SUPPLY_PROP_TEMP_MIN: > > + return info->temp_min > INT_MIN; > > + case POWER_SUPPLY_PROP_TEMP_MAX: > > + return info->temp_max < INT_MAX; > > + default: > > + return false; > > } > > This one LGTM. > > > } > > EXPORT_SYMBOL_GPL(power_supply_battery_info_has_prop); > > @@ -914,53 +914,53 @@ int power_supply_battery_info_get_prop(struct pow= er_supply_battery_info *info, > > return -EINVAL; > > =20 > > switch (psp) { > > - case POWER_SUPPLY_PROP_TECHNOLOGY: > > - val->intval =3D info->technology; > > - return 0; > > - case POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN: > > - val->intval =3D info->energy_full_design_uwh; > > - return 0; > > - case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN: > > - val->intval =3D info->charge_full_design_uah; > > - return 0; > > - case POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN: > > - val->intval =3D info->voltage_min_design_uv; > > - return 0; > > - case POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN: > > - val->intval =3D info->voltage_max_design_uv; > > - return 0; > > - case POWER_SUPPLY_PROP_PRECHARGE_CURRENT: > > - val->intval =3D info->precharge_current_ua; > > - return 0; > > - case POWER_SUPPLY_PROP_CHARGE_TERM_CURRENT: > > - val->intval =3D info->charge_term_current_ua; > > - return 0; > > - case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX: > > - val->intval =3D info->constant_charge_current_max_ua; > > - return 0; > > - case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX: > > - val->intval =3D info->constant_charge_voltage_max_uv; > > - return 0; > > - case POWER_SUPPLY_PROP_TEMP_AMBIENT_ALERT_MIN: > > - val->intval =3D info->temp_ambient_alert_min; > > - return 0; > > - case POWER_SUPPLY_PROP_TEMP_AMBIENT_ALERT_MAX: > > - val->intval =3D info->temp_ambient_alert_max; > > - return 0; > > - case POWER_SUPPLY_PROP_TEMP_ALERT_MIN: > > - val->intval =3D info->temp_alert_min; > > - return 0; > > - case POWER_SUPPLY_PROP_TEMP_ALERT_MAX: > > - val->intval =3D info->temp_alert_max; > > - return 0; > > - case POWER_SUPPLY_PROP_TEMP_MIN: > > - val->intval =3D info->temp_min; > > - return 0; > > - case POWER_SUPPLY_PROP_TEMP_MAX: > > - val->intval =3D info->temp_max; > > - return 0; > > - default: > > - return -EINVAL; > > + case POWER_SUPPLY_PROP_TECHNOLOGY: > > + val->intval =3D info->technology; > > + return 0; > > + case POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN: > > + val->intval =3D info->energy_full_design_uwh; > > + return 0; > > + case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN: > > + val->intval =3D info->charge_full_design_uah; > > + return 0; > > + case POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN: > > + val->intval =3D info->voltage_min_design_uv; > > + return 0; > > + case POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN: > > + val->intval =3D info->voltage_max_design_uv; > > + return 0; > > + case POWER_SUPPLY_PROP_PRECHARGE_CURRENT: > > + val->intval =3D info->precharge_current_ua; > > + return 0; > > + case POWER_SUPPLY_PROP_CHARGE_TERM_CURRENT: > > + val->intval =3D info->charge_term_current_ua; > > + return 0; > > + case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX: > > + val->intval =3D info->constant_charge_current_max_ua; > > + return 0; > > + case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX: > > + val->intval =3D info->constant_charge_voltage_max_uv; > > + return 0; > > + case POWER_SUPPLY_PROP_TEMP_AMBIENT_ALERT_MIN: > > + val->intval =3D info->temp_ambient_alert_min; > > + return 0; > > + case POWER_SUPPLY_PROP_TEMP_AMBIENT_ALERT_MAX: > > + val->intval =3D info->temp_ambient_alert_max; > > + return 0; > > + case POWER_SUPPLY_PROP_TEMP_ALERT_MIN: > > + val->intval =3D info->temp_alert_min; > > + return 0; > > + case POWER_SUPPLY_PROP_TEMP_ALERT_MAX: > > + val->intval =3D info->temp_alert_max; > > + return 0; > > + case POWER_SUPPLY_PROP_TEMP_MIN: > > + val->intval =3D info->temp_min; > > + return 0; > > + case POWER_SUPPLY_PROP_TEMP_MAX: > > + val->intval =3D info->temp_max; > > + return 0; > > + default: > > + return -EINVAL; > > And this one too. > > > @@ -1636,6 +1637,6 @@ subsys_initcall(power_supply_class_init); > > module_exit(power_supply_class_exit); > > =20 > > MODULE_DESCRIPTION("Universal power supply monitor class"); > > -MODULE_AUTHOR("Ian Molton , " > > - "Szabolcs Gyurko, " > > - "Anton Vorontsov "); > > +MODULE_AUTHOR("Ian Molton "); > > +MODULE_AUTHOR("Szabolcs Gyurko"); > > +MODULE_AUTHOR("Anton Vorontsov "); > > And also this one. > > Thanks. > > --=20 > An old man doll... just what I always wanted! - Clara Thanks