[coreboot] small patch for prototypes and unused variables
Maciej Pijanka
maciej.pijanka at gmail.com
Tue Oct 27 15:12:21 CET 2009
On 27/10/2009, Myles Watson <mylesgw at gmail.com> wrote:
> On Tue, Oct 27, 2009 at 7:32 AM, Maciej Pijanka
> <maciej.pijanka at gmail.com>wrote:
>
>> On 27/10/2009, Myles Watson <mylesgw at gmail.com> wrote:
>> >
>> > Maciej,
>> >
>> > Thanks for the patch. I think most of it is ready to be committed.
>> >
>> > Index: src/lib/clog2.c
>> > ===================================================================
>> > --- src/lib/clog2.c (revision 4869)
>> > +++ src/lib/clog2.c (working copy)
>> > @@ -7,6 +7,8 @@
>> > /* Assume 8 bits per byte */
>> > #define CHAR_BIT 8
>> >
>> > +unsigned long log2(unsigned long x);
>> > +
>> > unsigned long log2(unsigned long x)
>> > {
>> > // assume 8 bits per byte.
>> >
>> > Things like this make me wonder if we should just turn off the warning.
>> Is
>> > there a header file where we can put some of these prototypes?
>>
>> On begining of previous patch version, was an comment about such
>> things, i didn't found
>> suitable header where such utility function prototypes might be added,
>> if its desired to make
>> include/utils.h or something similar with better name i will move
>> prototypes there.
>>
> Sorry, I didn't look at the first version of the patch. I think that the
> cleanest thing would be to have files in include that mirror the .c files.
> If we have to add too many new .h files, maybe we should combine some .c
> files.
I split patch, leaving part that don't require adding new headers as
one, while rest is in another.
> But please note in few places prototype is just before function
>> because it is used only locally (for my knowledge) if not then it
>> should be moved to header too.
>>
> If you declare it as static that will silence the warning as well. Of
> course this only works when it is just used locally.
I checked using grep, and it seems that resource_tree is called just
from device_util.c where its declared, so might be static and moved to
not-requiring new headers part of patch.
>
> Thanks,
> Myles
>
--
Maciej Pijanka, PLD-Linux Developer, Reg Linux user #133161
POE/Perl user
-------------- next part --------------
A non-text attachment was scrubbed...
Name: coreboot-4869-prototypes-split-one.patch
Type: application/octet-stream
Size: 5332 bytes
Desc: not available
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20091027/16c369b1/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: coreboot-4869-prototypes-split-two.patch
Type: application/octet-stream
Size: 3529 bytes
Desc: not available
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20091027/16c369b1/attachment-0001.obj>
More information about the coreboot
mailing list