[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 06/28] i386/i386/db_interface.c (db_write_bytes): simplify co
From: |
Samuel Thibault |
Subject: |
Re: [PATCH 06/28] i386/i386/db_interface.c (db_write_bytes): simplify code |
Date: |
Mon, 9 Dec 2013 00:46:20 +0900 |
User-agent: |
Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30) |
Marin Ramesa, le Sun 08 Dec 2013 12:40:08 +0100, a écrit :
> Remove assignments without any effect and unnecessary variables.
Err, *ptep0 assignment does have an effect, what makes you think
otherwise?
> * i386/i386/db_interface.c (db_write_bytes) (oldmap0, addr1, ptep1, oldmap1):
> Remove variables.
> (db_write_bytes) (oldmap0, ptep0): Remove assignment.
> (db_write_bytes) (addr1, ptep1, oldmap1): Remove assignments.
> (db_write_bytes) (oldmap0, ptep0, ptep1, oldmap1): Remove assignments.
>
> ---
> i386/i386/db_interface.c | 17 -----------------
> 1 file changed, 17 deletions(-)
>
> diff --git a/i386/i386/db_interface.c b/i386/i386/db_interface.c
> index 90ebf06..fd73c43 100644
> --- a/i386/i386/db_interface.c
> +++ b/i386/i386/db_interface.c
> @@ -507,10 +507,6 @@ db_write_bytes(
> char *dst;
>
> pt_entry_t *ptep0 = 0;
> - pt_entry_t oldmap0 = 0;
> - vm_offset_t addr1;
> - pt_entry_t *ptep1 = 0;
> - pt_entry_t oldmap1 = 0;
> extern char etext;
>
> if ((addr < VM_MIN_KERNEL_ADDRESS) ^
> @@ -533,17 +529,8 @@ db_write_bytes(
> addr <= (vm_offset_t)&etext)
> {
> ptep0 = pmap_pte(kernel_pmap, addr);
> - oldmap0 = *ptep0;
> *ptep0 |= INTEL_PTE_WRITE;
>
> - addr1 = i386_trunc_page(addr + size - 1);
> - if (i386_trunc_page(addr) != addr1) {
> - /* data crosses a page boundary */
> -
> - ptep1 = pmap_pte(kernel_pmap, addr1);
> - oldmap1 = *ptep1;
> - *ptep1 |= INTEL_PTE_WRITE;
> - }
> if (CPU_HAS_FEATURE(CPU_FEATURE_PGE))
> set_cr4(get_cr4() & ~CR4_PGE);
> flush_tlb();
> @@ -555,10 +542,6 @@ db_write_bytes(
> *dst++ = *data++;
>
> if (ptep0) {
> - *ptep0 = oldmap0;
> - if (ptep1) {
> - *ptep1 = oldmap1;
> - }
> flush_tlb();
> if (CPU_HAS_FEATURE(CPU_FEATURE_PGE))
> set_cr4(get_cr4() | CR4_PGE);
> --
> 1.8.1.4
>
>
--
Samuel
<N> je déteste import
<N> parce que lorsque tu fais du python et que tu oublies le #!/bin/env python
et que tu mets le fichier exécutable
<N> import est exécuté
-+- #ens-mim - pourquoi mon script python change le curseur de la souris ?! -+-
[PATCH 05/28] i386/i386/db_interface.c: remove forward declaration, Marin Ramesa, 2013/12/08
[PATCH 07/28] ddb/db_aout.c (aout_db_sym_init): remove unnecessary variable, Marin Ramesa, 2013/12/08
[PATCH 08/28] ddb/db_aout.c (aout_db_eq_name): remove unnecessary variable, Marin Ramesa, 2013/12/08
[PATCH 09/28] ddb/db_aout.c (aout_db_is_filename): remove unnecessary check, Marin Ramesa, 2013/12/08