Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/macppc/stand/ofwboot avoid a multi-level cast issue



details:   https://anonhg.NetBSD.org/src/rev/c1ff2737038f
branches:  trunk
changeset: 767008:c1ff2737038f
user:      mrg <mrg%NetBSD.org@localhost>
date:      Thu Jul 07 01:26:55 2011 +0000

description:
avoid a multi-level cast issue

diffstat:

 sys/arch/macppc/stand/ofwboot/ofdev.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (20 lines):

diff -r 4fb57582c800 -r c1ff2737038f sys/arch/macppc/stand/ofwboot/ofdev.c
--- a/sys/arch/macppc/stand/ofwboot/ofdev.c     Thu Jul 07 01:26:37 2011 +0000
+++ b/sys/arch/macppc/stand/ofwboot/ofdev.c     Thu Jul 07 01:26:55 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ofdev.c,v 1.23 2010/10/17 15:33:04 phx Exp $   */
+/*     $NetBSD: ofdev.c,v 1.24 2011/07/07 01:26:55 mrg Exp $   */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -439,7 +439,9 @@
                    || nread != DEV_BSIZE
                    || getdisklabel(buf, &label)) {
                        /* Else try APM or MBR partitions */
-                       if (((struct drvr_map *)buf)->sbSig == DRIVER_MAP_MAGIC)
+                       struct drvr_map *map = (struct drvr_map *)buf;
+
+                       if (map->sbSig == DRIVER_MAP_MAGIC)
                                error = search_mac_label(&ofdev, buf, &label);
                        else
                                error = search_dos_label(&ofdev, 0, buf,



Home | Main Index | Thread Index | Old Index