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: <CAMuHMdVYiQyurOQOoeLbd6zXnaVK8Y9bUC=wXkHxhQO+cQwecQ@mail.gmail.com>
Date:	Wed, 4 Jul 2012 09:52:14 +0200
From:	Geert Uytterhoeven <geert@...ux-m68k.org>
To:	Joe Perches <joe@...ches.com>
Cc:	Greg Ungerer <gerg@...pgear.com>, netdev@...r.kernel.org,
	linux-m68k@...r.kernel.org, Greg Ungerer <gerg@...inux.org>
Subject: Re: [PATCH 2/2] net: add support for NS8390 based eth controllers on
 some ColdFire CPU boards

On Wed, Jul 4, 2012 at 8:39 AM, Joe Perches <joe@...ches.com> wrote:
>> >> +static int mcf8390_init(struct net_device *dev)
>> >> +{
>> >> +  static u32 offsets[] = {
>> >> +          0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
>> >> +          0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
>> >> +  };
>> >
>> > const?  u8?
>>
>> That is assigned to the "reg_offset" field of "struct ei_device"
>> (defined in the existing 8390.h) and that is:
>>
>>      u32 *reg_offset;         /* Register mapping table */
>>
>> So I can't change this.
>
> Sure you can, you can assign a u8 to a u32 just fine.

It's not the value that's assigned, but a pointer to the table, so
for now it must be non-const u32 *.

> The value fits in a u8.  Might as well make it take
> less data space.  static const makes it read-only and
> makes the compiler assign it just once instead of at
> function invocation.

That needs changes to drivers/net/ethernet/8390/8390.h, and
also probably to some drivers that assign values to the array.

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 netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ