RE: [PATCH] Moorestown RAR Handler driver, MRST 2.6.31-rc3

From: Othman, Ossama
Date: Mon Aug 03 2009 - 13:32:37 EST


Hi Sam,

>Please use:
>+ memrar-y := memrar_allocator.o memrar_handler.o
>
>The foo-objs syntax is deprecated.

Thanks! I'll make that change.

The file `Documentation/kbuild/makefiles.txt' doesn't mention the deprecation, AFAICT. Can you tell me where it is documented?

>> +
>> +
>> +#include "memrar_allocator.h"
>> +#include <linux/slab.h>
>> +#include <linux/bug.h>
>
><linux/...> comes _before_ you own includes.
>And an empty line in between.

Will do!

This guideline doesn't appear in Documentation/CodingStyle. Should it?

>> +
>> +
>> +struct memrar_allocator *memrar_create_allocator(unsigned long base,
>> + size_t capacity,
>> + size_t block_size)
>> +{
>> + struct memrar_allocator *allocator = 0;
>
>It is recommended to separate definition,
>and assignment.
>So this should look like this:
>
> struct memrar_allocator *allocator;
>
> allocator = 0;

Okay, I'll fix that, too. Should this go into Documentation/CodingStyle, too?

>> +
>> + /* Validate parameters. */
>> + if (/*
>> + * Make sure we can allocate the entire memory allocator
>> + * space.
>> + */
>> + ULONG_MAX - capacity >= base
>> +
>> + /* Zero capacity or block size are obviously invalid. */
>> + && capacity != 0
>> + && block_size != 0) {
>
>Very ugly way to comment your if (..) IMHO
>Put the comment abvoe the if.

You're not the only that has mentioned that :). I'll fix this in the next revision, as well.

>I'm short on time - so this is the comments for today...

Thanks a lot for the feedback, Sam! I'll address all of your comments in the next revision!

-Ossama
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/