Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp3513910pxb; Mon, 4 Apr 2022 19:27:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/+nIbTFgrvVaUPzP3r/SB1PUfEh8NDDSKS5fx5FWy71RpqRI9WluIhkShm+9Ri5zi6DAN X-Received: by 2002:a17:902:ce81:b0:156:ad26:78b1 with SMTP id f1-20020a170902ce8100b00156ad2678b1mr1259612plg.144.1649125659986; Mon, 04 Apr 2022 19:27:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649125659; cv=none; d=google.com; s=arc-20160816; b=fTeFNwSCLbXoRafZ6SS1akdgRlUal4dS5f7AB4fzat+RrfKW6gKddjAQiV6OYiXINP O5Ka/NgEvR7ppQGtB1ArNfDLWTnh+J4ZjBR/p9s6LX11phOFniE2LfPvC/34oh7JOihw vfoocmrb+afWvkQHAnyYjDE2I3CtNp5i0TURtjxjMGPw6ZHwMgkb4M153nZkutQ5aAOr DfWckgZA3DBWXpEEUAXSv/fwdSu4G06TXkzBBGX1LO2atff5mn8VY/tGtN9mQJKiEklB 6Vl3hhzmE8XD6l/MKcLiy9s6gJyH8Yqxg2/CiITgWgP+1PGCp8k8uZMSRm3e5ViKNxam v3aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=H7kIrTfjdOsbSPnkqhHCK2+eBZl4vuSXc4X3JUfsw4Y=; b=Dy/V4NsKUYf+LK/FO7UrFbfuFLQqZUdhclsJTx0LdCWY6nx8hvWc8bWIEtknVERb7g i//N2tKpGVTseT0jj6+O6jMlSWesi3HAl3a6lEJHxkNkoZfATFAp7Z5zH/yooDVs/aiq L88RIWxvyd7cu0fxCYguZZBjmuMfiQs4L4kgyTqVdo9VYmlfldE8j4krfYpjeME9bFR9 ZbZL46zd+4/mP/2tDUlOIKLnskF32dRzC/0h1Rk8ntaDjSSP3Od1srw3k8snxyvFriVc bjluzHDCvUXUtfuPNugwdGLUSblTAqEvsvDzM2554qsgSfO5vOp6KCLwK8ZKN1rrpXVH OF7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Hn+y7TS8; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id u7-20020a17090a890700b001ca238ff4dfsi867667pjn.64.2022.04.04.19.27.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Apr 2022 19:27:39 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Hn+y7TS8; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A66FA42F355; Mon, 4 Apr 2022 17:50:08 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358044AbiDBQ3Y (ORCPT + 99 others); Sat, 2 Apr 2022 12:29:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345180AbiDBQ3X (ORCPT ); Sat, 2 Apr 2022 12:29:23 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35B2A158D9C; Sat, 2 Apr 2022 09:27:30 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E277DB80AB2; Sat, 2 Apr 2022 16:27:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 67D2BC340F3; Sat, 2 Apr 2022 16:27:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648916847; bh=m6wRN/Ozv9b5FQGVEHdRnB+vvT2QvfMHvXSoL21Mhc4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Hn+y7TS8hLCS2OAWIiI17VtbVNBAVhCgS/91kyR+Xq7JA0MBeX+IInlwvj0hxTKNS JAHrg5T2sSPLxFRitJ3dqnfFdcDiV3Q3B335zPsPYozns8cNxuB8Lvjw5+I0Kx5zdF NbO5ouy+9XNBr+OSVTNm7RQa8eCfxQoO+YESQnecNl/Y2CSgM9oAA2+ZE/bcD/8CPZ 8dbJphB5b+SZMI8hxpi6pqm4qhSlkw7/+jgjsG+1C8cgxAsI0iJj2+L9xR5Js5iENZ f+v7U7ZV1hXvuwthxnSnuyJ0gF9eq22ARVuWoKw9U3rx/Zx5IW/V+MEVMvvbNGu2JR eFy/eJv0N3erg== Date: Sat, 2 Apr 2022 17:35:10 +0100 From: Jonathan Cameron To: Paul Lemmermann Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] IIO: accel: fixed coding style issues Message-ID: <20220402173510.2b38e261@jic23-huawei> In-Reply-To: References: <20220328180623.1380d23e@jic23-huawei> X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 28 Mar 2022 14:17:51 -0500 Paul Lemmermann wrote: > On Mon, Mar 28, 2022 at 06:06:23PM +0100, Jonathan Cameron wrote: > > On Mon, 28 Mar 2022 10:05:08 -0500 > > Paul Lemmermann wrote: > > > > > Fixed case statement issues and spacing issues. > > > > > > Signed-off-by: Paul Lemmermann > > Hi Paul, > > > > Thanks for the patch. > > > > These are drivers written / maintained by different authors, so one > > patch per driver preferred. Particularly handy as people might not > > agree with all of them so separate patches would allow me to pick > > and choose which ones to pick up. > > > > Comments inline. > > > > Please state how you identified the changes btw. Script? > > I used the checkpatch.pl script to identify these changes. Please mention that in patch descriptions in future. It's useful to anyone tracking this sort of information. I added it to the broken out patches whilst applying. Thanks, Jonathan > > > > > Jonathan > > > > > --- > > > drivers/iio/accel/bmc150-accel-core.c | 15 +++++++++++---- > > > drivers/iio/accel/dmard09.c | 2 +- > > > drivers/iio/accel/kxsd9-spi.c | 4 ++-- > > > 3 files changed, 14 insertions(+), 7 deletions(-) > > > > > > diff --git a/drivers/iio/accel/bmc150-accel-core.c b/drivers/iio/accel/bmc150-accel-core.c > > > index d11f66801..f7dd7ec2c 100644 > > > --- a/drivers/iio/accel/bmc150-accel-core.c > > > +++ b/drivers/iio/accel/bmc150-accel-core.c > > > @@ -432,10 +432,17 @@ static bool bmc150_apply_bosc0200_acpi_orientation(struct device *dev, > > > > > > for (j = 0; j < 3; j++) { > > > switch (val[j]) { > > > - case -1: str = "-1"; break; > > > - case 0: str = "0"; break; > > > - case 1: str = "1"; break; > > > - default: goto unknown_format; > > > + case -1: > > > + str = "-1"; > > > + break; > > > + case 0: > > > + str = "0"; > > > + break; > > > + case 1: > > > + str = "1"; > > > + break; > > > + default: > > > + goto unknown_format; > > > > I'm not seeing any clear advantage to this change. > > > The reason for this change is that most, if not all, case statements in > the kernel are multiple lines. Also, in the kernel docs (https://docs.kernel.org/process/coding-style.html) > it says, to not put multiple statements on one line. > > Thanks, > Paul > > > > > } > > > orientation->rotation[i * 3 + j] = str; > > > } > > > diff --git a/drivers/iio/accel/dmard09.c b/drivers/iio/accel/dmard09.c > > > index e6e28c964..87bc38d4d 100644 > > > --- a/drivers/iio/accel/dmard09.c > > > +++ b/drivers/iio/accel/dmard09.c > > > @@ -24,7 +24,7 @@ > > > #define DMARD09_AXIS_Y 1 > > > #define DMARD09_AXIS_Z 2 > > > #define DMARD09_AXIS_X_OFFSET ((DMARD09_AXIS_X + 1) * 2) > > > -#define DMARD09_AXIS_Y_OFFSET ((DMARD09_AXIS_Y + 1 )* 2) > > > +#define DMARD09_AXIS_Y_OFFSET ((DMARD09_AXIS_Y + 1) * 2) > > > > This is one is good. > > > > > #define DMARD09_AXIS_Z_OFFSET ((DMARD09_AXIS_Z + 1) * 2) > > > > > > struct dmard09_data { > > > diff --git a/drivers/iio/accel/kxsd9-spi.c b/drivers/iio/accel/kxsd9-spi.c > > > index 57c451cfb..989f53fb0 100644 > > > --- a/drivers/iio/accel/kxsd9-spi.c > > > +++ b/drivers/iio/accel/kxsd9-spi.c > > > @@ -44,8 +44,8 @@ static const struct spi_device_id kxsd9_spi_id[] = { > > > MODULE_DEVICE_TABLE(spi, kxsd9_spi_id); > > > > > > static const struct of_device_id kxsd9_of_match[] = { > > > - { .compatible = "kionix,kxsd9" }, > > > - { }, > > > + { .compatible = "kionix,kxsd9" }, > > > > Also good to clean up. > > > > Thanks, > > > > Jonathan > > > > > > > + { }, > > > }; > > > MODULE_DEVICE_TABLE(of, kxsd9_of_match); > > > > >