devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@s-opensource.com>
To: Yasunari.Takiguchi@sony.com
Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	linux-media@vger.kernel.org, tbird20d@gmail.com,
	frowand.list@gmail.com,
	Masayuki Yamamoto <Masayuki.Yamamoto@sony.com>,
	Hideki Nozawa <Hideki.Nozawa@sony.com>,
	Kota Yonezawa <Kota.Yonezawa@sony.com>,
	Toshihiko Matsumoto <Toshihiko.Matsumoto@sony.com>,
	Satoshi Watanabe <Satoshi.C.Watanabe@sony.com>
Subject: Re: [PATCH v4 03/12] [media] cxd2880: Add common files for the driver
Date: Wed, 13 Dec 2017 16:02:50 -0200	[thread overview]
Message-ID: <20171213160250.2f66cbeb@vento.lan> (raw)
In-Reply-To: <20171013060259.21221-1-Yasunari.Takiguchi@sony.com>

Em Fri, 13 Oct 2017 15:02:59 +0900
<Yasunari.Takiguchi@sony.com> escreveu:

> From: Yasunari Takiguchi <Yasunari.Takiguchi@sony.com>
> 
> These are common files for the driver for the
> Sony CXD2880 DVB-T2/T tuner + demodulator.
> These contains helper functions for the driver.
> 
> Signed-off-by: Yasunari Takiguchi <Yasunari.Takiguchi@sony.com>
> Signed-off-by: Masayuki Yamamoto <Masayuki.Yamamoto@sony.com>
> Signed-off-by: Hideki Nozawa <Hideki.Nozawa@sony.com>
> Signed-off-by: Kota Yonezawa <Kota.Yonezawa@sony.com>
> Signed-off-by: Toshihiko Matsumoto <Toshihiko.Matsumoto@sony.com>
> Signed-off-by: Satoshi Watanabe <Satoshi.C.Watanabe@sony.com>
> ---
> 
> [Change list]
> Changes in V4
>    drivers/media/dvb-frontends/cxd2880/cxd2880_io.c
>       -removed unnecessary initialization at variable declaration
>       -modified how to write consecutive registers
> 
> Changes in V3
>    drivers/media/dvb-frontends/cxd2880/cxd2880.h
>       -no change
>    drivers/media/dvb-frontends/cxd2880/cxd2880_common.c
>       -changed MASKUPPER/MASKLOWER with GENMASK 
>    drivers/media/dvb-frontends/cxd2880/cxd2880_common.h
>       -removed definition NULL and SONY_SLEEP
>       -changed CXD2880_SLEEP to usleep_range
>       -changed cxd2880_atomic_set to atomic_set
>       -removed cxd2880_atomic struct and cxd2880_atomic_read
>       -changed stop-watch function
>       -modified return code
>    drivers/media/dvb-frontends/cxd2880/cxd2880_io.c
>       -removed unnecessary cast
>       -modified return code
>       -changed hexadecimal code to lower case. 
>    drivers/media/dvb-frontends/cxd2880/cxd2880_io.h
>       -modified return code 
>    drivers/media/dvb-frontends/cxd2880/cxd2880_stopwatch_port.c
>       -changed CXD2880_SLEEP to usleep_range
>       -changed stop-watch function
>       -modified return code
>    #drivers/media/dvb-frontends/cxd2880/cxd2880_stdlib.h
>       -cxd2880_stdlib.h file was removed from V3.
> 
>  drivers/media/dvb-frontends/cxd2880/cxd2880.h      | 46 +++++++++++
>  .../media/dvb-frontends/cxd2880/cxd2880_common.c   | 38 +++++++++
>  .../media/dvb-frontends/cxd2880/cxd2880_common.h   | 50 ++++++++++++
>  drivers/media/dvb-frontends/cxd2880/cxd2880_io.c   | 89 ++++++++++++++++++++++
>  drivers/media/dvb-frontends/cxd2880/cxd2880_io.h   | 71 +++++++++++++++++
>  .../dvb-frontends/cxd2880/cxd2880_stopwatch_port.c | 60 +++++++++++++++
>  6 files changed, 354 insertions(+)
>  create mode 100644 drivers/media/dvb-frontends/cxd2880/cxd2880.h
>  create mode 100644 drivers/media/dvb-frontends/cxd2880/cxd2880_common.c
>  create mode 100644 drivers/media/dvb-frontends/cxd2880/cxd2880_common.h
>  create mode 100644 drivers/media/dvb-frontends/cxd2880/cxd2880_io.c
>  create mode 100644 drivers/media/dvb-frontends/cxd2880/cxd2880_io.h
>  create mode 100644 drivers/media/dvb-frontends/cxd2880/cxd2880_stopwatch_port.c
> 
> diff --git a/drivers/media/dvb-frontends/cxd2880/cxd2880.h b/drivers/media/dvb-frontends/cxd2880/cxd2880.h
> new file mode 100644
> index 000000000000..281f9a784eb5
> --- /dev/null
> +++ b/drivers/media/dvb-frontends/cxd2880/cxd2880.h
> @@ -0,0 +1,46 @@
> +/*
> + * cxd2880.h
> + * Sony CXD2880 DVB-T2/T tuner + demodulator driver public definitions
> + *
> + * Copyright (C) 2016, 2017 Sony Semiconductor Solutions Corporation
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License as published by the
> + * Free Software Foundation; version 2 of the License.
> + *
> + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
> + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
> + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
> + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
> + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
> + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
> + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
> + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
> + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
> + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> + *
> + * You should have received a copy of the GNU General Public License along
> + * with this program; if not, see <http://www.gnu.org/licenses/>.
> + */

Same comment made on patch 2 applies to this one and to the entire
series, with regards to SPDX.

> +
> +#ifndef CXD2880_H
> +#define CXD2880_H
> +
> +struct cxd2880_config {
> +	struct spi_device *spi;
> +	struct mutex *spi_mutex; /* For SPI access exclusive control */
> +};
> +
> +#if IS_REACHABLE(CONFIG_DVB_CXD2880)
> +extern struct dvb_frontend *cxd2880_attach(struct dvb_frontend *fe,
> +					struct cxd2880_config *cfg);
> +#else
> +static inline struct dvb_frontend *cxd2880_attach(struct dvb_frontend *fe,
> +					struct cxd2880_config *cfg)
> +{
> +	pr_warn("%s: driver disabled by Kconfig\n", __func__);
> +	return NULL;
> +}
> +#endif /* CONFIG_DVB_CXD2880 */
> +
> +#endif /* CXD2880_H */
> diff --git a/drivers/media/dvb-frontends/cxd2880/cxd2880_common.c b/drivers/media/dvb-frontends/cxd2880/cxd2880_common.c
> new file mode 100644
> index 000000000000..ffaa140bb8cb
> --- /dev/null
> +++ b/drivers/media/dvb-frontends/cxd2880/cxd2880_common.c
> @@ -0,0 +1,38 @@
> +/*
> + * cxd2880_common.c
> + * Sony CXD2880 DVB-T2/T tuner + demodulator driver
> + * common functions
> + *
> + * Copyright (C) 2016, 2017 Sony Semiconductor Solutions Corporation
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License as published by the
> + * Free Software Foundation; version 2 of the License.
> + *
> + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
> + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
> + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
> + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
> + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
> + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
> + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
> + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
> + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
> + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> + *
> + * You should have received a copy of the GNU General Public License along
> + * with this program; if not, see <http://www.gnu.org/licenses/>.
> + */
> +
> +#include "cxd2880_common.h"
> +
> +int cxd2880_convert2s_complement(u32 value, u32 bitlen)
> +{
> +	if ((bitlen == 0) || (bitlen >= 32))
> +		return (int)value;
> +
> +	if (value & (u32)(1 << (bitlen - 1)))
> +		return (int)(GENMASK(31, bitlen) | value);
> +	else
> +		return (int)(GENMASK(bitlen - 1, 0) & value);
> +}
> diff --git a/drivers/media/dvb-frontends/cxd2880/cxd2880_common.h b/drivers/media/dvb-frontends/cxd2880/cxd2880_common.h
> new file mode 100644
> index 000000000000..cf6b800809ee
> --- /dev/null
> +++ b/drivers/media/dvb-frontends/cxd2880/cxd2880_common.h
> @@ -0,0 +1,50 @@
> +/*
> + * cxd2880_common.h
> + * Sony CXD2880 DVB-T2/T tuner + demodulator driver common definitions
> + *
> + * Copyright (C) 2016, 2017 Sony Semiconductor Solutions Corporation
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License as published by the
> + * Free Software Foundation; version 2 of the License.
> + *
> + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
> + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
> + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
> + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
> + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
> + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
> + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
> + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
> + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
> + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> + *
> + * You should have received a copy of the GNU General Public License along
> + * with this program; if not, see <http://www.gnu.org/licenses/>.
> + */
> +
> +#ifndef CXD2880_COMMON_H
> +#define CXD2880_COMMON_H
> +
> +#include <linux/types.h>
> +#include <linux/errno.h>
> +#include <linux/delay.h>
> +#include <linux/string.h>
> +
> +#define CXD2880_ARG_UNUSED(arg) ((void)(arg))

Huh??? Why this is needed?

> +
> +int cxd2880_convert2s_complement(u32 value, u32 bitlen);
> +
> +struct cxd2880_stopwatch {
> +	unsigned long start_time;
> +};
> +
> +int cxd2880_stopwatch_start(struct cxd2880_stopwatch *stopwatch);
> +
> +int cxd2880_stopwatch_sleep(struct cxd2880_stopwatch *stopwatch,
> +			    u32 ms);
> +
> +int cxd2880_stopwatch_elapsed(struct cxd2880_stopwatch *stopwatch,
> +			      unsigned int *elapsed);
> +
> +#endif
> diff --git a/drivers/media/dvb-frontends/cxd2880/cxd2880_io.c b/drivers/media/dvb-frontends/cxd2880/cxd2880_io.c
> new file mode 100644
> index 000000000000..bdb0b7982401
> --- /dev/null
> +++ b/drivers/media/dvb-frontends/cxd2880/cxd2880_io.c
> @@ -0,0 +1,89 @@
> +/*
> + * cxd2880_io.c
> + * Sony CXD2880 DVB-T2/T tuner + demodulator driver
> + * register I/O interface functions
> + *
> + * Copyright (C) 2016, 2017 Sony Semiconductor Solutions Corporation
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License as published by the
> + * Free Software Foundation; version 2 of the License.
> + *
> + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
> + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
> + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
> + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
> + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
> + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
> + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
> + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
> + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
> + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> + *
> + * You should have received a copy of the GNU General Public License along
> + * with this program; if not, see <http://www.gnu.org/licenses/>.
> + */
> +
> +#include "cxd2880_io.h"
> +
> +int cxd2880_io_common_write_one_reg(struct cxd2880_io *io,
> +				    enum cxd2880_io_tgt tgt,
> +				    u8 sub_address, u8 data)
> +{
> +	int ret;
> +
> +	if (!io)
> +		return -EINVAL;
> +
> +	ret = io->write_regs(io, tgt, sub_address, &data, 1);
> +
> +	return ret;
> +}
> +
> +int cxd2880_io_set_reg_bits(struct cxd2880_io *io,
> +			    enum cxd2880_io_tgt tgt,
> +			    u8 sub_address, u8 data, u8 mask)
> +{
> +	int ret;
> +
> +	if (!io)
> +		return -EINVAL;
> +
> +	if (mask == 0x00)
> +		return 0;
> +
> +	if (mask != 0xff) {
> +		u8 rdata = 0x00;
> +
> +		ret = io->read_regs(io, tgt, sub_address, &rdata, 1);
> +		if (ret)
> +			return ret;
> +
> +		data = (data & mask) | (rdata & (mask ^ 0xff));
> +	}
> +
> +	ret = io->write_reg(io, tgt, sub_address, data);
> +
> +	return ret;
> +}
> +
> +int cxd2880_io_write_multi_regs(struct cxd2880_io *io,
> +			     enum cxd2880_io_tgt tgt,
> +			     const struct cxd2880_reg_value reg_value[],
> +			     u8 size)
> +{
> +	int ret;
> +	int i;
> +
> +	if (!io)
> +		return -EINVAL;
> +
> +	for (i = 0; i < size ; i++) {
> +		ret = io->write_reg(io, tgt, reg_value[i].addr,
> +				    reg_value[i].value);
> +		if (ret)
> +			return ret;
> +	}
> +
> +	return 0;
> +}
> diff --git a/drivers/media/dvb-frontends/cxd2880/cxd2880_io.h b/drivers/media/dvb-frontends/cxd2880/cxd2880_io.h
> new file mode 100644
> index 000000000000..f7aee6c6480e
> --- /dev/null
> +++ b/drivers/media/dvb-frontends/cxd2880/cxd2880_io.h
> @@ -0,0 +1,71 @@
> +/*
> + * cxd2880_io.h
> + * Sony CXD2880 DVB-T2/T tuner + demodulator driver
> + * register I/O interface definitions
> + *
> + * Copyright (C) 2016, 2017 Sony Semiconductor Solutions Corporation
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License as published by the
> + * Free Software Foundation; version 2 of the License.
> + *
> + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
> + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
> + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
> + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
> + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
> + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
> + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
> + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
> + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
> + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> + *
> + * You should have received a copy of the GNU General Public License along
> + * with this program; if not, see <http://www.gnu.org/licenses/>.
> + */
> +
> +#ifndef CXD2880_IO_H
> +#define CXD2880_IO_H
> +
> +#include "cxd2880_common.h"
> +
> +enum cxd2880_io_tgt {
> +	CXD2880_IO_TGT_SYS,
> +	CXD2880_IO_TGT_DMD
> +};
> +
> +struct cxd2880_reg_value {
> +	u8 addr;
> +	u8 value;
> +};
> +
> +struct cxd2880_io {
> +	int (*read_regs)(struct cxd2880_io *io,
> +			 enum cxd2880_io_tgt tgt, u8 sub_address,
> +			 u8 *data, u32 size);
> +	int (*write_regs)(struct cxd2880_io *io,
> +			  enum cxd2880_io_tgt tgt, u8 sub_address,
> +			  const u8 *data, u32 size);
> +	int (*write_reg)(struct cxd2880_io *io,
> +			 enum cxd2880_io_tgt tgt, u8 sub_address,
> +			 u8 data);
> +	void *if_object;
> +	u8 i2c_address_sys;
> +	u8 i2c_address_demod;
> +	u8 slave_select;
> +	void *user;
> +};
> +
> +int cxd2880_io_common_write_one_reg(struct cxd2880_io *io,
> +				    enum cxd2880_io_tgt tgt,
> +				    u8 sub_address, u8 data);
> +
> +int cxd2880_io_set_reg_bits(struct cxd2880_io *io,
> +			    enum cxd2880_io_tgt tgt,
> +			    u8 sub_address, u8 data, u8 mask);
> +
> +int cxd2880_io_write_multi_regs(struct cxd2880_io *io,
> +				enum cxd2880_io_tgt tgt,
> +				const struct cxd2880_reg_value reg_value[],
> +				u8 size);
> +#endif
> diff --git a/drivers/media/dvb-frontends/cxd2880/cxd2880_stopwatch_port.c b/drivers/media/dvb-frontends/cxd2880/cxd2880_stopwatch_port.c
> new file mode 100644
> index 000000000000..a4a1e29de653
> --- /dev/null
> +++ b/drivers/media/dvb-frontends/cxd2880/cxd2880_stopwatch_port.c
> @@ -0,0 +1,60 @@
> +/*
> + * cxd2880_stopwatch_port.c
> + * Sony CXD2880 DVB-T2/T tuner + demodulator driver
> + * time measurement functions
> + *
> + * Copyright (C) 2016, 2017 Sony Semiconductor Solutions Corporation
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License as published by the
> + * Free Software Foundation; version 2 of the License.
> + *
> + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
> + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
> + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
> + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
> + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
> + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
> + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
> + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
> + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
> + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> + *
> + * You should have received a copy of the GNU General Public License along
> + * with this program; if not, see <http://www.gnu.org/licenses/>.
> + */
> +
> +#include <linux/jiffies.h>
> +
> +#include "cxd2880_common.h"
> +
> +int cxd2880_stopwatch_start(struct cxd2880_stopwatch *stopwatch)
> +{
> +	if (!stopwatch)
> +		return -EINVAL;
> +
> +	stopwatch->start_time = jiffies;
> +
> +	return 0;
> +}
> +
> +int cxd2880_stopwatch_sleep(struct cxd2880_stopwatch *stopwatch,
> +			    u32 ms)
> +{
> +	if (!stopwatch)
> +		return -EINVAL;
> +	CXD2880_ARG_UNUSED(*stopwatch);

Huh? This macro does nothing. If this argument is not needed, then
just don't declare it...

> +	usleep_range(ms * 10000, ms * 10000 + 1000);
> +
> +	return 0;
> +}

... at the end, this code evaluates to just:
	usleep_range(ms * 10000, ms * 10000 + 1000);

Why don't you just use usleep_range() directly, instead of adding
a function that just encapsulates it?

> +
> +int cxd2880_stopwatch_elapsed(struct cxd2880_stopwatch *stopwatch,
> +			      unsigned int *elapsed)
> +{
> +	if (!stopwatch || !elapsed)
> +		return -EINVAL;
> +	*elapsed = jiffies_to_msecs(jiffies - stopwatch->start_time);
> +
> +	return 0;
> +}


It seems that this entire C file is just adding another layer on the
top of jiffies. Please, don't do that, as it makes a lot harder to
understand what you're trying to do.


Thanks,
Mauro

  reply	other threads:[~2017-12-13 18:02 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-13  5:46 [PATCH v4 00/12] [dt-bindings] [media] Add document file and driver for Sony CXD2880 DVB-T2/T tuner + demodulator Yasunari.Takiguchi
2017-10-13  5:58 ` [PATCH v4 01/12] [dt-bindings] [media] Add document file for CXD2880 SPI I/F Yasunari.Takiguchi
2017-10-13  5:59 ` [PATCH v4 02/12] [media] cxd2880-spi: Add support for CXD2880 SPI interface Yasunari.Takiguchi
2017-10-13  8:44   ` Honza Petrouš
2017-10-13  9:10     ` Takiguchi, Yasunari
     [not found]       ` <eab5bd7b-d909-343d-7078-842e3d0d9ab9-7U/KSKJipcs@public.gmane.org>
2017-10-13 10:26         ` Honza Petrouš
2017-10-16  1:35           ` Takiguchi, Yasunari
     [not found]   ` <20171013055928.21132-1-Yasunari.Takiguchi-7U/KSKJipcs@public.gmane.org>
2017-12-13 17:54     ` Mauro Carvalho Chehab
2017-12-20  0:54       ` Takiguchi, Yasunari
2017-10-13  6:02 ` [PATCH v4 03/12] [media] cxd2880: Add common files for the driver Yasunari.Takiguchi
2017-12-13 18:02   ` Mauro Carvalho Chehab [this message]
     [not found] ` <20171013054635.20946-1-Yasunari.Takiguchi-7U/KSKJipcs@public.gmane.org>
2017-10-13  6:05   ` [PATCH v4 04/12] [media] cxd2880: Add spi device IO routines Yasunari.Takiguchi-7U/KSKJipcs
2017-10-13  6:07   ` [PATCH v4 05/12] [media] cxd2880: Add tuner part of the driver Yasunari.Takiguchi-7U/KSKJipcs
     [not found]     ` <20171013060725.21439-1-Yasunari.Takiguchi-7U/KSKJipcs@public.gmane.org>
2017-12-13 18:40       ` Mauro Carvalho Chehab
2017-12-20  1:01         ` Takiguchi, Yasunari
2017-10-13  6:08   ` [PATCH v4 06/12] [media] cxd2880: Add integration layer for " Yasunari.Takiguchi-7U/KSKJipcs
2017-12-03 18:23     ` Sean Young
2017-12-13 19:13     ` Mauro Carvalho Chehab
     [not found]       ` <20171213171319.675b39a6-ch4gOOMV7nf/PtFMR13I2A@public.gmane.org>
2017-12-20  1:06         ` Takiguchi, Yasunari
2017-10-13  6:09   ` [PATCH v4 07/12] [media] cxd2880: Add top level of " Yasunari.Takiguchi-7U/KSKJipcs
     [not found]     ` <20171013060934.21612-1-Yasunari.Takiguchi-7U/KSKJipcs@public.gmane.org>
2017-12-03 22:59       ` Sean Young
2017-12-05 11:47         ` Takiguchi, Yasunari
2017-12-13 19:25       ` Mauro Carvalho Chehab
2017-12-20  1:18         ` Takiguchi, Yasunari
2017-10-13  6:11   ` [PATCH v4 09/12] [media] cxd2880: Add DVB-T monitor functions Yasunari.Takiguchi-7U/KSKJipcs
2017-11-16  1:07   ` [PATCH v4 00/12] [dt-bindings] [media] Add document file and driver for Sony CXD2880 DVB-T2/T tuner + demodulator Takiguchi, Yasunari
     [not found]     ` <67ca63fc-4675-8a97-e43e-6336bbc9fada-7U/KSKJipcs@public.gmane.org>
2017-11-22  4:17       ` Takiguchi, Yasunari
     [not found]         ` <3e2f788b-3e4a-eb9b-eb36-2f65ffce669a-7U/KSKJipcs@public.gmane.org>
2017-11-29  7:38           ` Mauro Carvalho Chehab
2017-11-29  8:21             ` Takiguchi, Yasunari
2017-12-13 19:36   ` Mauro Carvalho Chehab
     [not found]     ` <20171213173633.57edca85-ch4gOOMV7nf/PtFMR13I2A@public.gmane.org>
2017-12-14  9:59       ` Takiguchi, Yasunari
2017-12-14 10:55         ` Mauro Carvalho Chehab
     [not found]           ` <20171214085503.289f06f8-ch4gOOMV7nf/PtFMR13I2A@public.gmane.org>
2017-12-14 14:25             ` Philippe Ombredanne
     [not found]               ` <CAOFm3uEYfMH8Zj8uEx-D9yYrTyDMTG_j02619esHu-j0brQKaA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-12-14 17:32                 ` Bird, Timothy
2017-12-14 18:04                   ` Mauro Carvalho Chehab
2017-12-14 18:30                     ` Philippe Ombredanne
2018-01-15  0:49                     ` Takiguchi, Yasunari
2018-01-15  1:27                       ` Takiguchi, Yasunari
2017-12-14 18:22                   ` Philippe Ombredanne
2017-10-13  6:10 ` [PATCH v4 08/12] [media] cxd2880: Add DVB-T control functions the driver Yasunari.Takiguchi
2017-10-13  6:13 ` [PATCH v4 10/12] [media] cxd2880: Add DVB-T2 control functions for " Yasunari.Takiguchi
2017-10-13  6:15 ` [PATCH v4 11/12] [media] cxd2880: Add DVB-T2 monitor functions Yasunari.Takiguchi
2017-10-13  6:17 ` [PATCH v4 12/12] [media] cxd2880: Add all Makefile, Kconfig files and Update MAINTAINERS file for the driver Yasunari.Takiguchi

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=20171213160250.2f66cbeb@vento.lan \
    --to=mchehab@s-opensource.com \
    --cc=Hideki.Nozawa@sony.com \
    --cc=Kota.Yonezawa@sony.com \
    --cc=Masayuki.Yamamoto@sony.com \
    --cc=Satoshi.C.Watanabe@sony.com \
    --cc=Toshihiko.Matsumoto@sony.com \
    --cc=Yasunari.Takiguchi@sony.com \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=tbird20d@gmail.com \
    /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).