public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Ball <cjb@laptop.org>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: Venkatraman S <svenkatr@ti.com>,
	linux-mmc@vger.kernel.org, linux-sparse@vger.kernel.org
Subject: Re: [PATCH 2/2] mmc: fix integer assignments to pointer
Date: Tue, 23 Aug 2011 13:36:58 -0400	[thread overview]
Message-ID: <m2wre42fnp.fsf@bob.laptop.org> (raw)
In-Reply-To: <20110823165620.GA9132@merkur.ravnborg.org> (Sam Ravnborg's message of "Tue, 23 Aug 2011 18:56:20 +0200")

Hi,

On Tue, Aug 23 2011, Sam Ravnborg wrote:
>> So we're not assigning 0 to a pointer, or whatever sparse thinks we're
>> doing -- we're initializing every member of the struct with 0, which is
>> a good and safe way to initialize it.
>> 
>> Sparse folks, any comment?
>
> The struct looks like this:
> struct mmc_request {
>         struct mmc_command      *sbc;           /* SET_BLOCK_COUNT for multiblock */
>         struct mmc_command      *cmd;
>         struct mmc_data         *data;
>         struct mmc_command      *stop;
>
>         struct completion       completion;
>         void (*done)(struct mmc_request *);/* completion function */
> };
>
>
> So you assing '0' to sbc - which is a pointer.
> So sparse warning is correct.

Oops, thanks Sam, I should have realized this was the complaint --
sorry for wasting your time.

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

  reply	other threads:[~2011-08-23 17:36 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-23 15:46 [PATCH 0/2] mmc: trivial patches to fix sparse warnings Venkatraman S
2011-08-23 15:46 ` [PATCH 1/2] mmc: queue: declare mmc_alloc_sg as static Venkatraman S
2011-08-23 15:46 ` [PATCH 2/2] mmc: fix integer assignments to pointer Venkatraman S
2011-08-23 16:31   ` Chris Ball
2011-08-23 16:56     ` Sam Ravnborg
2011-08-23 17:36       ` Chris Ball [this message]
2011-08-23 22:40       ` J Freyensee
2011-08-24 11:23         ` S, Venkatraman
2011-08-23 17:28     ` Josh Triplett
2011-08-23 18:04       ` Ben Pfaff
2011-08-23 18:13         ` Josh Triplett
2011-08-23 18:28           ` Chris Ball
2011-08-23 20:22             ` Sam Ravnborg
2011-08-23 20:38             ` Sam Ravnborg
2011-08-24 18:33               ` S, Venkatraman
2011-08-23 20:43           ` Ben Pfaff

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=m2wre42fnp.fsf@bob.laptop.org \
    --to=cjb@laptop.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-sparse@vger.kernel.org \
    --cc=sam@ravnborg.org \
    --cc=svenkatr@ti.com \
    /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