lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdWmJmQTqgp4JkXO+-H3sy86o8v=XKJuKmQ-G63LDndq9A@mail.gmail.com>
Date:	Thu, 16 Apr 2015 18:14:55 +0200
From:	Geert Uytterhoeven <geert@...ux-m68k.org>
To:	Peter Senna Tschudin <peter.senna@...il.com>
Cc:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Loic Pefferkorn <loic@...cp.eu>, Alan <alan@...ux.intel.com>,
	Jun Tian <jun.j.tian@...el.com>,
	Octavian Purdila <octavian.purdila@...el.com>,
	Garret Kelly <garret.kelly@...il.com>,
	Kristina Martšenko <kristina.martsenko@...il.com>,
	Nick Kralevich <nnk@...gle.com>,
	Andreas <schwab@...ux-m68k.org>,
	driverdevel <devel@...verdev.osuosl.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Dan Carpenter <dan.carpenter@...cle.com>
Subject: Re: [PATCH V4] Fix pointer cast for 32 bits arch

On Thu, Apr 16, 2015 at 3:39 PM, Peter Senna Tschudin
<peter.senna@...il.com> wrote:
> --- a/drivers/staging/goldfish/goldfish_audio.c
> +++ b/drivers/staging/goldfish/goldfish_audio.c
> @@ -63,7 +63,7 @@ struct goldfish_audio {
>  #define AUDIO_READ(data, addr)         (readl(data->reg_base + addr))
>  #define AUDIO_WRITE(data, addr, x)     (writel(x, data->reg_base + addr))
>  #define AUDIO_WRITE64(data, addr, addr2, x)    \
> -       (gf_write64((u64)(x), data->reg_base + addr, data->reg_base+addr2))
> +       (gf_write_ptr((void *)(x), data->reg_base + addr, data->reg_base+addr2))

This one should not be converted, as all callers pass a dma_addr_t, which may
be 64-bit on 32-bit systems, i.e. larger than void *.

> diff --git a/drivers/tty/goldfish.c b/drivers/tty/goldfish.c
> index 0655fec..8cbfa02 100644
> --- a/drivers/tty/goldfish.c
> +++ b/drivers/tty/goldfish.c
> @@ -59,8 +59,8 @@ static void goldfish_tty_do_write(int line, const char *buf, unsigned count)
>         struct goldfish_tty *qtty = &goldfish_ttys[line];
>         void __iomem *base = qtty->base;
>         spin_lock_irqsave(&qtty->lock, irq_flags);
> -       gf_write64((u64)buf, base + GOLDFISH_TTY_DATA_PTR,
> -                               base + GOLDFISH_TTY_DATA_PTR_HIGH);
> +       gf_write_ptr((void *)buf, base + GOLDFISH_TTY_DATA_PTR,

Please drop the unneeded "void *" cast, as it will hide warnings if a type
is changed some future time.

> +                    base + GOLDFISH_TTY_DATA_PTR_HIGH);
>         writel(count, base + GOLDFISH_TTY_DATA_LEN);
>         writel(GOLDFISH_TTY_CMD_WRITE_BUFFER, base + GOLDFISH_TTY_CMD);
>         spin_unlock_irqrestore(&qtty->lock, irq_flags);
> @@ -81,8 +81,8 @@ static irqreturn_t goldfish_tty_interrupt(int irq, void *dev_id)
>
>         count = tty_prepare_flip_string(&qtty->port, &buf, count);
>         spin_lock_irqsave(&qtty->lock, irq_flags);
> -       gf_write64((u64)buf, base + GOLDFISH_TTY_DATA_PTR,
> -                               base + GOLDFISH_TTY_DATA_PTR_HIGH);
> +       gf_write_ptr((void *)buf, base + GOLDFISH_TTY_DATA_PTR,

Idem.

> +                    base + GOLDFISH_TTY_DATA_PTR_HIGH);
>         writel(count, base + GOLDFISH_TTY_DATA_LEN);
>         writel(GOLDFISH_TTY_CMD_READ_BUFFER, base + GOLDFISH_TTY_CMD);
>         spin_unlock_irqrestore(&qtty->lock, irq_flags);

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ