Linux MIPS Architecture development
 help / color / mirror / Atom feed
* [PATCH]: make highmem only things enclosed in the right #ifdef
@ 2002-12-18  1:42 Juan Quintela
  2002-12-18 16:35 ` Maciej W. Rozycki
  0 siblings, 1 reply; 6+ messages in thread
From: Juan Quintela @ 2002-12-18  1:42 UTC (permalink / raw)
  To: linux mips mailing list, Ralf Baechle


Hi
        a couple of variable declarations and a function declaration
        wasn't properly protected by #ifdefs.

Later, Juan.

Index: arch/mips/mm/init.c
===================================================================
RCS file: /home/cvs/linux/arch/mips/mm/init.c,v
retrieving revision 1.38.2.7
diff -u -r1.38.2.7 init.c
--- arch/mips/mm/init.c	5 Aug 2002 23:53:35 -0000	1.38.2.7
+++ arch/mips/mm/init.c	18 Dec 2002 00:49:19 -0000
@@ -161,6 +161,7 @@
 extern char _ftext, _etext, _fdata, _edata;
 extern char __init_begin, __init_end;
 
+#ifdef CONFIG_HIGHMEM
 static void __init fixrange_init (unsigned long start, unsigned long end,
 	pgd_t *pgd_base)
 {
@@ -189,22 +190,25 @@
 		j = 0;
 	}
 }
+#endif /* CONFIG_HIGHMEM */
 
 void __init pagetable_init(void)
 {
+#ifdef CONFIG_HIGHMEM
 	unsigned long vaddr;
-	pgd_t *pgd, *pgd_base;
 	pmd_t *pmd;
 	pte_t *pte;
-
+	pgd_t *pgd, pgd_base;
+#endif
 	/* Initialize the entire pgd.  */
 	pgd_init((unsigned long)swapper_pg_dir);
 	pgd_init((unsigned long)swapper_pg_dir +
 	         sizeof(pgd_t ) * USER_PTRS_PER_PGD);
 
-	pgd_base = swapper_pg_dir;
 
 #ifdef CONFIG_HIGHMEM
+	pgd_base = swapper_pg_dir;
+
 	/*
 	 * Fixed mappings:
 	 */


-- 
In theory, practice and theory are the same, but in practice they 
are different -- Larry McVoy

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

* Re: [PATCH]: make highmem only things enclosed in the right #ifdef
  2002-12-18  1:42 [PATCH]: make highmem only things enclosed in the right #ifdef Juan Quintela
@ 2002-12-18 16:35 ` Maciej W. Rozycki
  2002-12-19 10:07   ` Juan Quintela
  0 siblings, 1 reply; 6+ messages in thread
From: Maciej W. Rozycki @ 2002-12-18 16:35 UTC (permalink / raw)
  To: Juan Quintela; +Cc: linux mips mailing list, Ralf Baechle

On 18 Dec 2002, Juan Quintela wrote:

> +#ifdef CONFIG_HIGHMEM
>  	unsigned long vaddr;
> -	pgd_t *pgd, *pgd_base;
>  	pmd_t *pmd;
>  	pte_t *pte;
> -
> +	pgd_t *pgd, pgd_base;
> +#endif
>  	/* Initialize the entire pgd.  */
>  	pgd_init((unsigned long)swapper_pg_dir);

 Please don't change the spacing this way -- it worsens readability. 
Check other pathes for cases like this, too. 

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: macro@ds2.pg.gda.pl, PGP key available        +

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

* Re: [PATCH]: make highmem only things enclosed in the right #ifdef
  2002-12-18 16:35 ` Maciej W. Rozycki
@ 2002-12-19 10:07   ` Juan Quintela
  2002-12-19 11:59     ` Maciej W. Rozycki
  0 siblings, 1 reply; 6+ messages in thread
From: Juan Quintela @ 2002-12-19 10:07 UTC (permalink / raw)
  To: Maciej W. Rozycki; +Cc: linux mips mailing list, Ralf Baechle

>>>>> "maciej" == Maciej W Rozycki <macro@ds2.pg.gda.pl> writes:

maciej> On 18 Dec 2002, Juan Quintela wrote:
>> +#ifdef CONFIG_HIGHMEM
>> unsigned long vaddr;
>> -	pgd_t *pgd, *pgd_base;
>> pmd_t *pmd;
>> pte_t *pte;
>> -
>> +	pgd_t *pgd, pgd_base;
>> +#endif
>> /* Initialize the entire pgd.  */
>> pgd_init((unsigned long)swapper_pg_dir);

maciej> Please don't change the spacing this way -- it worsens readability. 
maciej> Check other pathes for cases like this, too. 

Hi

        Argh, the patch indeed missed an *.

What do you think of this new one?

Later ,Juan.

Index: arch/mips/mm/init.c
===================================================================
RCS file: /home/cvs/linux/arch/mips/mm/init.c,v
retrieving revision 1.38.2.7
diff -u -r1.38.2.7 init.c
--- arch/mips/mm/init.c	5 Aug 2002 23:53:35 -0000	1.38.2.7
+++ arch/mips/mm/init.c	19 Dec 2002 09:21:09 -0000
@@ -161,6 +161,7 @@
 extern char _ftext, _etext, _fdata, _edata;
 extern char __init_begin, __init_end;
 
+#ifdef CONFIG_HIGHMEM
 static void __init fixrange_init (unsigned long start, unsigned long end,
 	pgd_t *pgd_base)
 {
@@ -189,22 +190,26 @@
 		j = 0;
 	}
 }
+#endif /* CONFIG_HIGHMEM */
 
 void __init pagetable_init(void)
 {
+#ifdef CONFIG_HIGHMEM
 	unsigned long vaddr;
 	pgd_t *pgd, *pgd_base;
 	pmd_t *pmd;
 	pte_t *pte;
+#endif
 
 	/* Initialize the entire pgd.  */
 	pgd_init((unsigned long)swapper_pg_dir);
 	pgd_init((unsigned long)swapper_pg_dir +
 	         sizeof(pgd_t ) * USER_PTRS_PER_PGD);
 
-	pgd_base = swapper_pg_dir;
 
 #ifdef CONFIG_HIGHMEM
+	pgd_base = swapper_pg_dir;
+
 	/*
 	 * Fixed mappings:
 	 */



-- 
In theory, practice and theory are the same, but in practice they 
are different -- Larry McVoy

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

* Re: [PATCH]: make highmem only things enclosed in the right #ifdef
  2002-12-19 10:07   ` Juan Quintela
@ 2002-12-19 11:59     ` Maciej W. Rozycki
  2002-12-20 10:36       ` Juan Quintela
  0 siblings, 1 reply; 6+ messages in thread
From: Maciej W. Rozycki @ 2002-12-19 11:59 UTC (permalink / raw)
  To: Juan Quintela; +Cc: linux mips mailing list, Ralf Baechle

On 19 Dec 2002, Juan Quintela wrote:

> What do you think of this new one?

 Well, you could remove the line below:

>  	         sizeof(pgd_t ) * USER_PTRS_PER_PGD);
>  
> -	pgd_base = swapper_pg_dir;
>  
>  #ifdef CONFIG_HIGHMEM

but that's nitpicking (and I may fix it up if Ralf applies the patch as
is) -- I've pointed you out the problem of spacing more to bring your
attention to such details than to object this particular change.  The
patch looks semantically OK. 

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: macro@ds2.pg.gda.pl, PGP key available        +

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

* Re: [PATCH]: make highmem only things enclosed in the right #ifdef
  2002-12-19 11:59     ` Maciej W. Rozycki
@ 2002-12-20 10:36       ` Juan Quintela
  2002-12-20 15:37         ` Maciej W. Rozycki
  0 siblings, 1 reply; 6+ messages in thread
From: Juan Quintela @ 2002-12-20 10:36 UTC (permalink / raw)
  To: Maciej W. Rozycki; +Cc: linux mips mailing list, Ralf Baechle

>>>>> "maciej" == Maciej W Rozycki <macro@ds2.pg.gda.pl> writes:

maciej> On 19 Dec 2002, Juan Quintela wrote:
>> What do you think of this new one?

maciej> Well, you could remove the line below:

>> sizeof(pgd_t ) * USER_PTRS_PER_PGD);
>> 
>> -	pgd_base = swapper_pg_dir;
>> 
>> #ifdef CONFIG_HIGHMEM

maciej> but that's nitpicking (and I may fix it up if Ralf applies the patch as
maciej> is) -- I've pointed you out the problem of spacing more to bring your
maciej> attention to such details than to object this particular change.  The
maciej> patch looks semantically OK. 

Hi

        Do you preffer this way?

Later, Juan.


Index: arch/mips/mm/init.c
===================================================================
RCS file: /home/cvs/linux/arch/mips/mm/init.c,v
retrieving revision 1.38.2.7
diff -u -r1.38.2.7 init.c
--- arch/mips/mm/init.c	5 Aug 2002 23:53:35 -0000	1.38.2.7
+++ arch/mips/mm/init.c	20 Dec 2002 09:55:03 -0000
@@ -161,6 +161,7 @@
 extern char _ftext, _etext, _fdata, _edata;
 extern char __init_begin, __init_end;
 
+#ifdef CONFIG_HIGHMEM
 static void __init fixrange_init (unsigned long start, unsigned long end,
 	pgd_t *pgd_base)
 {
@@ -189,33 +190,35 @@
 		j = 0;
 	}
 }
+#endif /* CONFIG_HIGHMEM */
 
 void __init pagetable_init(void)
 {
+#ifdef CONFIG_HIGHMEM
 	unsigned long vaddr;
-	pgd_t *pgd, *pgd_base;
+	pgd_t *pgd;
 	pmd_t *pmd;
 	pte_t *pte;
+#endif
 
 	/* Initialize the entire pgd.  */
 	pgd_init((unsigned long)swapper_pg_dir);
 	pgd_init((unsigned long)swapper_pg_dir +
 	         sizeof(pgd_t ) * USER_PTRS_PER_PGD);
 
-	pgd_base = swapper_pg_dir;
 
 #ifdef CONFIG_HIGHMEM
 	/*
 	 * Fixed mappings:
 	 */
 	vaddr = __fix_to_virt(__end_of_fixed_addresses - 1) & PMD_MASK;
-	fixrange_init(vaddr, 0, pgd_base);
+	fixrange_init(vaddr, 0, swapper_pg_dir);
 
 	/*
 	 * Permanent kmaps:
 	 */
 	vaddr = PKMAP_BASE;
-	fixrange_init(vaddr, vaddr + PAGE_SIZE*LAST_PKMAP, pgd_base);
+	fixrange_init(vaddr, vaddr + PAGE_SIZE*LAST_PKMAP, swapper_pg_dir);
 
 	pgd = swapper_pg_dir + __pgd_offset(vaddr);
 	pmd = pmd_offset(pgd, vaddr);




-- 
In theory, practice and theory are the same, but in practice they 
are different -- Larry McVoy

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

* Re: [PATCH]: make highmem only things enclosed in the right #ifdef
  2002-12-20 10:36       ` Juan Quintela
@ 2002-12-20 15:37         ` Maciej W. Rozycki
  0 siblings, 0 replies; 6+ messages in thread
From: Maciej W. Rozycki @ 2002-12-20 15:37 UTC (permalink / raw)
  To: Juan Quintela; +Cc: linux mips mailing list, Ralf Baechle

On 20 Dec 2002, Juan Quintela wrote:

>         Do you preffer this way?

 It's actually alike to me.  I was ambiguous -- sorry for that.  But in
the context of spacing changes, I assumed it will be obvious I refer to
the double empty line.

 Anyway, the pgd_base variable seems superfluous here.  This patch is
fine.  Thanks for working on it.

  Maciej

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: macro@ds2.pg.gda.pl, PGP key available        +

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

end of thread, other threads:[~2002-12-20 15:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-18  1:42 [PATCH]: make highmem only things enclosed in the right #ifdef Juan Quintela
2002-12-18 16:35 ` Maciej W. Rozycki
2002-12-19 10:07   ` Juan Quintela
2002-12-19 11:59     ` Maciej W. Rozycki
2002-12-20 10:36       ` Juan Quintela
2002-12-20 15:37         ` Maciej W. Rozycki

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