Module Name:    src
Committed By:   mrg
Date:           Thu Jul  7 06:01:51 UTC 2011

Modified Files:
        src/sys/arch/cobalt/stand/boot: wd.c

Log Message:
avoid pointer aliasing issues


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/cobalt/stand/boot/wd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/cobalt/stand/boot/wd.c
diff -u src/sys/arch/cobalt/stand/boot/wd.c:1.13 src/sys/arch/cobalt/stand/boot/wd.c:1.14
--- src/sys/arch/cobalt/stand/boot/wd.c:1.13	Sun Jul 11 17:09:27 2010
+++ src/sys/arch/cobalt/stand/boot/wd.c	Thu Jul  7 06:01:51 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: wd.c,v 1.13 2010/07/11 17:09:27 he Exp $	*/
+/*	$NetBSD: wd.c,v 1.14 2011/07/07 06:01:51 mrg Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -55,11 +55,12 @@
 {
 	int error;
 	uint8_t buf[DEV_BSIZE];
+	struct ataparams *params = (struct ataparams *)buf;
 
 	if ((error = wdc_exec_identify(wd, buf)) != 0)
 		return error;
 
-	wd->sc_params = *(struct ataparams *)buf;
+	wd->sc_params = *params;
 
 	/* 48-bit LBA addressing */
 	if ((wd->sc_params.atap_cmd2_en & ATA_CMD2_LBA48) != 0)

Reply via email to