From: "Ivan T. Ivanov" <iivanov@mm-sol.com>
To: Mark Brown <broonie@kernel.org>
Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
Gerhard Sittig <gsi@denx.de>
Subject: Re: [PATCH v2] spi: core: Validate lenght of the transfers in message
Date: Mon, 17 Feb 2014 17:20:00 +0200 [thread overview]
Message-ID: <1392650400.17130.12.camel@iivanov-dev> (raw)
In-Reply-To: <1392444566-23605-1-git-send-email-iivanov@mm-sol.com>
Hi, Please ignore this patch.
On Sat, 2014-02-15 at 08:09 +0200, Ivan T. Ivanov wrote:
>
> + /*
> + * SPI transfer length should be multiple of SPI word size
> + * where SPI word size should be power-of-two multiple
> + */
> + if (xfer->bits_per_word <= 8)
> + w_size = 1;
> + else if (xfer->bits_per_word <= 16)
> + w_size = 2;
> + else
> + w_size = 4;
> +
> + n_words = xfer->len / w_size;
> + /* No partial transfers accepted */
> + if (!n_words || xfer->len % xfer->bits_per_word)
This should be
if (!n_words || xfer->len % w_size)
Regards,
Ivan
prev parent reply other threads:[~2014-02-17 15:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-15 6:09 [PATCH v2] spi: core: Validate lenght of the transfers in message Ivan T. Ivanov
2014-02-16 14:25 ` Gerhard Sittig
2014-02-17 7:41 ` Ivan T. Ivanov
2014-02-18 0:09 ` Mark Brown
2014-02-18 19:37 ` Gerhard Sittig
2014-02-19 1:51 ` Mark Brown
2014-02-17 15:20 ` Ivan T. Ivanov [this message]
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=1392650400.17130.12.camel@iivanov-dev \
--to=iivanov@mm-sol.com \
--cc=broonie@kernel.org \
--cc=gsi@denx.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.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