From 1f6849338767f200df70d931df5e27e7b9b62635 Mon Sep 17 00:00:00 2001 From: mrg Date: Thu, 7 Jul 2011 01:26:55 +0000 Subject: [PATCH] avoid a multi-level cast issue --- sys/arch/macppc/stand/ofwboot/ofdev.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/arch/macppc/stand/ofwboot/ofdev.c b/sys/arch/macppc/stand/ofwboot/ofdev.c index 7cb373df9cdd..39f68e88181b 100644 --- a/sys/arch/macppc/stand/ofwboot/ofdev.c +++ b/sys/arch/macppc/stand/ofwboot/ofdev.c @@ -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 @@ devopen(struct open_file *of, const char *name, char **file) || 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,