Re: [U-Boot] [PATCH v5 01/20] sandbox: Add architecture header files

2011-10-09 Thread Wolfgang Denk
Dear Simon Glass,

In message <1318031631-13643-2-git-send-email-...@chromium.org> you wrote:
> This adds required header files for the sandbox architecture, and a basic
> description of what sandbox is (README.sandbox).
> 
> This commit generates a list of 44 checkpatch warnings:

This should go to the comment section.   I don't want to see this as
part of the commit message.

> 0 errors, 44 warnings for 0001-sandbox-Add-architecture-header-files.patch:
> warning: arch/sandbox/include/asm/bitops.h,30: Use of volatile is usually 
> wrong: see Documentation/volatile-considered-harmful.txt
> warning: arch/sandbox/include/asm/bitops.h,32: Use of volatile is usually 
> wrong: see Documentation/volatile-considered-harmful.txt
> warning: arch/sandbox/include/asm/bitops.h,34: Use of volatile is usually 
> wrong: see Documentation/volatile-considered-harmful.txt
> warning: arch/sandbox/include/asm/bitops.h,36: Use of volatile is usually 
> wrong: see Documentation/volatile-considered-harmful.txt
> warning: arch/sandbox/include/asm/bitops.h,44: Use of volatile is usually 
> wrong: see Documentation/volatile-considered-harmful.txt
> warning: arch/sandbox/include/asm/bitops.h,54: Use of volatile is usually 
> wrong: see Documentation/volatile-considered-harmful.txt
> warning: arch/sandbox/include/asm/bitops.h,66: Use of volatile is usually 
> wrong: see Documentation/volatile-considered-harmful.txt
> warning: arch/sandbox/include/asm/bitops.h,76: Use of volatile is usually 
> wrong: see Documentation/volatile-considered-harmful.txt
> warning: arch/sandbox/include/asm/bitops.h,88: Use of volatile is usually 
> wrong: see Documentation/volatile-considered-harmful.txt
> warning: arch/sandbox/include/asm/bitops.h,90: Use of volatile is usually 
> wrong: see Documentation/volatile-considered-harmful.txt
> 
> (These are the bitops and seem to have volatile in all the other archs also.)

Existence of bad code examples is no excuse for submitting new bad
code.

...
> +/*
> + * Function prototypes to keep gcc -Wall happy.
> + */
> +extern void set_bit(int nr, volatile void *addr);
> +
> +extern void clear_bit(int nr, volatile void *addr);
> +
> +extern void change_bit(int nr, volatile void *addr);

I see no reason to accept these voplatiles here.

> +static inline void __change_bit(int nr, volatile void *addr)
> +{
> + unsigned long mask = BIT_MASK(nr);
> + unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr);
> +
> + *p ^= mask;

Please note that you actually even drop the volatile property in your
implementation.


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
"There is no statute of limitations on stupidity."
- Randomly produced by a computer program called Markov3.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v5 01/20] sandbox: Add architecture header files

2011-10-09 Thread Simon Glass
Hi Wolfgang,

On Sun, Oct 9, 2011 at 12:28 PM, Wolfgang Denk  wrote:
> Dear Simon Glass,
>
> In message <1318031631-13643-2-git-send-email-...@chromium.org> you wrote:
>> This adds required header files for the sandbox architecture, and a basic
>> description of what sandbox is (README.sandbox).
>>
>> This commit generates a list of 44 checkpatch warnings:
>
> This should go to the comment section.   I don't want to see this as
> part of the commit message.

Neither do I, but I guessed another patch version was coming. I will move it.

>
>> 0 errors, 44 warnings for 0001-sandbox-Add-architecture-header-files.patch:
>> warning: arch/sandbox/include/asm/bitops.h,30: Use of volatile is usually 
>> wrong: see Documentation/volatile-considered-harmful.txt
>> warning: arch/sandbox/include/asm/bitops.h,32: Use of volatile is usually 
>> wrong: see Documentation/volatile-considered-harmful.txt
>> warning: arch/sandbox/include/asm/bitops.h,34: Use of volatile is usually 
>> wrong: see Documentation/volatile-considered-harmful.txt
>> warning: arch/sandbox/include/asm/bitops.h,36: Use of volatile is usually 
>> wrong: see Documentation/volatile-considered-harmful.txt
>> warning: arch/sandbox/include/asm/bitops.h,44: Use of volatile is usually 
>> wrong: see Documentation/volatile-considered-harmful.txt
>> warning: arch/sandbox/include/asm/bitops.h,54: Use of volatile is usually 
>> wrong: see Documentation/volatile-considered-harmful.txt
>> warning: arch/sandbox/include/asm/bitops.h,66: Use of volatile is usually 
>> wrong: see Documentation/volatile-considered-harmful.txt
>> warning: arch/sandbox/include/asm/bitops.h,76: Use of volatile is usually 
>> wrong: see Documentation/volatile-considered-harmful.txt
>> warning: arch/sandbox/include/asm/bitops.h,88: Use of volatile is usually 
>> wrong: see Documentation/volatile-considered-harmful.txt
>> warning: arch/sandbox/include/asm/bitops.h,90: Use of volatile is usually 
>> wrong: see Documentation/volatile-considered-harmful.txt
>>
>> (These are the bitops and seem to have volatile in all the other archs also.)
>
> Existence of bad code examples is no excuse for submitting new bad
> code.

OK. I will drop volatile from the patch. Are you OK with the other
checkpatch problems?

Regards,
Simon

>
> ...
>> +/*
>> + * Function prototypes to keep gcc -Wall happy.
>> + */
>> +extern void set_bit(int nr, volatile void *addr);
>> +
>> +extern void clear_bit(int nr, volatile void *addr);
>> +
>> +extern void change_bit(int nr, volatile void *addr);
>
> I see no reason to accept these voplatiles here.
>
>> +static inline void __change_bit(int nr, volatile void *addr)
>> +{
>> +     unsigned long mask = BIT_MASK(nr);
>> +     unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr);
>> +
>> +     *p ^= mask;
>
> Please note that you actually even drop the volatile property in your
> implementation.
>
>
> Best regards,
>
> Wolfgang Denk
>
> --
> DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
> "There is no statute of limitations on stupidity."
> - Randomly produced by a computer program called Markov3.
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v5 01/20] sandbox: Add architecture header files

2011-10-09 Thread Mike Frysinger
On Sunday 09 October 2011 15:28:16 Wolfgang Denk wrote:
> Simon Glass wrote:
> > 0 errors, 44 warnings for
> > 0001-sandbox-Add-architecture-header-files.patch: warning:
> > arch/sandbox/include/asm/bitops.h,30: Use of volatile is usually wrong:
> > see Documentation/volatile-considered-harmful.txt warning:
> > arch/sandbox/include/asm/bitops.h,32: Use of volatile is usually wrong:
> > see Documentation/volatile-considered-harmful.txt warning:
> > arch/sandbox/include/asm/bitops.h,34: Use of volatile is usually wrong:
> > see Documentation/volatile-considered-harmful.txt warning:
> > arch/sandbox/include/asm/bitops.h,36: Use of volatile is usually wrong:
> > see Documentation/volatile-considered-harmful.txt warning:
> > arch/sandbox/include/asm/bitops.h,44: Use of volatile is usually wrong:
> > see Documentation/volatile-considered-harmful.txt warning:
> > arch/sandbox/include/asm/bitops.h,54: Use of volatile is usually wrong:
> > see Documentation/volatile-considered-harmful.txt warning:
> > arch/sandbox/include/asm/bitops.h,66: Use of volatile is usually wrong:
> > see Documentation/volatile-considered-harmful.txt warning:
> > arch/sandbox/include/asm/bitops.h,76: Use of volatile is usually wrong:
> > see Documentation/volatile-considered-harmful.txt warning:
> > arch/sandbox/include/asm/bitops.h,88: Use of volatile is usually wrong:
> > see Documentation/volatile-considered-harmful.txt warning:
> > arch/sandbox/include/asm/bitops.h,90: Use of volatile is usually wrong:
> > see Documentation/volatile-considered-harmful.txt
> > 
> > (These are the bitops and seem to have volatile in all the other archs
> > also.)
> 
> Existence of bad code examples is no excuse for submitting new bad
> code.

maybe we should take this up with LKML rather than forcing our code to 
randomly fork ...
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v5 01/20] sandbox: Add architecture header files

2011-10-09 Thread Simon Glass
Hi,

On Sun, Oct 9, 2011 at 6:03 PM, Mike Frysinger  wrote:
> On Sunday 09 October 2011 15:28:16 Wolfgang Denk wrote:
>> Simon Glass wrote:
>> > 0 errors, 44 warnings for
>> > 0001-sandbox-Add-architecture-header-files.patch: warning:
>> > arch/sandbox/include/asm/bitops.h,30: Use of volatile is usually wrong:
>> > see Documentation/volatile-considered-harmful.txt warning:
>> > arch/sandbox/include/asm/bitops.h,32: Use of volatile is usually wrong:
>> > see Documentation/volatile-considered-harmful.txt warning:
>> > arch/sandbox/include/asm/bitops.h,34: Use of volatile is usually wrong:
>> > see Documentation/volatile-considered-harmful.txt warning:
>> > arch/sandbox/include/asm/bitops.h,36: Use of volatile is usually wrong:
>> > see Documentation/volatile-considered-harmful.txt warning:
>> > arch/sandbox/include/asm/bitops.h,44: Use of volatile is usually wrong:
>> > see Documentation/volatile-considered-harmful.txt warning:
>> > arch/sandbox/include/asm/bitops.h,54: Use of volatile is usually wrong:
>> > see Documentation/volatile-considered-harmful.txt warning:
>> > arch/sandbox/include/asm/bitops.h,66: Use of volatile is usually wrong:
>> > see Documentation/volatile-considered-harmful.txt warning:
>> > arch/sandbox/include/asm/bitops.h,76: Use of volatile is usually wrong:
>> > see Documentation/volatile-considered-harmful.txt warning:
>> > arch/sandbox/include/asm/bitops.h,88: Use of volatile is usually wrong:
>> > see Documentation/volatile-considered-harmful.txt warning:
>> > arch/sandbox/include/asm/bitops.h,90: Use of volatile is usually wrong:
>> > see Documentation/volatile-considered-harmful.txt
>> >
>> > (These are the bitops and seem to have volatile in all the other archs
>> > also.)
>>
>> Existence of bad code examples is no excuse for submitting new bad
>> code.
>
> maybe we should take this up with LKML rather than forcing our code to
> randomly fork ...
> -mike
>

Maybe, but I suspect they would take a patch, given that their own
checkpatch complains about it.

Regards,
Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot