linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Philipp Rossak <embed3d@gmail.com>
Cc: lee.jones@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com,
	maxime.ripard@bootlin.com, wens@csie.org, linux@armlinux.org.uk,
	knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net,
	eugen.hristev@microchip.com, rdunlap@infradead.org,
	vilhelm.gray@gmail.com, clabbe.montjoie@gmail.com,
	quentin.schulz@bootlin.com, geert+renesas@glider.be,
	lukas@wunner.de, icenowy@aosc.io, arnd@arndb.de,
	broonie@kernel.org, arnaud.pouliquen@st.com,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com
Subject: Re: [PATCH v3 05/30] iio: adc: move SUN4I_GPADC_CHANNEL define to header file
Date: Mon, 3 Sep 2018 18:28:40 +0100	[thread overview]
Message-ID: <20180903182840.77231c8b@archlinux> (raw)
In-Reply-To: <882cb5f9-867b-d120-5ef5-80a8bee2d628@gmail.com>

On Mon, 3 Sep 2018 16:24:32 +0200
Philipp Rossak <embed3d@gmail.com> wrote:

> On 02.09.2018 22:01, Jonathan Cameron wrote:
> > On Thu, 30 Aug 2018 17:44:53 +0200
> > Philipp Rossak <embed3d@gmail.com> wrote:
> >   
> >> We are moving the SUN4I_GPADC_CHANNEL define to the header file.  
> > Maxime has raised this point in other patches...
> > 
> > Why?  Obvious what but I have no idea why you are doing this.
> > 
> > Thanks,
> > 
> > Jonathan  
> There are two reasons:
> 1. Personal taste: I like to have the #define stuff in the header file.
> 2. When I started the rework I had to get some better overview, so I 
> moved it...
> 
> Since those two reasons are no good reasons to submit a patch I will 
> drop it and keep it in the *.c file.
Don't move it.

For a 'utility' type define like this that is just about cutting
down on code repetition it is nice to be able to see what it does near
to where it is used.

Also, as a general rule kernel style is to not put things in a header
unless they are needed in multiple files.  There are exceptions, but
it is generally felt keeping things local to where they are used
leads to easier to review code.

Jonathan
> 
> Philipp
> 
> >>
> >> Signed-off-by: Philipp Rossak <embed3d@gmail.com>
> >> ---
> >>   drivers/iio/adc/sun4i-gpadc-iio.c | 9 ---------
> >>   include/linux/mfd/sun4i-gpadc.h   | 9 +++++++++
> >>   2 files changed, 9 insertions(+), 9 deletions(-)
> >>
> >> diff --git a/drivers/iio/adc/sun4i-gpadc-iio.c b/drivers/iio/adc/sun4i-gpadc-iio.c
> >> index d95dd0fde2a6..666329940e1e 100644
> >> --- a/drivers/iio/adc/sun4i-gpadc-iio.c
> >> +++ b/drivers/iio/adc/sun4i-gpadc-iio.c
> >> @@ -109,15 +109,6 @@ struct sun4i_gpadc_iio {
> >>   	struct device			*sensor_device;
> >>   };
> >>   
> >> -#define SUN4I_GPADC_ADC_CHANNEL(_channel, _name) {		\
> >> -	.type = IIO_VOLTAGE,					\
> >> -	.indexed = 1,						\
> >> -	.channel = _channel,					\
> >> -	.info_mask_separate = BIT(IIO_CHAN_INFO_RAW),		\
> >> -	.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),	\
> >> -	.datasheet_name = _name,				\
> >> -}
> >> -
> >>   static struct iio_map sun4i_gpadc_hwmon_maps[] = {
> >>   	{
> >>   		.adc_channel_label = "temp_adc",
> >> diff --git a/include/linux/mfd/sun4i-gpadc.h b/include/linux/mfd/sun4i-gpadc.h
> >> index 139872c2e0fe..54c7c9375c1b 100644
> >> --- a/include/linux/mfd/sun4i-gpadc.h
> >> +++ b/include/linux/mfd/sun4i-gpadc.h
> >> @@ -90,6 +90,15 @@
> >>   /* 10s delay before suspending the IP */
> >>   #define SUN4I_GPADC_AUTOSUSPEND_DELAY			10000
> >>   
> >> +#define SUN4I_GPADC_ADC_CHANNEL(_channel, _name) {		\
> >> +	.type = IIO_VOLTAGE,					\
> >> +	.indexed = 1,						\
> >> +	.channel = _channel,					\
> >> +	.info_mask_separate = BIT(IIO_CHAN_INFO_RAW),		\
> >> +	.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),	\
> >> +	.datasheet_name = _name,				\
> >> +}
> >> +
> >>   struct sun4i_gpadc_dev {
> >>   	struct device			*dev;
> >>   	struct regmap			*regmap;  
> >   


  reply	other threads:[~2018-09-03 17:28 UTC|newest]

Thread overview: 86+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-30 15:44 [PATCH v3 00/30] IIO-based thermal sensor driver for Allwinner H3 and A83T SoC Philipp Rossak
2018-08-30 15:44 ` [PATCH v3 01/30] mfd: Makefile: Remove build option for MFD:sun4i-gpadc Philipp Rossak
2018-08-31  8:25   ` Maxime Ripard
2018-09-02 19:58     ` Jonathan Cameron
2018-08-30 15:44 ` [PATCH v3 02/30] mfd: Kconfig: Remove MFD_SUN4I_GPADC config option Philipp Rossak
2018-09-02 19:58   ` Jonathan Cameron
2018-08-30 15:44 ` [PATCH v3 03/30] iio: adc: Remove ID table Philipp Rossak
2018-08-30 15:44 ` [PATCH v3 04/30] iio: adc: Kconfig: Update Kconfig to new build options Philipp Rossak
2018-08-31  8:32   ` Maxime Ripard
2018-08-30 15:44 ` [PATCH v3 05/30] iio: adc: move SUN4I_GPADC_CHANNEL define to header file Philipp Rossak
2018-09-02 20:01   ` Jonathan Cameron
2018-09-03 14:24     ` Philipp Rossak
2018-09-03 17:28       ` Jonathan Cameron [this message]
2018-08-30 15:44 ` [PATCH v3 06/30] iio: adc: remove ofnode options Philipp Rossak
2018-08-30 15:44 ` [PATCH v3 07/30] iio: adc: remove mfd_probe & sunwi_irq_init function Philipp Rossak
2018-08-31  8:34   ` Maxime Ripard
2018-08-30 15:44 ` [PATCH v3 08/30] iio: adc: remove hwmon structure Philipp Rossak
2018-08-31  8:34   ` Maxime Ripard
2018-08-30 15:44 ` [PATCH v3 09/30] iio: adc: Threat A33 as thermal sensor and remove non thermal sun4i channel Philipp Rossak
2018-08-30 16:40   ` [linux-sunxi] " Ondřej Jirman
2018-08-31  8:35   ` Maxime Ripard
2018-08-30 15:44 ` [PATCH v3 10/30] iio: adc: rework irq and adc_channel handling Philipp Rossak
2018-08-31  8:44   ` Maxime Ripard
2018-08-30 15:44 ` [PATCH v3 11/30] iio: adc: add new compatibles Philipp Rossak
2018-08-31  8:46   ` Maxime Ripard
2018-08-30 15:45 ` [PATCH v3 12/30] mfd: Remove old mfd driver & Move sun4i-gpadc.h to iio/adc/ Philipp Rossak
2018-08-30 15:45 ` [PATCH v3 13/30] arm: config: Enable SUN4I_GPADC in defconfig Philipp Rossak
2018-08-30 15:45 ` [PATCH v3 14/30] dt-bindings: update the Allwinner GPADC device tree binding for H3 & A83T Philipp Rossak
2018-08-31  8:48   ` Maxime Ripard
2018-09-10 19:44     ` Rob Herring
2018-09-11  9:12       ` Maxime Ripard
2018-08-30 15:45 ` [PATCH v3 15/30] iio: adc: sun4i-gpadc-iio: rename A33-specified registers to contain A33 Philipp Rossak
2018-08-30 15:45 ` [PATCH v3 16/30] iio: adc: sun4i-gpadc-iio: rework: readout temp_data Philipp Rossak
2018-08-31  8:50   ` Maxime Ripard
2018-08-30 15:45 ` [PATCH v3 17/30] iio: adc: sun4i-gpadc-iio: rework: support clocks and reset Philipp Rossak
2018-08-31  9:03   ` Maxime Ripard
2018-08-30 15:45 ` [PATCH v3 18/30] iio: adc: sun4i-gpadc-iio: rework: support multiple sensors Philipp Rossak
2018-08-31  9:05   ` Maxime Ripard
2018-09-02 20:11   ` Jonathan Cameron
2018-09-03 13:58     ` Philipp Rossak
2018-09-03 17:29       ` Jonathan Cameron
2018-08-30 15:45 ` [PATCH v3 19/30] iio: adc: sun4i-gpadc-iio: rework: support nvmem calibration data Philipp Rossak
2018-08-31  9:07   ` Maxime Ripard
2018-08-30 15:45 ` [PATCH v3 20/30] iio: adc: sun4i-gpadc-iio: rework: device specific suspend & resume Philipp Rossak
2018-08-31  9:09   ` Maxime Ripard
2018-08-31 12:05     ` Philipp Rossak
2018-09-03  9:44       ` Maxime Ripard
2018-08-30 15:45 ` [PATCH v3 21/30] iio: adc: sun4i-gpadc-iio: add support for H3 thermal sensor Philipp Rossak
2018-08-30 16:27   ` [linux-sunxi] " Ondřej Jirman
2018-08-30 20:00     ` Philipp Rossak
2018-08-30 20:46       ` Philipp Rossak
2018-08-31  9:11   ` Maxime Ripard
2018-08-31  9:51     ` Icenowy Zheng
2018-08-31 11:58       ` [linux-sunxi] " Philipp Rossak
2018-09-03 10:20       ` Maxime Ripard
2018-09-03 11:01         ` [linux-sunxi] " Icenowy Zheng
2018-09-05 14:58           ` Maxime Ripard
2018-08-31 12:01     ` Philipp Rossak
2018-08-30 15:45 ` [PATCH v3 22/30] iio: adc: sun4i-gpadc-iio: add support for A83T " Philipp Rossak
2018-08-30 15:45 ` [PATCH v3 23/30] ARM: dts: sunxi-h3-h5: add support for the thermal sensor in H3 and H5 Philipp Rossak
2018-08-30 15:45 ` [PATCH v3 24/30] ARM: dts: sun8i: h3: add support for the thermal sensor in H3 Philipp Rossak
2018-08-30 15:45 ` [PATCH v3 25/30] ARM: dts: sun8i: h3: add thermal zone to H3 Philipp Rossak
2018-08-31  9:14   ` Maxime Ripard
2018-08-30 15:45 ` [PATCH v3 26/30] ARM: dts: sun8i: h3: enable H3 sid controller Philipp Rossak
2018-08-30 15:45 ` [PATCH v3 27/30] ARM: dts: sun8i: h3: use calibration for ths Philipp Rossak
2018-09-04 16:46   ` Emmanuel Vadot
2018-09-06 11:47     ` Philipp Rossak
2018-09-06 11:51       ` Maxime Ripard
2018-09-06 12:04         ` [linux-sunxi] " Icenowy Zheng
2018-09-06 12:18           ` Philipp Rossak
2019-02-19  7:54         ` Allwinner SID THS calibration data cell representation? Chen-Yu Tsai
2019-02-20 14:55           ` Maxime Ripard
2019-02-21 10:10           ` Emmanuel Vadot
2019-02-25 20:37           ` Philipp Rossak
2018-08-30 15:45 ` [PATCH v3 28/30] ARM: dts: sun8i: a83t: add support for the thermal sensor in A83T Philipp Rossak
2018-08-30 15:45 ` [PATCH v3 29/30] ARM: dts: sun8i: a83t: add thermal zone to A83T Philipp Rossak
2018-08-30 15:45 ` [PATCH v3 30/30] ARM: sun8i: a83t: full range OPP tables and CPUfreq Philipp Rossak
2018-08-30 16:38   ` [linux-sunxi] " Ondřej Jirman
2018-08-30 20:29     ` Philipp Rossak
2018-09-06  7:24   ` Quentin Schulz
2018-09-06 11:39     ` Philipp Rossak
2018-09-06 11:42       ` Maxime Ripard
2018-09-06 12:06         ` Quentin Schulz
2019-03-19 12:30 ` [PATCH v3 00/30] IIO-based thermal sensor driver for Allwinner H3 and A83T SoC Måns Rullgård
2019-03-19 12:37   ` Maxime Ripard
2019-03-19 13:04     ` [linux-sunxi] " Chen-Yu Tsai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180903182840.77231c8b@archlinux \
    --to=jic23@kernel.org \
    --cc=arnaud.pouliquen@st.com \
    --cc=arnd@arndb.de \
    --cc=broonie@kernel.org \
    --cc=clabbe.montjoie@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=embed3d@gmail.com \
    --cc=eugen.hristev@microchip.com \
    --cc=geert+renesas@glider.be \
    --cc=icenowy@aosc.io \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=lee.jones@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sunxi@googlegroups.com \
    --cc=linux@armlinux.org.uk \
    --cc=lukas@wunner.de \
    --cc=mark.rutland@arm.com \
    --cc=maxime.ripard@bootlin.com \
    --cc=pmeerw@pmeerw.net \
    --cc=quentin.schulz@bootlin.com \
    --cc=rdunlap@infradead.org \
    --cc=robh+dt@kernel.org \
    --cc=vilhelm.gray@gmail.com \
    --cc=wens@csie.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).