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]
Date:   Thu, 28 Dec 2017 12:59:55 +0100
From:   Ingo Molnar <mingo@...nel.org>
To:     Julia Lawall <julia.lawall@...6.fr>
Cc:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>,
        "H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
        Andi Kleen <andi@...stfloor.org>, linux-kernel@...r.kernel.org,
        Darren Hart <dvhart@...radead.org>,
        platform-driver-x86@...r.kernel.org,
        Bhumika Goyal <bhumirks@...il.com>
Subject: Re: [PATCH v1] x86/platform/intel-mid: Revert "Make 'bt_sfi_data'
 const"


* Julia Lawall <julia.lawall@...6.fr> wrote:

> > So the type is the following, in include/linux/mod_devicetable.h:
> >
> > struct x86_cpu_id {
> >         __u16 vendor;
> >         __u16 family;
> >         __u16 model;
> >         __u16 feature;  /* bit index */
> >         kernel_ulong_t driver_data;
> > };
> >
> > Is there a syntactic method that would allow the conversion to kernel_ulong_t, but
> > would preserve any const-ness?
> >
> > Barring that, maybe we could convert driver_data to 'void *', fix up all users,
> > and not force the type - this would allow the preservation of the const attribute,
> > I think.
> >
> > BTW., a quick grep suggests similar type casting patterns here:
> >
> > arch/x86/platform/intel-mid/pwr.c:      { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_PENWELL), (kernel_ulong_t)&pnw_info },
> > arch/x86/platform/intel-mid/pwr.c:      { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_TANGIER), (kernel_ulong_t)&tng_info },
> 
> Would it be acceptable to move the cast out of the macro to the place
> where the variable is referenced?  It wouldn't help with the compiler, but
> it would be slightly easier for the human to check.

It would really be preferably to not stand in the way of the compiler here.

AFACS void * should solve the problem, and it's a kernel_ulong_t equivalent in 
terms of with, right?

So let's try and solve this for real. Forcing humans to discover such things is 
always a fragile concept.

Thanks,

	Ingo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ