Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5534463rwl; Tue, 11 Apr 2023 06:51:56 -0700 (PDT) X-Google-Smtp-Source: AKy350Yl3hEtJCgP5CZb65y09ccFQgBt8eNW+3OiNN2KMNQ3DTatOE36Drri50rMfFuzS+7Xkkws X-Received: by 2002:a17:907:7ea4:b0:94b:769f:3ba3 with SMTP id qb36-20020a1709077ea400b0094b769f3ba3mr4691018ejc.8.1681221116354; Tue, 11 Apr 2023 06:51:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681221116; cv=none; d=google.com; s=arc-20160816; b=Fc08sVVGOuTpX3mtWgI8qNdANfaIIfG02V9PSiHkk/DNoZXmm4xSlXr+8Zpn+/NSOb a2CX8KtCLm6Bh5t3z8kFZQJOJXscZXGv9luvYg4mmtWZLT6XxsndjivbdSsCsTGGP6st PfLzBHWBYBAKYKVlc4xXZB1b0cSEtD1RgmgSHG+UdyhNYI4SVVTVa+sA3k5SlnYT7ac8 u4+IC9/DMbXm3wQXbHz9xylrLkd6H0XR5jA8d4MJPQTsUZjE4fpeVvDE/bnWKEWwf7Mk qBef0MVQSOFxmXeEMDowVRgio0Pf/omSOuYbIhJKzQaXlj24D2i3INfTpOWReYNE7qSo 3CtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=S4MBiOQvpo16X+NKPFhkneRBxl6Q4b+VKjEy0PIPryA=; b=sjwybexfGumgaC3uYa65zK8kpk25hrHojAUhWI4SC6w/dLJISitKLRiEZOADSIWDLE ViWL1clTAi00KSVONfOmLlZuUnZq2U9lx1RuZwdGM8f2UGViYIgTqffMXWab9BIBkMuX BEgpQH/HDQB6ELC+uiL4a/07DWqVPXYDQopm5r3L+akik/cqbMIuA4+09iHiWPGXoOfr SfGHAFLgaHWSbMI3vdDPiyPMibW/USaah6IlxH4okrXA1LVLT/9IWUejBev0qztM5RHZ RH/WH9ele8nI7I0zXgt3KjMv+jyMsT7umMWTEugKytTb0BAtBgMDzKT/3Vg97DbDwLpf +ewA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=JyB7ksgP; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nb14-20020a1709071c8e00b0094a6f5eb7easi7039786ejc.203.2023.04.11.06.51.30; Tue, 11 Apr 2023 06:51:56 -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=@intel.com header.s=Intel header.b=JyB7ksgP; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230505AbjDKNuk (ORCPT + 99 others); Tue, 11 Apr 2023 09:50:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230504AbjDKNue (ORCPT ); Tue, 11 Apr 2023 09:50:34 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 779D035B3; Tue, 11 Apr 2023 06:50:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681221020; x=1712757020; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=JFPGu+gyKqMOZ64dcu+rRARx61M4gkcolxvEsNoV1FM=; b=JyB7ksgP40Ym1rsgSvYqJO+sxmqOV2d+2CHw/MDuOfcludv9iTtyo8m0 MU/DtpqgGsBep9a7EfZTy/0QBUR0gxbrDiiFbnwH9emu0j3RyZ4+vyHuY W8+iyAU0JDZYWjNauopCWgtkpWawKaJM3jjG0phkhyoHJecYpn8GbNGXA osaOfdc7UZUtVHQX0MU+k37gjUrYvOQWD61nqM7zyeiyBWZHIfFl9nhds 0L3v15IFxYAgFomlvl7inPbTZ2KOczV4mmiEVFkqor7h97ax0yYU5bo5V 8OOOWQJoh9tUQeaimNoS6ZD0blDMuLOG6k5ZgOOJ2FGsOEVsNzRgLVcSU Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10677"; a="345403987" X-IronPort-AV: E=Sophos;i="5.98,336,1673942400"; d="scan'208";a="345403987" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Apr 2023 06:50:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10677"; a="721200052" X-IronPort-AV: E=Sophos;i="5.98,336,1673942400"; d="scan'208";a="721200052" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga001.jf.intel.com with ESMTP; 11 Apr 2023 06:50:05 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1pmENn-00FHll-1U; Tue, 11 Apr 2023 16:50:03 +0300 Date: Tue, 11 Apr 2023 16:50:03 +0300 From: Andy Shevchenko To: William Breathitt Gray Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Johannes Berg , Jonathan Cameron , Andrew Morton , Al Viro , Nathan Chancellor , Nick Desaulniers Subject: Re: [PATCH v3 3/3] counter: 104-quad-8: Utilize helper functions to handle PR, FLAG and PSC Message-ID: References: <669c8f782f11fe27c4568e4fc3ba459c4f954874.1681134558.git.william.gray@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <669c8f782f11fe27c4568e4fc3ba459c4f954874.1681134558.git.william.gray@linaro.org> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE 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, Apr 10, 2023 at 10:03:13AM -0400, William Breathitt Gray wrote: > The Preset Register (PR), Flag Register (FLAG), and Filter Clock > Prescaler (PSC) have common usage patterns. Wrap up such usage into > dedicated functions to improve code clarity. ... > *val = 0; Is not needed now as always being initialized by below call. > spin_lock_irqsave(&priv->lock, irqflags); > > iowrite8(SELECT_RLD | RESET_BP | TRANSFER_CNTR_TO_OL, &chan->control); > - > - for (i = 0; i < 3; i++) > - *val |= (unsigned long)ioread8(&chan->data) << (8 * i); > + ioread8_rep(&chan->data, val, 3); > > spin_unlock_irqrestore(&priv->lock, irqflags); ... > + struct channel_reg __iomem *const chan = priv->reg->channel + id; Not sure if array representation will look better here and elsewhere. struct channel_reg __iomem *const chan = &priv->reg->channel[id]; -- With Best Regards, Andy Shevchenko