From: Lucas Stach <l.stach@pengutronix.de>
To: Holger Schurig <holgerschurig@gmail.com>
Cc: "barebox@lists.infradead.org" <barebox@lists.infradead.org>
Subject: Re: [PATCH 3/3] sandbox: work around missing of_add_memory_bank()
Date: Tue, 22 Jul 2014 12:52:06 +0200 [thread overview]
Message-ID: <1406026326.4667.46.camel@weser.hi.pengutronix.de> (raw)
In-Reply-To: <CAOpc7mFrJ=CWj5hqVeVxfe=tSxxo0UcdeOTK3UV7WDSxZ5A53w@mail.gmail.com>
Am Dienstag, den 22.07.2014, 12:25 +0200 schrieb Holger Schurig:
> > but this doesn't explain a build failure
>
> The build failure was
>
> LD barebox
> drivers/built-in.o: In function `of_add_memory':
> /home/schurig/d/mkarm/barebox/drivers/of/base.c:1716: undefined
> reference to `of_add_memory_bank'
> collect2: error: ld returned 1 exit status
> make: *** [barebox] Error 1
>
> To be honest, I simply assumed "sandbox has no memory banks, so adding
> them is futile" and commented them away. Two weeks ago (or so, not
> exactly sure) there was talk on the same function here in the mailing
> list. At that time there have been some other suggestions, but they
> made the MIPS arch not build. Sascha then said he had no further idea.
>
> > CONFIG_OFTREE_MEM_GENERIC to be enabled on sandbox. Would
> > this work for you?
>
> Yes, that worked. This now checks even more code than my #ifdeffery
> would have checked, so I like it.
>
> Would then this be ok?
>
> --- a/drivers/of/Kconfig
> +++ b/drivers/of/Kconfig
> @@ -4,7 +4,7 @@ config OFTREE
>
> config OFTREE_MEM_GENERIC
> depends on OFTREE
> - depends on PPC || ARM || ARCH_EFI
> + depends on PPC || ARM || ARCH_EFI || SANDBOX
> def_bool y
>
I'm fine with this solution.
>
>
> Unrelated: which static checkers use you in non-kernel project? I
> know sparse, but that isn't really usable outisde the kernel, or is
> it?
>
Personally I've used smatch (it also needs to run a build), but don't
know how useful this is outside of a kernel/barebox source tree. My
current favorite is cppcheck as it doesn't need a build run and provides
a really good signal-to-noise level, but this also means it might
overlook some potential problems.
> I found clang's static checker giving out lots of warning, similar to
> -Wall -Weverything, e.g. he spits out things that aren't technically
> errors, but not clean code (e.g. assignment to a variable that is not
> used afterwards). But in my own code he found via reasoning some paths
> where a null-pointer dereference could happen, or a division by zero.
> That's something I don't want. BTW, clangs static checker finds also
> both things in barebox, I've had not yet the time to check if they are
> indeed possible. He also finds various places of usage of initialized
> variables. Some of them I checked, and they have been true. In the
> HTML output he writes exactly what circumstances must be valid to
> reach that specific point in the code. You cannot easily see that from
> what it spits to stdout.
Good to know. I think I'll give it another go after your patches are
accepted.
Regards,
Lucas
--
Pengutronix e.K. | Lucas Stach |
Industrial Linux Solutions | http://www.pengutronix.de/ |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
prev parent reply other threads:[~2014-07-22 10:54 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-22 7:57 Holger Schurig
2014-07-22 8:32 ` Lucas Stach
2014-07-22 8:39 ` Holger Schurig
2014-07-22 8:50 ` Lucas Stach
2014-07-22 8:59 ` Holger Schurig
2014-07-22 9:09 ` Holger Schurig
2014-07-22 9:43 ` Lucas Stach
2014-07-22 10:25 ` Holger Schurig
2014-07-22 10:52 ` Lucas Stach [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1406026326.4667.46.camel@weser.hi.pengutronix.de \
--to=l.stach@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=holgerschurig@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox