Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic Drop unnecessary-but-harmful casts.



details:   https://anonhg.NetBSD.org/src/rev/eb16055c95d7
branches:  trunk
changeset: 804058:eb16055c95d7
user:      joerg <joerg%NetBSD.org@localhost>
date:      Sat Nov 22 00:17:07 2014 +0000

description:
Drop unnecessary-but-harmful casts.

diffstat:

 sys/dev/ic/rtl8169.c |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (40 lines):

diff -r fcf99dc173ed -r eb16055c95d7 sys/dev/ic/rtl8169.c
--- a/sys/dev/ic/rtl8169.c      Fri Nov 21 23:37:25 2014 +0000
+++ b/sys/dev/ic/rtl8169.c      Sat Nov 22 00:17:07 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rtl8169.c,v 1.142 2014/10/14 00:56:48 uwe Exp $        */
+/*     $NetBSD: rtl8169.c,v 1.143 2014/11/22 00:17:07 joerg Exp $      */
 
 /*
  * Copyright (c) 1997, 1998-2003
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rtl8169.c,v 1.142 2014/10/14 00:56:48 uwe Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtl8169.c,v 1.143 2014/11/22 00:17:07 joerg Exp $");
 /* $FreeBSD: /repoman/r/ncvs/src/sys/dev/re/if_re.c,v 1.20 2004/04/11 20:34:08 ru Exp $ */
 
 /*
@@ -454,8 +454,8 @@
        /* Put some data in the mbuf */
 
        eh = mtod(m0, struct ether_header *);
-       memcpy(eh->ether_dhost, (char *)&dst, ETHER_ADDR_LEN);
-       memcpy(eh->ether_shost, (char *)&src, ETHER_ADDR_LEN);
+       memcpy(eh->ether_dhost, &dst, ETHER_ADDR_LEN);
+       memcpy(eh->ether_shost, &src, ETHER_ADDR_LEN);
        eh->ether_type = htons(ETHERTYPE_IP);
        m0->m_pkthdr.len = m0->m_len = ETHER_MIN_LEN - ETHER_CRC_LEN;
 
@@ -517,8 +517,8 @@
 
        /* Test that the received packet data matches what we sent. */
 
-       if (memcmp((char *)&eh->ether_dhost, (char *)&dst, ETHER_ADDR_LEN) ||
-           memcmp((char *)&eh->ether_shost, (char *)&src, ETHER_ADDR_LEN) ||
+       if (memcmp(&eh->ether_dhost, &dst, ETHER_ADDR_LEN) ||
+           memcmp(&eh->ether_shost, &src, ETHER_ADDR_LEN) ||
            ntohs(eh->ether_type) != ETHERTYPE_IP) {
                aprint_error_dev(sc->sc_dev, "WARNING, DMA FAILURE!\n"
                    "expected TX data: %s/%s/0x%x\n"



Home | Main Index | Thread Index | Old Index