From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B8EEC53210 for ; Sun, 8 Jan 2023 12:24:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231295AbjAHMY6 (ORCPT ); Sun, 8 Jan 2023 07:24:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229716AbjAHMY5 (ORCPT ); Sun, 8 Jan 2023 07:24:57 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 932B6260C; Sun, 8 Jan 2023 04:24:56 -0800 (PST) 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 43BB7B801C1; Sun, 8 Jan 2023 12:24:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8B993C433D2; Sun, 8 Jan 2023 12:24:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673180693; bh=AvraLn3xLafT3m5CE80rVhLQyL81EEEpzfFaGD5yBRQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ZMuNsyRtv7Gqxt0eye/RxHGYBSeo3EPmfRCx6OlfS4Lgfe43gMvAQFXJsOvNZ735i VlH8GuMQz/CdWJgtPwkTWPT5H6BBcMq5yOz0xDb8hn9iX0txZoVQ9zLiW0sCeMntqb XuWifnTZiKSCkZjeg975F8Ll6WFGzPZn9G3QZWsiVueDy94SNmsIQglYcXTTGmnHls yWeV9rNWsWbdjEGeJtCeOSGmf+os3d/Km7ynSZ0/SkJxPxxmj9Fty4Lw8R9IsSCflq uo/FDstStlpaXRF5RZT7E3UZva3UDbHzaT78gejLCt1/rWl7qM2TyLJJe69pxZSpPf KKvDK4DYY58BA== Date: Sun, 8 Jan 2023 12:38:20 +0000 From: Jonathan Cameron To: Angel Iglesias Cc: linux-iio@vger.kernel.org, Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Nikita Yushchenko , Andy Shevchenko , Paul Cercueil , Ulf Hansson , "Rafael J. Wysocki" , Andreas Klinger , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 3/5] iio: pressure: bmp280: Add support for new sensor BMP580 Message-ID: <20230108123820.7d917571@jic23-huawei> In-Reply-To: <1efee3367f555ffe21895f68f2bdea64a38ba22a.camel@gmail.com> References: <20221230184535.6f684337@jic23-huawei> <1efee3367f555ffe21895f68f2bdea64a38ba22a.camel@gmail.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.36; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org > > > +static const int bmp580_oversampling_avail[] = { 1, 2, 4, 8, 16, 32, 64, > > > 128 }; > > > +static const int bmp580_iir_filter_coeffs_avail[] = { 1, 2, 4, 8, 16, 32, > > > 64, 128 }; > > > > Up to you, but you could take advantage of the fact this array matches the > > bmp380 one. > > It is arguable that the code is clearer with it not being reused though so > > your choice. > > Hum yes, I could reuse the array for the BMP380, maybe a should use a more > generic name for that array to avoid confusion? Something like > bmp280_iir_filter_coeffs_avail, refering to the driver name instead of the > concrete sensor? Don't worry about the naming. Anything clever just tends to cause problems as more parts are added. Just stick to the name of the first part that used it. We've made the mistake of trying for generic names in the past and it bites back! Jonathan