Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp3728638rwr; Sat, 22 Apr 2023 10:25:58 -0700 (PDT) X-Google-Smtp-Source: AKy350btiTfB/IcEUSggt79dfGLQnDZYLZvctvMlr91m2yyz6arQYRfaZR2h9SQXrBQQaRDVF3al X-Received: by 2002:a17:90a:1c4:b0:247:2baf:d6f with SMTP id 4-20020a17090a01c400b002472baf0d6fmr7432546pjd.0.1682184357775; Sat, 22 Apr 2023 10:25:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682184357; cv=none; d=google.com; s=arc-20160816; b=uQwRIvMkU9q7cen/LJ8HynGTXMz0JYyP3rUWuNHHrUV5sTUVW5tr6x4B9GnemoRIwM OFmfSh4l8Ma8qyRifrMulpdci4BlpI2BYZfbMyd2d2z23I8h1lzXuhNq985jJqQ+qLq0 34kpBHTNZThB4u6nhz7l9PXE7JR3TeKO3O3zhYvfdtltfWd6eXVi1KIkDorGxRxGw97m wxHG6JY1Nxa/RRpyFdcMHRhYwz6mu9rJC/bCtAVYE/iKDM1qYu9d3FLTuWorGh+k/g1E 1sxqYXkh7j1kSlhv3KI7yEPy02nHocJFkgXv6lDGnWGFcgZglsIDBJaZaHgLpx7e+we8 uRbw== 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=kf6v/hVoyOFZlcUuInNtcuncAPraH39DEw7vrkf9H4U=; b=mQtN5rCFARmNctZNbQDjc4i7oVOYZdiBoRtTs+VjQSptXEIktXKqow4MQQa7x90qTv vwEaVvHT6qSLZIUlMH2nteY+QPgAqIX1Acyz3qLCeo58Lpd0b6jMo5kcbKzkOZaiXKfM IgKLR1FS0YCXk05N/zD61xmJ49GXtnj4i47P6NhlZGCG2aS66px64C2F1TuiYrqrY8Xf D4LADWSX5VaL+Coh8826m0xVkBkB6GkDWPy2bJ1m3zKzxKhOoCaWzaldh1w8V5kkPtqA tUR6gSNhYvta8A2KfxElc3eMhixDmjErccxT1MVDzikP3KPPzSgR5T+HuVH//f/mB9xX qaGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=C460z3yo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s14-20020a170902ea0e00b001a2104d7075si8305150plg.72.2023.04.22.10.25.43; Sat, 22 Apr 2023 10:25:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=C460z3yo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229748AbjDVRUx (ORCPT + 99 others); Sat, 22 Apr 2023 13:20:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229709AbjDVRUw (ORCPT ); Sat, 22 Apr 2023 13:20:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A83B81BF7; Sat, 22 Apr 2023 10:20:51 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 4134A60C4C; Sat, 22 Apr 2023 17:20:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 54C13C433D2; Sat, 22 Apr 2023 17:20:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1682184050; bh=cIQuCz8u4AbAcBTD2r/vRJGi7bq6y7dNdryxv6xoeuI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=C460z3yojPveSL1nGLapR0QotW1EIsTRJEje35+TCXfQfDuzPW5D728J31F2adbr6 i8hBgD92vSclN1DTuMaNang45xX/wWGjVGVpcmz2LBmwhqXXNK5XtGo9QYgjaXy6TI PkfR7z4sbasyUS1EqVPJ6RYnrq6+fv+Se/M2L1Ehi/MO8SQi8zJVHypSwvh0DXU2SV fRDkTjKLnZCxCuxRyY18n4bAtfgrGlICntYPw54907rJtpvYWSrpPETHqAcPwUlJu0 sBIDB9eyLzVJfi2ZWlLK4h9iFUB/FL71TeTUzt6Rs4KEg+kFHXsa0QI0nos3749WPh bvKVfsRO+zRDQ== Date: Sat, 22 Apr 2023 18:36:26 +0100 From: Jonathan Cameron To: Matti Vaittinen Cc: Mehdi Djait , krzysztof.kozlowski+dt@linaro.org, andriy.shevchenko@linux.intel.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH v2 4/5] iio: accel: kionix-kx022a: Add a function to retrieve number of bytes in buffer Message-ID: <20230422183626.2b351521@jic23-huawei> In-Reply-To: <93b19237-3afd-461f-bdb3-f2cd09cadd9a@gmail.com> References: <2c5d71e37fc7e000091189b3c5d66ede1a6015d2.1682019544.git.mehdi.djait.k@gmail.com> <93b19237-3afd-461f-bdb3-f2cd09cadd9a@gmail.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.37; 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=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Fri, 21 Apr 2023 09:14:10 +0300 Matti Vaittinen wrote: > Hi Mehdi, > > Thanks for the v2! > > On 4/20/23 23:22, Mehdi Djait wrote: > > Since Kionix accelerometers use various numbers of bits to report data, a > > device-specific function is required. > > I think this is the right approach. Thanks for adding this > device-specific function. > > > Move the driver's private data to the header file to support the new function. > > Hmm. Why this move is necessary? I didn't immediately spot this struct > being used outside this C-file. I'd rather saw the struct in C-file if > possible. > > > Make the allocation of the "buffer" array in the fifo_flush function dynamic > > and more generic. > > > > Signed-off-by: Mehdi Djait > > --- > > v2: > > - separated this change from the chip_info introduction and made it a patch in v2 > > I am unsure if this separation was needed. I'd only separate the "naming > changes" which bring no changes to code flow, and then patches which are > fixes and need to be backported (to minimize backporting effort and > impact to stable branches). Well, I am fine with this separation though, > seems like I am just making a noise here :). I prefer them split. I want to see a noop patch for refactors. It's easier to quickly check it really makes no functional change. Adding new structures for a new device just adds noise to checking that. > > > - changed the function from generic implementation for to device-specific one > > - removed blank lines pointed out by checkpatch > > - changed the allocation of the "buffer" array in __kx022a_fifo_flush > > > > drivers/iio/accel/kionix-kx022a.c | 72 +++++++++++++------------------ > > drivers/iio/accel/kionix-kx022a.h | 37 ++++++++++++++++ > > 2 files changed, 66 insertions(+), 43 deletions(-) > > > > diff --git a/drivers/iio/accel/kionix-kx022a.c b/drivers/iio/accel/kionix-kx022a.c > > index 7f9a2c29790b..1c81ea1657b9 100644 > > --- a/drivers/iio/accel/kionix-kx022a.c > > +++ b/drivers/iio/accel/kionix-kx022a.c > > @@ -150,36 +150,6 @@ static const struct regmap_config kx022a_regmap_config = { > > .cache_type = REGCACHE_RBTREE, > > }; > > Yours, > -- Matti >