All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] ARM: cfi_flash: Fix unaligned accesses to cfi_qry structure
Date: Fri, 10 May 2013 14:36:00 +0200	[thread overview]
Message-ID: <201305101436.00589.marex@denx.de> (raw)
In-Reply-To: <1368180838-25346-1-git-send-email-yamada.m@jp.panasonic.com>

Hello Masahiro-san,

> Dear Andrew Gabbasov,

This way of starting emails seems to be dangerously widely adopted ;-D

> Your patch seems to newly generate the following warning and error,
> because your patch is changing the type of 'qry->max_buf_write_size' from
> u16 to u8[2].
> 
> > cfi_flash.c:2038:33: warning: comparison between pointer and integer
> > [enabled by default] cfi_flash.c:2046:27: error: incompatible types when
> > assigning to type 'u8[2]' from type 'int'

Good find.

> By the way, I also had this unalignment access problem for my board.
> Before finding your patch, I was thinking another way to fix this problem.
> 
> My idea is to just use 'get_unaligned' and 'put_unaligned' functions
> instead of introducing special macros.
> With this way, we don't need to change the fields of struct cfi_qry.

I think we should make sure to use natural alignment as much as possible, 
really. I'm keeping Albert in CC because this is his turf.

> If you fix the above problem, I think your patch will be fine.
> But I am wondering which way is more smart.
> 
> Best regards,
> Masahiro Yamada

[...]

Best regards,
Marek Vasut

  reply	other threads:[~2013-05-10 12:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-29  9:34 [U-Boot] [PATCH] ARM: cfi_flash: Fix unaligned accesses to cfi_qry structure Andrew Gabbasov
2013-04-29  9:45 ` Gabbasov, Andrew
2013-05-08 17:26 ` Marek Vasut
2013-05-08 17:38   ` Gabbasov, Andrew
2013-05-10 10:13 ` [U-Boot] " Masahiro Yamada
2013-05-10 12:36   ` Marek Vasut [this message]
2013-05-13  2:25     ` Masahiro Yamada
2013-05-13  3:37       ` Marek Vasut
2013-05-13  6:48     ` Albert ARIBAUD
2013-05-14 17:27       ` Gabbasov, Andrew
2013-05-22 15:12         ` Gabbasov, Andrew

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=201305101436.00589.marex@denx.de \
    --to=marex@denx.de \
    --cc=u-boot@lists.denx.de \
    /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.