All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kuninori Morimoto <kuninori.morimoto.gx@gmail.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Ulf Hansson <ulf.hansson@linaro.org>, Chris Ball <cjb@laptop.org>,
	Simon <horms@verge.net.au>,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	Linux-SH <linux-sh@vger.kernel.org>,
	linux-mmc <linux-mmc@vger.kernel.org>
Subject: Re: [PATCH] mmc: tmio: enable odd number size transfer
Date: Mon, 08 Sep 2014 01:06:26 -0700 (PDT)	[thread overview]
Message-ID: <87ppf6o7sw.wl%kuninori.morimoto.gx@gmail.com> (raw)
In-Reply-To: <CAMuHMdVqFvgPBVenEnoRfpDyMSc_z+9EEF19VHM8CESXmBwFMQ@mail.gmail.com>


Hi Geert

> If count is even, we never get that far, so the even numbers should not
> be present in your table above?
> 
> If count is odd, "(count - 1) >> 1 == count >> 1".

Ahh, yes, indeed.

About endianness / byte access, it requires byte access
especially "read" case.
Because if count was odd number,
using shift with u16 will might be buffer overflow

I need to check cpu_to_le16() / le16_to_cpu()

Best regards
---
Kuninori Morimoto

WARNING: multiple messages have this Message-ID (diff)
From: Kuninori Morimoto <kuninori.morimoto.gx@gmail.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Ulf Hansson <ulf.hansson@linaro.org>, Chris Ball <cjb@laptop.org>,
	Simon <horms@verge.net.au>,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	Linux-SH <linux-sh@vger.kernel.org>,
	linux-mmc <linux-mmc@vger.kernel.org>
Subject: Re: [PATCH] mmc: tmio: enable odd number size transfer
Date: Mon, 08 Sep 2014 08:06:26 +0000	[thread overview]
Message-ID: <87ppf6o7sw.wl%kuninori.morimoto.gx@gmail.com> (raw)
In-Reply-To: <CAMuHMdVqFvgPBVenEnoRfpDyMSc_z+9EEF19VHM8CESXmBwFMQ@mail.gmail.com>


Hi Geert

> If count is even, we never get that far, so the even numbers should not
> be present in your table above?
> 
> If count is odd, "(count - 1) >> 1 = count >> 1".

Ahh, yes, indeed.

About endianness / byte access, it requires byte access
especially "read" case.
Because if count was odd number,
using shift with u16 will might be buffer overflow

I need to check cpu_to_le16() / le16_to_cpu()

Best regards
---
Kuninori Morimoto

  reply	other threads:[~2014-09-08  8:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-08  4:29 [PATCH] mmc: tmio: enable odd number size transfer Kuninori Morimoto
2014-09-08  4:29 ` Kuninori Morimoto
2014-09-08  7:28 ` Geert Uytterhoeven
2014-09-08  7:28   ` Geert Uytterhoeven
2014-09-08  7:36   ` Kuninori Morimoto
2014-09-08  7:36     ` Kuninori Morimoto
2014-09-08  7:49     ` Geert Uytterhoeven
2014-09-08  7:49       ` Geert Uytterhoeven
2014-09-08  8:06       ` Kuninori Morimoto [this message]
2014-09-08  8:06         ` Kuninori Morimoto
2014-09-08  8:18         ` Geert Uytterhoeven
2014-09-08  8:18           ` Geert Uytterhoeven
2014-09-08  8:50 ` Sergei Shtylyov
2014-09-08  8:50   ` Sergei Shtylyov

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=87ppf6o7sw.wl%kuninori.morimoto.gx@gmail.com \
    --to=kuninori.morimoto.gx@gmail.com \
    --cc=cjb@laptop.org \
    --cc=geert@linux-m68k.org \
    --cc=horms@verge.net.au \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=ulf.hansson@linaro.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.