Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1243036

Re: [PATCH] UBI: rename free variable

From Heiko Schocher <hs@denx.de>
Newsgroups linux.kernel
Subject Re: [PATCH] UBI: rename free variable
Date 2015-10-09 06:50 +0200
Message-ID <qhxN0-8vx-5@gated-at.bofh.it> (permalink)
References <qhwxA-6M8-3@gated-at.bofh.it> <qhxjX-7VM-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hello Al,

Am 09.10.2015 um 06:13 schrieb Al Viro:
> On Fri, Oct 09, 2015 at 05:29:21AM +0200, Heiko Schocher wrote:
>> rename free variable into not "free", as "free" prevents
>> ubi sources compiling under U-Boot. So rename "free"
>> into "pfree" where it is a pointer, and into "freel",
>> where it is a free list.
>
> Huh?  If U-Boot has free defined as an object-like macro, it's an outright bug
> in U-Boot and it should be fixed there.  If it's something else, it looks like
> a toolchain bug.   Details, please...

Sorry, I should have added this info immediately into the patch ...

We have in U-Boot a compat.h file, in which we collect all things
we need to make linux code running under U-Boot, and there we map
kfree() to free(), see:

http://git.denx.de/?p=u-boot.git;a=blob;f=include/linux/compat.h;h=fbebf910addd994d265d21c4fbaa0a2f48f4ccb1;hb=996ec1dcc58a34b53891acde0ec5df9141b5fcc2#l58

So, if we use a var name "free", this will conflict ... and I get
for example when compiling the UBI code:

   CC      drivers/mtd/ubi/fastmap.o
drivers/mtd/ubi/fastmap.c: In function 'scan_pool':
drivers/mtd/ubi/fastmap.c:475:3: error: called object 'free' is not a function

So with this patch, we have less differences to kernel files ...

bye,
Heiko
-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] UBI: rename free variable Heiko Schocher <hs@denx.de> - 2015-10-09 05:30 +0200
  Re: [PATCH] UBI: rename free variable Al Viro <viro@ZenIV.linux.org.uk> - 2015-10-09 06:20 +0200
    Re: [PATCH] UBI: rename free variable Heiko Schocher <hs@denx.de> - 2015-10-09 06:50 +0200
      Re: [PATCH] UBI: rename free variable Al Viro <viro@ZenIV.linux.org.uk> - 2015-10-09 07:40 +0200
        Re: [PATCH] UBI: rename free variable Heiko Schocher <hs@denx.de> - 2015-10-09 08:30 +0200

csiph-web