mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Philipp Marek <philipp@marek.priv.at>
Cc: linux-trivial@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [patch] removes casting of (void*) private structure members
Date: Thu, 29 May 2008 20:25:10 +0200	[thread overview]
Message-ID: <20080529182510.GA15712@uranus.ravnborg.org> (raw)
In-Reply-To: <200805291933.54529@marek.priv.at>

On Thu, May 29, 2008 at 07:33:54PM +0200, Philipp Marek wrote:
> Hello everybody,
> 
> here's another trivial patch, against v2.6.26-rc3-243-gd40ace0.

Sample from your patch:
 static int geode_rng_data_read(struct hwrng *rng, u32 *data)
 {
-       void __iomem *mem = (void __iomem *)rng->priv;
+       void __iomem *mem = rng->priv;

And from hw_random.h:
struct hwrng {
        const char *name;
        int (*init)(struct hwrng *rng);
        void (*cleanup)(struct hwrng *rng);
        int (*data_present)(struct hwrng *rng, int wait);
        int (*data_read)(struct hwrng *rng, u32 *data);
        unsigned long priv;

        /* internal. */
        struct list_head list;
};


So rng->priv is unsigend long.
Therefore the cast is legitimate.

And I expect gcc to emit:
warning: assignment makes pointer from integer without a cast


	Sam

  reply	other threads:[~2008-05-29 18:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-29 17:33 Philipp Marek
2008-05-29 18:25 ` Sam Ravnborg [this message]
2008-05-30  4:37   ` Philipp Marek

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=20080529182510.GA15712@uranus.ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trivial@kernel.org \
    --cc=philipp@marek.priv.at \
    /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

all inboxes | Powered by JetHome®