devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
To: shiraz hashim
	<shiraz.linux.kernel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Roland Stigge <stigge-uj/7R2tJ6VmzQB+pC5nmwQ@public.gmane.org>,
	sachin.verma-qxv4g6HH51o@public.gmane.org,
	linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	gabriel.fernandez-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org,
	rob-VoJi6FS/r0vR7s880joybQ@public.gmane.org,
	viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
	spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
	aletes.xgr-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Subject: Re: [PATCH v6 1/3] spi/pl022: Add chip select handling via GPIO
Date: Mon, 3 Sep 2012 11:10:28 +0200	[thread overview]
Message-ID: <CACRpkdY2_nSUvyhXGwzYcLqVuS+ryuyVbKKmD+yHdxCwYLhdMA@mail.gmail.com> (raw)
In-Reply-To: <CAPub14891Bhdt=KNz8SZLS6Ps2snhy9LgOU=yGGMrntcK9xxRA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Sun, Sep 2, 2012 at 3:12 PM, shiraz hashim
<shiraz.linux.kernel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Hi Linus,

>> Yes that is why the allocation looks like this:
>>
>> +       master = spi_alloc_master(dev, sizeof(struct pl022) + sizeof(int) *
>> +                                 platform_info->num_chipselect);
>>
>
> The allocation is such because type of chipselects is int.
>
> The statement for allocation is correct, but
>
>        pl022->chipselects = (int *) pl022 + sizeof(struct pl022);
>
> is not adding  sizeof(struct pl022) bytes to pl022 base (which we want),
> but infact 4 times the size of pl022 (because type of pl022 is now int *).
>
> Do you get my point ?  This would go way beyond memory allocated
> for chipselects.

Yes of course ... how could I not see this. Sorry!

Yours,
Linus Walleij

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

  parent reply	other threads:[~2012-09-03  9:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-22 13:49 [PATCH v6 1/3] spi/pl022: Add chip select handling via GPIO Roland Stigge
     [not found] ` <1345643359-16584-1-git-send-email-stigge-uj/7R2tJ6VmzQB+pC5nmwQ@public.gmane.org>
2012-08-22 13:49   ` [PATCH v6 2/3] spi/pl022: Add devicetree support Roland Stigge
     [not found]     ` <1345643359-16584-2-git-send-email-stigge-uj/7R2tJ6VmzQB+pC5nmwQ@public.gmane.org>
2012-08-22 18:38       ` Linus Walleij
2012-08-22 13:49   ` [PATCH v6 3/3] DT bindings documentation: "num-cs" property for SPI controllers Roland Stigge
     [not found]     ` <1345643359-16584-3-git-send-email-stigge-uj/7R2tJ6VmzQB+pC5nmwQ@public.gmane.org>
2012-08-22 18:39       ` Linus Walleij
2012-08-22 19:03         ` Mark Brown
2012-09-01 11:14   ` [PATCH v6 1/3] spi/pl022: Add chip select handling via GPIO shiraz hashim
     [not found]     ` <CAPub14-Oot_wJsRTv2AGu3SAAf40+3_wK43=0Swxj+5XjPaDew-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-09-02  7:18       ` Linus Walleij
     [not found]         ` <CACRpkdY3atmx4N-Zq2imrgPoukueYiexzndD7bVyQTgV02Vpuw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-09-02 13:12           ` shiraz hashim
     [not found]             ` <CAPub14891Bhdt=KNz8SZLS6Ps2snhy9LgOU=yGGMrntcK9xxRA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-09-03  9:10               ` Linus Walleij [this message]
2012-09-02 20:04     ` Roland Stigge
2012-08-22 18:37 ` Linus Walleij

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=CACRpkdY2_nSUvyhXGwzYcLqVuS+ryuyVbKKmD+yHdxCwYLhdMA@mail.gmail.com \
    --to=linus.walleij-qsej5fyqhm4dnm+yrofe0a@public.gmane.org \
    --cc=aletes.xgr-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=gabriel.fernandez-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org \
    --cc=lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=rob-VoJi6FS/r0vR7s880joybQ@public.gmane.org \
    --cc=rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org \
    --cc=sachin.verma-qxv4g6HH51o@public.gmane.org \
    --cc=shiraz.linux.kernel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=stigge-uj/7R2tJ6VmzQB+pC5nmwQ@public.gmane.org \
    --cc=viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).