Patchwork [17/28] kvm tools: Only call symbol__init() if we have BFD

login
register
mail settings
Submitter Matt Evans
Date Dec. 6, 2011, 3:41 a.m.
Message ID <4EDD8EDC.8090707@ozlabs.org>
Download mbox | patch
Permalink /patch/129512/
State New
Headers show

Comments

Matt Evans - Dec. 6, 2011, 3:41 a.m.
CONFIG_HAS_BFD is optional, symbol.c inclusion is optional -- so make its init
call dependent on CONFIG_HAS_BFD.

Signed-off-by: Matt Evans <matt@ozlabs.org>
---
 tools/kvm/builtin-run.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sasha Levin - Dec. 6, 2011, 8:26 a.m.
It's optional, but when CONFIG_HAS_BFD is not defined symbol__init() is
defined as an empty static function.

Why was there a need to wrap it in a #ifdef here?

On Tue, 2011-12-06 at 14:41 +1100, Matt Evans wrote:
> CONFIG_HAS_BFD is optional, symbol.c inclusion is optional -- so make its init
> call dependent on CONFIG_HAS_BFD.
> 
> Signed-off-by: Matt Evans <matt@ozlabs.org>
> ---
>  tools/kvm/builtin-run.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/tools/kvm/builtin-run.c b/tools/kvm/builtin-run.c
> index 1257c90..aaa5132 100644
> --- a/tools/kvm/builtin-run.c
> +++ b/tools/kvm/builtin-run.c
> @@ -798,8 +798,9 @@ int kvm_cmd_run(int argc, const char **argv, const char *prefix)
>  	if (!script)
>  		script = DEFAULT_SCRIPT;
>  
> +#ifdef CONFIG_HAS_BFD
>  	symbol__init(vmlinux_filename);
> -
> +#endif
>  	term_init();
>  
>  	if (!guest_name) {
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Matt Evans - Dec. 7, 2011, 3:03 a.m.
On 06/12/11 19:26, Sasha Levin wrote:
> It's optional, but when CONFIG_HAS_BFD is not defined symbol__init() is
> defined as an empty static function.
> 
> Why was there a need to wrap it in a #ifdef here?

That's an excellent question and I think the true answer is just embarrassing so
I'll just drop this patch from the series. ;-)

Thanks,


Matt

> 
> On Tue, 2011-12-06 at 14:41 +1100, Matt Evans wrote:
>> CONFIG_HAS_BFD is optional, symbol.c inclusion is optional -- so make its init
>> call dependent on CONFIG_HAS_BFD.
>>
>> Signed-off-by: Matt Evans <matt@ozlabs.org>
>> ---
>>  tools/kvm/builtin-run.c |    3 ++-
>>  1 files changed, 2 insertions(+), 1 deletions(-)
>>
>> diff --git a/tools/kvm/builtin-run.c b/tools/kvm/builtin-run.c
>> index 1257c90..aaa5132 100644
>> --- a/tools/kvm/builtin-run.c
>> +++ b/tools/kvm/builtin-run.c
>> @@ -798,8 +798,9 @@ int kvm_cmd_run(int argc, const char **argv, const char *prefix)
>>  	if (!script)
>>  		script = DEFAULT_SCRIPT;
>>  
>> +#ifdef CONFIG_HAS_BFD
>>  	symbol__init(vmlinux_filename);
>> -
>> +#endif
>>  	term_init();
>>  
>>  	if (!guest_name) {
>> --
>> To unsubscribe from this list: send the line "unsubscribe kvm" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/tools/kvm/builtin-run.c b/tools/kvm/builtin-run.c
index 1257c90..aaa5132 100644
--- a/tools/kvm/builtin-run.c
+++ b/tools/kvm/builtin-run.c
@@ -798,8 +798,9 @@  int kvm_cmd_run(int argc, const char **argv, const char *prefix)
 	if (!script)
 		script = DEFAULT_SCRIPT;
 
+#ifdef CONFIG_HAS_BFD
 	symbol__init(vmlinux_filename);
-
+#endif
 	term_init();
 
 	if (!guest_name) {