Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp2061820pxt; Sun, 8 Aug 2021 10:10:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzpHMi9zCDFn1X1NsZhzuudPC8ENjbV9MGj8/CsLo3g1H1uDa/CBOsxNl5XYZ9aXu/Pdtpd X-Received: by 2002:a17:906:7691:: with SMTP id o17mr1605133ejm.485.1628442614818; Sun, 08 Aug 2021 10:10:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628442614; cv=none; d=google.com; s=arc-20160816; b=Z7M5qBcvk2K0dKC48nwJyEXOWVA9FwNR09GCnL00YfjsLiprUZDze/fY0C4JE5/5c2 Q87IzFShkFF5MH3nV+rMwjv3cv4RBlBTSR/7/J8vCkSAUfI5CtHS1m85Dq/wqOtYCLut LAxmNvD/J+QyR8rjvzx2inUr0SumX9mc+EdpVCu48FxOgWoHXLZuT56sdGThH9/sZX9z lz7T9TeTG6/12EHElEyTE51pb/XZg6N5xlj0nKDY7PMA6V+az1exvRT+yhQVB5Y1YlFl miXwMZgcQgSyt7nV2IvVNMm0bfb2HFTVECkpHYO3EaOH6A43ijY+OzgaAl1h8+WFsJ+V Rmlw== 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; bh=nef3pP7GMBZ/DLE9il7q0++bFnCKOMYpCu5Dx4enF6w=; b=MaP8hCj+GTsxhGApVTAWtIPxuoPAX72RHQ+pJxm3OVDfEOhmGfycOyvOtmZuoU77Ni 8iuGesAhjlEAuzzLZ4+xn36eIiyEnrWE6Tw6Rr1jvyrtcf2BpwvzJbQ/0aL+JXCGyVql A+fh4hnom6WV0GwoqdEAHf8dvAblhu8ahNNEcX6qAA6jKcFw6UlElUgr4fEe4zWOC2vt am84Ijix8o2pll8REj1pXJUtbHXIaqe6FmZmdcxiFydKsC+m5DNGART/YX80cMOP9aUT b43ALc88jlSxjd2utK/xoBHZ7gKT1ri4Xiv7R5Bow4llk9FhA+aMsSkyldc85vPQY63v NkGA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d22si10573617ejj.387.2021.08.08.10.09.51; Sun, 08 Aug 2021 10:10:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S232167AbhHHRIM (ORCPT + 99 others); Sun, 8 Aug 2021 13:08:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:42390 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231933AbhHHRIL (ORCPT ); Sun, 8 Aug 2021 13:08:11 -0400 Received: from jic23-huawei (cpc108967-cmbg20-2-0-cust86.5-4.cable.virginm.net [81.101.6.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 22FF060E93; Sun, 8 Aug 2021 17:07:47 +0000 (UTC) Date: Sun, 8 Aug 2021 18:10:37 +0100 From: Jonathan Cameron To: William Breathitt Gray Cc: linux-stm32@st-md-mailman.stormreply.com, kernel@pengutronix.de, a.fatoum@pengutronix.de, kamel.bouhara@bootlin.com, gwendal@chromium.org, alexandre.belloni@bootlin.com, david@lechnology.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, syednwaris@gmail.com, patrick.havelange@essensium.com, fabrice.gasnier@st.com, mcoquelin.stm32@gmail.com, alexandre.torgue@st.com, o.rempel@pengutronix.de, jarkko.nikula@linux.intel.com Subject: Re: [PATCH v14 04/17] counter: Rename counter_signal_value to counter_signal_level Message-ID: <20210808181037.3016bb00@jic23-huawei> In-Reply-To: <3f17010abe2415859cea9a5fddabd3c97f635ff5.1627990337.git.vilhelm.gray@gmail.com> References: <3f17010abe2415859cea9a5fddabd3c97f635ff5.1627990337.git.vilhelm.gray@gmail.com> X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.30; 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: linux-kernel@vger.kernel.org On Tue, 3 Aug 2021 21:06:14 +0900 William Breathitt Gray wrote: > Signal values will always be levels so let's be explicit it about it to > make the intent of the code clear. > > Cc: Oleksij Rempel > Cc: Kamel Bouhara > Acked-by: Syed Nayyar Waris > Reviewed-by: David Lechner > Signed-off-by: William Breathitt Gray Applied. > --- > drivers/counter/104-quad-8.c | 5 +++-- > drivers/counter/counter.c | 12 ++++++------ > drivers/counter/interrupt-cnt.c | 4 ++-- > drivers/counter/microchip-tcb-capture.c | 4 ++-- > include/linux/counter.h | 12 ++++++------ > 5 files changed, 19 insertions(+), 18 deletions(-) > > diff --git a/drivers/counter/104-quad-8.c b/drivers/counter/104-quad-8.c > index d54efdb8d393..b4dd07cf51eb 100644 > --- a/drivers/counter/104-quad-8.c > +++ b/drivers/counter/104-quad-8.c > @@ -97,7 +97,8 @@ struct quad8 { > #define QUAD8_CMR_QUADRATURE_X4 0x18 > > static int quad8_signal_read(struct counter_device *counter, > - struct counter_signal *signal, enum counter_signal_value *val) > + struct counter_signal *signal, > + enum counter_signal_level *level) > { > const struct quad8 *const priv = counter->priv; > unsigned int state; > @@ -109,7 +110,7 @@ static int quad8_signal_read(struct counter_device *counter, > state = inb(priv->base + QUAD8_REG_INDEX_INPUT_LEVELS) > & BIT(signal->id - 16); > > - *val = (state) ? COUNTER_SIGNAL_HIGH : COUNTER_SIGNAL_LOW; > + *level = (state) ? COUNTER_SIGNAL_LEVEL_HIGH : COUNTER_SIGNAL_LEVEL_LOW; > > return 0; > } > diff --git a/drivers/counter/counter.c b/drivers/counter/counter.c > index 6a683d086008..cb92673552b5 100644 > --- a/drivers/counter/counter.c > +++ b/drivers/counter/counter.c > @@ -289,9 +289,9 @@ struct counter_signal_unit { > struct counter_signal *signal; > }; > > -static const char *const counter_signal_value_str[] = { > - [COUNTER_SIGNAL_LOW] = "low", > - [COUNTER_SIGNAL_HIGH] = "high" > +static const char *const counter_signal_level_str[] = { > + [COUNTER_SIGNAL_LEVEL_LOW] = "low", > + [COUNTER_SIGNAL_LEVEL_HIGH] = "high" > }; > > static ssize_t counter_signal_show(struct device *dev, > @@ -302,13 +302,13 @@ static ssize_t counter_signal_show(struct device *dev, > const struct counter_signal_unit *const component = devattr->component; > struct counter_signal *const signal = component->signal; > int err; > - enum counter_signal_value val; > + enum counter_signal_level level; > > - err = counter->ops->signal_read(counter, signal, &val); > + err = counter->ops->signal_read(counter, signal, &level); > if (err) > return err; > > - return sprintf(buf, "%s\n", counter_signal_value_str[val]); > + return sprintf(buf, "%s\n", counter_signal_level_str[level]); > } > > struct counter_name_unit { > diff --git a/drivers/counter/interrupt-cnt.c b/drivers/counter/interrupt-cnt.c > index 66cac4900327..d06367bef8f0 100644 > --- a/drivers/counter/interrupt-cnt.c > +++ b/drivers/counter/interrupt-cnt.c > @@ -130,7 +130,7 @@ static int interrupt_cnt_function_get(struct counter_device *counter, > > static int interrupt_cnt_signal_read(struct counter_device *counter, > struct counter_signal *signal, > - enum counter_signal_value *val) > + enum counter_signal_level *level) > { > struct interrupt_cnt_priv *priv = counter->priv; > int ret; > @@ -142,7 +142,7 @@ static int interrupt_cnt_signal_read(struct counter_device *counter, > if (ret < 0) > return ret; > > - *val = ret ? COUNTER_SIGNAL_HIGH : COUNTER_SIGNAL_LOW; > + *level = ret ? COUNTER_SIGNAL_LEVEL_HIGH : COUNTER_SIGNAL_LEVEL_LOW; > > return 0; > } > diff --git a/drivers/counter/microchip-tcb-capture.c b/drivers/counter/microchip-tcb-capture.c > index 0c9a61962911..6be3adf74114 100644 > --- a/drivers/counter/microchip-tcb-capture.c > +++ b/drivers/counter/microchip-tcb-capture.c > @@ -158,7 +158,7 @@ static int mchp_tc_count_function_set(struct counter_device *counter, > > static int mchp_tc_count_signal_read(struct counter_device *counter, > struct counter_signal *signal, > - enum counter_signal_value *val) > + enum counter_signal_level *lvl) > { > struct mchp_tc_data *const priv = counter->priv; > bool sigstatus; > @@ -171,7 +171,7 @@ static int mchp_tc_count_signal_read(struct counter_device *counter, > else > sigstatus = (sr & ATMEL_TC_MTIOA); > > - *val = sigstatus ? COUNTER_SIGNAL_HIGH : COUNTER_SIGNAL_LOW; > + *lvl = sigstatus ? COUNTER_SIGNAL_LEVEL_HIGH : COUNTER_SIGNAL_LEVEL_LOW; > > return 0; > } > diff --git a/include/linux/counter.h b/include/linux/counter.h > index 9dbd5df4cd34..79f5dcaf6ba0 100644 > --- a/include/linux/counter.h > +++ b/include/linux/counter.h > @@ -290,16 +290,16 @@ struct counter_device_state { > const struct attribute_group **groups; > }; > > -enum counter_signal_value { > - COUNTER_SIGNAL_LOW = 0, > - COUNTER_SIGNAL_HIGH > +enum counter_signal_level { > + COUNTER_SIGNAL_LEVEL_LOW, > + COUNTER_SIGNAL_LEVEL_HIGH, > }; > > /** > * struct counter_ops - Callbacks from driver > * @signal_read: optional read callback for Signal attribute. The read > - * value of the respective Signal should be passed back via > - * the val parameter. > + * level of the respective Signal should be passed back via > + * the level parameter. > * @count_read: optional read callback for Count attribute. The read > * value of the respective Count should be passed back via > * the val parameter. > @@ -324,7 +324,7 @@ enum counter_signal_value { > struct counter_ops { > int (*signal_read)(struct counter_device *counter, > struct counter_signal *signal, > - enum counter_signal_value *val); > + enum counter_signal_level *level); > int (*count_read)(struct counter_device *counter, > struct counter_count *count, unsigned long *val); > int (*count_write)(struct counter_device *counter,