All of lore.kernel.org
 help / color / mirror / Atom feed
* Question about return_address()
@ 2012-04-12 17:37 H Hartley Sweeten
  0 siblings, 0 replies; only message in thread
From: H Hartley Sweeten @ 2012-04-12 17:37 UTC (permalink / raw)
  To: linux-arm-kernel

Hello all,

I have a question about the return_address() function.

In arch/arm/include/asm/ftrace.h we have this (comment removed):


#if defined(CONFIG_FRAME_POINTER) && !defined(CONFIG_ARM_UNWIND)

void *return_address(unsigned int);

#else

extern inline void *return_address(unsigned int level)
{
	return NULL;
}

#endif


And in arch/arm/kernel/return_address.c we have this (only relevant
parts):


#include <linux/ftrace.h>

#if defined(CONFIG_FRAME_POINTER) && !defined(CONFIG_ARM_UNWIND)

void *return_address(unsigned int level)
{
	...
}

#else /* if defined(CONFIG_FRAME_POINTER) && !defined(CONFIG_ARM_UNWIND) */

#if defined(CONFIG_ARM_UNWIND)
#warning "TODO: return_address should use unwind tables"
#endif

void *return_address(unsigned int level)
{
	return NULL;
}

#endif /* if defined(CONFIG_FRAME_POINTER) && !defined(CONFIG_ARM_UNWIND) / else */

EXPORT_SYMBOL_GPL(return_address);


It appears that when CONFIG_FRAME_POINTER is set and CONFIG_ARM_UNWIND
is not the function is declared twice, once as an inline in the header and again as an
exported function in the source.

Is this a problem which should be fixed?

Right now it's producing a sparse warning:

	warning: symbol 'return_address' was not declared. Should it be static?

Regards,
Hartley

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-04-12 17:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-12 17:37 Question about return_address() H Hartley Sweeten

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.