public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* FIX MES in init.c
@ 2014-09-22 19:24 nick
  2014-09-23 20:48 ` Helge Deller
  0 siblings, 1 reply; 3+ messages in thread
From: nick @ 2014-09-22 19:24 UTC (permalink / raw)
  To: jejb
  Cc: deller, akpm, himangi774, julia.lawall, mgorman, linux-parisc,
	linux-kernel

Greetings James and Other Maintainers of the Parisc Architecture,
I am wondering about two fix mes in init.c and how to fix them
for being const declared into actual variables. I will paste the
parts of the file for your convenience below.
Thanks,
Nick 
---------------------------------------------------------------------------------
static void __init gateway_init(void)
{
	unsigned long linux_gateway_page_addr;
	/* FIXME: This is 'const' in order to trick the compiler
	   into not treating it as DP-relative data. */
	extern void * const linux_gateway_page;

	linux_gateway_page_addr = LINUX_GATEWAY_ADDR & PAGE_MASK;

	/*
	 * Setup Linux Gateway page.
	 *
	 * The Linux gateway page will reside in kernel space (on virtual
	 * page 0), so it doesn't need to be aliased into user space.
	 */

	map_pages(linux_gateway_page_addr, __pa(&linux_gateway_page),
		  PAGE_SIZE, PAGE_GATEWAY, 1);
}

#ifdef CONFIG_HPUX
void
map_hpux_gateway_page(struct task_struct *tsk, struct mm_struct *mm)
{
	pgd_t *pg_dir;
	pmd_t *pmd;
	pte_t *pg_table;
	unsigned long start_pmd;
	unsigned long start_pte;
	unsigned long address;
	unsigned long hpux_gw_page_addr;
	/* FIXME: This is 'const' in order to trick the compiler
	   into not treating it as DP-relative data. */
	extern void * const hpux_gateway_page;

	hpux_gw_page_addr = HPUX_GATEWAY_ADDR & PAGE_MASK;

	/*
	 * Setup HP-UX Gateway page.
	 *
	 * The HP-UX gateway page resides in the user address space,
	 * so it needs to be aliased into each process.
	 */

	pg_dir = pgd_offset(mm,hpux_gw_page_addr);

#if PTRS_PER_PMD == 1
	start_pmd = 0;
#else
	start_pmd = ((hpux_gw_page_addr >> PMD_SHIFT) & (PTRS_PER_PMD - 1));
#endif
	start_pte = ((hpux_gw_page_addr >> PAGE_SHIFT) & (PTRS_PER_PTE - 1));
---------------------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: FIX MES in init.c
  2014-09-22 19:24 FIX MES in init.c nick
@ 2014-09-23 20:48 ` Helge Deller
  2014-09-23 20:59   ` John David Anglin
  0 siblings, 1 reply; 3+ messages in thread
From: Helge Deller @ 2014-09-23 20:48 UTC (permalink / raw)
  To: nick, jejb
  Cc: akpm, himangi774, julia.lawall, mgorman, linux-parisc,
	linux-kernel

Hi Nick,

On 09/22/2014 09:24 PM, nick wrote:
> Greetings James and Other Maintainers of the Parisc Architecture,
> I am wondering about two fix mes in init.c and how to fix them
> for being const declared into actual variables.
> ...
> 	/* FIXME: This is 'const' in order to trick the compiler
> 	   into not treating it as DP-relative data. */
> 	extern void * const linux_gateway_page;

The FIXME: is misleading. It should maybe better read "HINT:" or something like that.
Trivially it's basically just casting the symbol so that the compiler
will produce the correct code later on.
There is nothing you could try to "fix".

Helge

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: FIX MES in init.c
  2014-09-23 20:48 ` Helge Deller
@ 2014-09-23 20:59   ` John David Anglin
  0 siblings, 0 replies; 3+ messages in thread
From: John David Anglin @ 2014-09-23 20:59 UTC (permalink / raw)
  To: Helge Deller, nick, jejb
  Cc: akpm, himangi774, julia.lawall, mgorman, linux-parisc,
	linux-kernel

On 9/23/2014 4:48 PM, Helge Deller wrote:
> The FIXME: is misleading. It should maybe better read "HINT:" or 
> something like that.
> Trivially it's basically just casting the symbol so that the compiler
> will produce the correct code later on.
> There is nothing you could try to "fix".
Why not just remove "FIXME: " from these comments?

Dave

-- 
John David Anglin    dave.anglin@bell.net


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-09-23 21:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-22 19:24 FIX MES in init.c nick
2014-09-23 20:48 ` Helge Deller
2014-09-23 20:59   ` John David Anglin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox