From: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
To: broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org
Cc: linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
jonas.gorski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
kgene.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org,
Laxman Dewangan
<ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org,
baohua.song-kQvG35nSl+M@public.gmane.org,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH V2] spi: remove check for bits_per_word on transfer from low level driver
Date: Wed, 19 Dec 2012 16:24:33 +0000 [thread overview]
Message-ID: <20121219162433.1E1E43E0BCF@localhost> (raw)
In-Reply-To: <1355820943-25228-1-git-send-email-ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
On Tue, 18 Dec 2012 14:25:43 +0530, Laxman Dewangan <ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> wrote:
> The spi core make sure that each transfer structure have the proper
> setting for bits_per_word before calling low level transfer APIs.
>
> Hence it is no more require to check again in low level driver for
> this field whether this is set correct or not. Removing such code
> from low level driver.
>
> Signed-off-by: Laxman Dewangan <ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
[...]
> diff --git a/drivers/spi/spi-txx9.c b/drivers/spi/spi-txx9.c
> index d5a3cbb..550b5f4 100644
> --- a/drivers/spi/spi-txx9.c
> +++ b/drivers/spi/spi-txx9.c
> @@ -189,9 +189,8 @@ static void txx9spi_work_one(struct txx9spi *c, struct spi_message *m)
> unsigned int len = t->len;
> unsigned int wsize;
> u32 speed_hz = t->speed_hz ? : spi->max_speed_hz;
> - u8 bits_per_word = t->bits_per_word ? : spi->bits_per_word;
> + u8 bits_per_word = t->bits_per_word;
>
> - bits_per_word = bits_per_word ? : 8;
> wsize = bits_per_word >> 3; /* in bytes */
>
> if (prev_speed_hz != speed_hz
> @@ -316,9 +315,8 @@ static int txx9spi_transfer(struct spi_device *spi, struct spi_message *m)
> /* check each transfer's parameters */
> list_for_each_entry (t, &m->transfers, transfer_list) {
> u32 speed_hz = t->speed_hz ? : spi->max_speed_hz;
> - u8 bits_per_word = t->bits_per_word ? : spi->bits_per_word;
> + u8 bits_per_word = t->bits_per_word;
>
> - bits_per_word = bits_per_word ? : 8;
Have you verified here that bits_per_word can never be '0' here? What is
the path that ensures spi->bits_per_word (and hence t->bits_per_word) is
set to 8 here?
Otherwise the patch looks good. Thanks for doing this work.
g.
------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
WARNING: multiple messages have this Message-ID (diff)
From: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
To: Laxman Dewangan
<ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org
Cc: linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
jonas.gorski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
kgene.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org,
Laxman Dewangan
<ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org,
baohua.song-kQvG35nSl+M@public.gmane.org,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH V2] spi: remove check for bits_per_word on transfer from low level driver
Date: Wed, 19 Dec 2012 16:24:33 +0000 [thread overview]
Message-ID: <20121219162433.1E1E43E0BCF@localhost> (raw)
In-Reply-To: <1355820943-25228-1-git-send-email-ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
On Tue, 18 Dec 2012 14:25:43 +0530, Laxman Dewangan <ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> wrote:
> The spi core make sure that each transfer structure have the proper
> setting for bits_per_word before calling low level transfer APIs.
>
> Hence it is no more require to check again in low level driver for
> this field whether this is set correct or not. Removing such code
> from low level driver.
>
> Signed-off-by: Laxman Dewangan <ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
[...]
> diff --git a/drivers/spi/spi-txx9.c b/drivers/spi/spi-txx9.c
> index d5a3cbb..550b5f4 100644
> --- a/drivers/spi/spi-txx9.c
> +++ b/drivers/spi/spi-txx9.c
> @@ -189,9 +189,8 @@ static void txx9spi_work_one(struct txx9spi *c, struct spi_message *m)
> unsigned int len = t->len;
> unsigned int wsize;
> u32 speed_hz = t->speed_hz ? : spi->max_speed_hz;
> - u8 bits_per_word = t->bits_per_word ? : spi->bits_per_word;
> + u8 bits_per_word = t->bits_per_word;
>
> - bits_per_word = bits_per_word ? : 8;
> wsize = bits_per_word >> 3; /* in bytes */
>
> if (prev_speed_hz != speed_hz
> @@ -316,9 +315,8 @@ static int txx9spi_transfer(struct spi_device *spi, struct spi_message *m)
> /* check each transfer's parameters */
> list_for_each_entry (t, &m->transfers, transfer_list) {
> u32 speed_hz = t->speed_hz ? : spi->max_speed_hz;
> - u8 bits_per_word = t->bits_per_word ? : spi->bits_per_word;
> + u8 bits_per_word = t->bits_per_word;
>
> - bits_per_word = bits_per_word ? : 8;
Have you verified here that bits_per_word can never be '0' here? What is
the path that ensures spi->bits_per_word (and hence t->bits_per_word) is
set to 8 here?
Otherwise the patch looks good. Thanks for doing this work.
g.
------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
WARNING: multiple messages have this Message-ID (diff)
From: grant.likely@secretlab.ca (Grant Likely)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V2] spi: remove check for bits_per_word on transfer from low level driver
Date: Wed, 19 Dec 2012 16:24:33 +0000 [thread overview]
Message-ID: <20121219162433.1E1E43E0BCF@localhost> (raw)
In-Reply-To: <1355820943-25228-1-git-send-email-ldewangan@nvidia.com>
On Tue, 18 Dec 2012 14:25:43 +0530, Laxman Dewangan <ldewangan@nvidia.com> wrote:
> The spi core make sure that each transfer structure have the proper
> setting for bits_per_word before calling low level transfer APIs.
>
> Hence it is no more require to check again in low level driver for
> this field whether this is set correct or not. Removing such code
> from low level driver.
>
> Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
[...]
> diff --git a/drivers/spi/spi-txx9.c b/drivers/spi/spi-txx9.c
> index d5a3cbb..550b5f4 100644
> --- a/drivers/spi/spi-txx9.c
> +++ b/drivers/spi/spi-txx9.c
> @@ -189,9 +189,8 @@ static void txx9spi_work_one(struct txx9spi *c, struct spi_message *m)
> unsigned int len = t->len;
> unsigned int wsize;
> u32 speed_hz = t->speed_hz ? : spi->max_speed_hz;
> - u8 bits_per_word = t->bits_per_word ? : spi->bits_per_word;
> + u8 bits_per_word = t->bits_per_word;
>
> - bits_per_word = bits_per_word ? : 8;
> wsize = bits_per_word >> 3; /* in bytes */
>
> if (prev_speed_hz != speed_hz
> @@ -316,9 +315,8 @@ static int txx9spi_transfer(struct spi_device *spi, struct spi_message *m)
> /* check each transfer's parameters */
> list_for_each_entry (t, &m->transfers, transfer_list) {
> u32 speed_hz = t->speed_hz ? : spi->max_speed_hz;
> - u8 bits_per_word = t->bits_per_word ? : spi->bits_per_word;
> + u8 bits_per_word = t->bits_per_word;
>
> - bits_per_word = bits_per_word ? : 8;
Have you verified here that bits_per_word can never be '0' here? What is
the path that ensures spi->bits_per_word (and hence t->bits_per_word) is
set to 8 here?
Otherwise the patch looks good. Thanks for doing this work.
g.
WARNING: multiple messages have this Message-ID (diff)
From: Grant Likely <grant.likely@secretlab.ca>
To: Laxman Dewangan <ldewangan@nvidia.com>,
broonie@opensource.wolfsonmicro.com
Cc: ben-linux@fluff.org, kgene.kim@samsung.com, baohua.song@csr.com,
linux-kernel@vger.kernel.org,
spi-devel-general@lists.sourceforge.net,
linux-samsung-soc@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, jonas.gorski@gmail.com,
linux-tegra@vger.kernel.org,
Laxman Dewangan <ldewangan@nvidia.com>
Subject: Re: [PATCH V2] spi: remove check for bits_per_word on transfer from low level driver
Date: Wed, 19 Dec 2012 16:24:33 +0000 [thread overview]
Message-ID: <20121219162433.1E1E43E0BCF@localhost> (raw)
In-Reply-To: <1355820943-25228-1-git-send-email-ldewangan@nvidia.com>
On Tue, 18 Dec 2012 14:25:43 +0530, Laxman Dewangan <ldewangan@nvidia.com> wrote:
> The spi core make sure that each transfer structure have the proper
> setting for bits_per_word before calling low level transfer APIs.
>
> Hence it is no more require to check again in low level driver for
> this field whether this is set correct or not. Removing such code
> from low level driver.
>
> Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
[...]
> diff --git a/drivers/spi/spi-txx9.c b/drivers/spi/spi-txx9.c
> index d5a3cbb..550b5f4 100644
> --- a/drivers/spi/spi-txx9.c
> +++ b/drivers/spi/spi-txx9.c
> @@ -189,9 +189,8 @@ static void txx9spi_work_one(struct txx9spi *c, struct spi_message *m)
> unsigned int len = t->len;
> unsigned int wsize;
> u32 speed_hz = t->speed_hz ? : spi->max_speed_hz;
> - u8 bits_per_word = t->bits_per_word ? : spi->bits_per_word;
> + u8 bits_per_word = t->bits_per_word;
>
> - bits_per_word = bits_per_word ? : 8;
> wsize = bits_per_word >> 3; /* in bytes */
>
> if (prev_speed_hz != speed_hz
> @@ -316,9 +315,8 @@ static int txx9spi_transfer(struct spi_device *spi, struct spi_message *m)
> /* check each transfer's parameters */
> list_for_each_entry (t, &m->transfers, transfer_list) {
> u32 speed_hz = t->speed_hz ? : spi->max_speed_hz;
> - u8 bits_per_word = t->bits_per_word ? : spi->bits_per_word;
> + u8 bits_per_word = t->bits_per_word;
>
> - bits_per_word = bits_per_word ? : 8;
Have you verified here that bits_per_word can never be '0' here? What is
the path that ensures spi->bits_per_word (and hence t->bits_per_word) is
set to 8 here?
Otherwise the patch looks good. Thanks for doing this work.
g.
next prev parent reply other threads:[~2012-12-19 16:24 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-18 8:55 [PATCH V2] spi: remove check for bits_per_word on transfer from low level driver Laxman Dewangan
2012-12-18 8:55 ` Laxman Dewangan
2012-12-18 8:55 ` Laxman Dewangan
[not found] ` <1355820943-25228-1-git-send-email-ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-12-19 16:24 ` Grant Likely [this message]
2012-12-19 16:24 ` Grant Likely
2012-12-19 16:24 ` Grant Likely
2012-12-19 16:24 ` Grant Likely
2012-12-20 6:03 ` Laxman Dewangan
2012-12-20 6:03 ` Laxman Dewangan
2012-12-22 9:54 ` Grant Likely
2012-12-22 9:54 ` Grant Likely
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=20121219162433.1E1E43E0BCF@localhost \
--to=grant.likely-s3s/wqlpoipyb63q8fvjnq@public.gmane.org \
--cc=baohua.song-kQvG35nSl+M@public.gmane.org \
--cc=ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org \
--cc=broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org \
--cc=jonas.gorski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=kgene.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.