summaryrefslogtreecommitdiffstats
path: root/sys/dev/firewire/fwcrom.c
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2006-02-04 21:37:39 +0000
committerimp <imp@FreeBSD.org>2006-02-04 21:37:39 +0000
commit06a336bb1f1a027e8dd2f08f65f90913522074e6 (patch)
tree14b17898d2a3607867df7ae4902d536c7aed8699 /sys/dev/firewire/fwcrom.c
parentc82aa9751fc22afeb974ea58005eacd4411b6611 (diff)
downloadFreeBSD-src-06a336bb1f1a027e8dd2f08f65f90913522074e6.zip
FreeBSD-src-06a336bb1f1a027e8dd2f08f65f90913522074e6.tar.gz
Don't type pun accidentally. Instead, be explicit that we're type
punning with an union so that the compiler knows.
Diffstat (limited to 'sys/dev/firewire/fwcrom.c')
-rw-r--r--sys/dev/firewire/fwcrom.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/dev/firewire/fwcrom.c b/sys/dev/firewire/fwcrom.c
index 45bedee..8a53bc7 100644
--- a/sys/dev/firewire/fwcrom.c
+++ b/sys/dev/firewire/fwcrom.c
@@ -409,13 +409,15 @@ crom_add_quad(struct crom_chunk *chunk, uint32_t entry)
int
crom_add_entry(struct crom_chunk *chunk, int key, int val)
{
- struct csrreg *reg;
- uint32_t i;
+ union
+ {
+ struct csrreg reg;
+ uint32_t i;
+ } foo;
- reg = (struct csrreg *)&i;
- reg->key = key;
- reg->val = val;
- return(crom_add_quad(chunk, (uint32_t) i));
+ foo.reg.key = key;
+ foo.reg.val = val;
+ return (crom_add_quad(chunk, foo.i));
}
int
OpenPOWER on IntegriCloud