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: <8bd0f97a1001061123w15278d0cr4e74c88f22fa6e6e@mail.gmail.com>
Date:	Wed, 6 Jan 2010 14:23:47 -0500
From:	Mike Frysinger <vapier.adi@...il.com>
To:	Christoph Lameter <cl@...ux-foundation.org>
Cc:	Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>,
	Tejun Heo <tj@...nel.org>, linux-kernel@...r.kernel.org
Subject: Re: [RFC local_t removal V1 1/4] Add add_local() and 
	add_local_return()

On Tue, Jan 5, 2010 at 17:29, Christoph Lameter wrote:
> On Tue, 5 Jan 2010, Mike Frysinger wrote:
>> On Tue, Jan 5, 2010 at 17:04, Christoph Lameter wrote:
>> > --- /dev/null   1970-01-01 00:00:00.000000000 +0000
>> > +++ linux-2.6/include/asm-generic/add-local.h   2010-01-05 15:36:02.000000000 -0600
>> > @@ -0,0 +1,13 @@
>> > +#ifndef __ASM_GENERIC_ADD_LOCAL_H
>> > +#define __ASM_GENERIC_ADD_LOCAL_H
>>
>> needs comment header (blurb/copyright/license)
>
> A simple small include file? Really?

if there's enough content to warrant protection against multiple
inclusion, then generally yes

>> > --- /dev/null   1970-01-01 00:00:00.000000000 +0000
>> > +++ linux-2.6/arch/alpha/include/asm/add-local.h        2010-01-05 15:36:02.000000000 -0600
>> > @@ -0,0 +1,2 @@
>> > +#include <asm-generic/add-local.h>
>> > +
>>
>> these arch stubs all have an extra new line
>
> Thats bad?

files shouldnt have trailing new lines

>> > +/*
>> > + * Generic version of __add_return_local (disables interrupts). Takes an
>> > + * unsigned long parameter, supporting various types of architectures.
>> > + */
>> > +static inline unsigned long __add_return_local_generic(volatile void *ptr,
>> > +               unsigned long value, int size)
>>
>> size_t for size ?
>
> No. It can be anything.

you're passing it sizeof() which returns a size_t

>> > +extern unsigned long wrong_size_add_local(volatile void *ptr);
>> > ...
>> > +       /*
>> > +        * Sanity checking, compile-time.
>> > +        */
>> > +       if (size == 8 && sizeof(unsigned long) != 8)
>> > +               wrong_size_add_local(ptr);
>> > ...
>> > +       default:
>> > +               wrong_size_add_local(ptr);
>> > +       }
>>
>> should be BUILD_BUG_ON() ?
>
> Does not work there.

why not ?  BUILD_BUG_ON() should work on any compile-time constant
which sizeof() is ... unless you plan on letting people call this
function with arbitrary sizes ?
-mike
--
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