From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kuninori Morimoto Subject: Re: [PATCH] mmc: tmio: enable odd number size transfer Date: Mon, 08 Sep 2014 01:06:26 -0700 (PDT) Message-ID: <87ppf6o7sw.wl%kuninori.morimoto.gx@gmail.com> References: <87wq9eohuc.wl%kuninori.morimoto.gx@gmail.com> <87r3zmo969.wl%kuninori.morimoto.gx@gmail.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: Received: from mail-pa0-f47.google.com ([209.85.220.47]:65072 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753026AbaIHIG1 (ORCPT ); Mon, 8 Sep 2014 04:06:27 -0400 In-Reply-To: Sender: linux-mmc-owner@vger.kernel.org List-Id: linux-mmc@vger.kernel.org To: Geert Uytterhoeven Cc: Ulf Hansson , Chris Ball , Simon , Kuninori Morimoto , Linux-SH , linux-mmc 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kuninori Morimoto Date: Mon, 08 Sep 2014 08:06:26 +0000 Subject: Re: [PATCH] mmc: tmio: enable odd number size transfer Message-Id: <87ppf6o7sw.wl%kuninori.morimoto.gx@gmail.com> List-Id: References: <87wq9eohuc.wl%kuninori.morimoto.gx@gmail.com> <87r3zmo969.wl%kuninori.morimoto.gx@gmail.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Geert Uytterhoeven Cc: Ulf Hansson , Chris Ball , Simon , Kuninori Morimoto , Linux-SH , linux-mmc 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