Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp5617399pxb; Mon, 28 Mar 2022 15:02:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwvdCOfx9V2x8j7USCPZcAG4Pxil2rekGy0S/XZBN3/zlz3fwy42OYjOL3NBnclxnx8wn+ X-Received: by 2002:a54:4010:0:b0:2ec:f4e0:8acb with SMTP id x16-20020a544010000000b002ecf4e08acbmr646955oie.97.1648504946608; Mon, 28 Mar 2022 15:02:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648504946; cv=none; d=google.com; s=arc-20160816; b=Y5vuIOFuS9oez0isM+908e/GSOyf7c4/Bz1o7r7oOfjpj3bHpD3PCwvjqoO38Nn+RT hw8TmpUh2BV1kpy/KLiIZQQ9dPTgnlVjMtqAJOoAekw0sfAIoteud02bmfhswIuNloiq ioagluB4B3Rh/k6UohOj81q1fcJ/a4BF2yt4DeReBivHBBnfQdOcJ/OcDSNmI0RKnaK/ J53AcbFYz7OvLI9AIolSJJ4+Ix/b3Go2/Sa7wiM0z7o+qjsaKj1kpScz5cbpCb8iwKkd sXPgMtqgJ0UPmQVA27NN1GLElbzzRNbHWROi+Ho/0/GXpm9bwOASjmKodEwoftqQK6F9 uBYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=2xo1+5DpBZv2rMlJsCuJAx12gnZ30rIkpeYIsihgROQ=; b=Aazn5gMvCUwwB5F8qOsuUsKByLW4jjYVe5fQxEMoTJtilvkJVfxfm48C5nvk5y5Ntp c1d5pFlSapXV3pyT7CgiSvIQM4cBBKEzc5OvSiRNB7xpvJZoF+lqQopdnGzVmN7uq5hi nCHItXbnH3wcA9/OUfboRtAiIAQF2vdoTcGiHKNQnumBjrg/okrRcfEhxWQ/oc9Nf0Xa +7wh74LFOdjt3rwZwBrSbXUrQnPOnnJc4BGSRm4oGT3g6Q+NVYnxLL4W5FBhqm9WYCBP TkValFeCZgk/UQjrITHlkC+6e8f0ZY0bLy9JobScvymMz0VI8q3qZ5bpYcg0xolvuEx/ Zikw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id x3-20020a056830114300b005cb2fc13898si12024593otq.276.2022.03.28.15.02.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Mar 2022 15:02:26 -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; 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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2330D6832C; Mon, 28 Mar 2022 14:27:06 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242264AbiC1TTj (ORCPT + 99 others); Mon, 28 Mar 2022 15:19:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234167AbiC1TTi (ORCPT ); Mon, 28 Mar 2022 15:19:38 -0400 Received: from mail.thepaulodoom.com (www.thepaulodoom.com [45.77.108.202]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1A88766C9A; Mon, 28 Mar 2022 12:17:55 -0700 (PDT) Received: from hp-amd-paul (c-98-240-189-147.hsd1.mn.comcast.net [98.240.189.147]) by vultr.guest (OpenSMTPD) with ESMTPSA id 19d4373f (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Mon, 28 Mar 2022 19:17:53 +0000 (UTC) Date: Mon, 28 Mar 2022 14:17:51 -0500 From: Paul Lemmermann To: Jonathan Cameron Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] IIO: accel: fixed coding style issues Message-ID: References: <20220328180623.1380d23e@jic23-huawei> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220328180623.1380d23e@jic23-huawei> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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, 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. > > 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); > > >