Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/x86/x86 Use roundup2() and uintptr_t. Adviced by ri...



details:   https://anonhg.NetBSD.org/src/rev/5871d78d57d8
branches:  trunk
changeset: 338137:5871d78d57d8
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Tue May 12 00:00:35 2015 +0000

description:
Use roundup2() and uintptr_t. Adviced by riastradh@.

diffstat:

 sys/arch/x86/x86/cpu_ucode_intel.c |  7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diffs (28 lines):

diff -r 75658c7041d0 -r 5871d78d57d8 sys/arch/x86/x86/cpu_ucode_intel.c
--- a/sys/arch/x86/x86/cpu_ucode_intel.c        Mon May 11 22:28:22 2015 +0000
+++ b/sys/arch/x86/x86/cpu_ucode_intel.c        Tue May 12 00:00:35 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu_ucode_intel.c,v 1.7 2015/05/11 08:24:50 msaitoh Exp $ */
+/* $NetBSD: cpu_ucode_intel.c,v 1.8 2015/05/12 00:00:35 msaitoh Exp $ */
 /*
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu_ucode_intel.c,v 1.7 2015/05/11 08:24:50 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_ucode_intel.c,v 1.8 2015/05/12 00:00:35 msaitoh Exp $");
 
 #include "opt_xen.h"
 #include "opt_cpu_ucode.h"
@@ -131,8 +131,7 @@
                        printf("%s: memory allocation failed\n", __func__);
                        return EINVAL;
                }
-               uh = (struct intel1_ucode_header *)
-                   (((unsigned long)uh + 15) & ~0x0000000f);
+               uh = (struct intel1_ucode_header *)roundup2((uintptr_t)uh, 16);
                /* Copy to the new area */
                memcpy(uh, sc->sc_blob, sc->sc_blobsize);
        }



Home | Main Index | Thread Index | Old Index