From owner-svn-src-head@FreeBSD.ORG Fri Jan 24 14:31:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1952F473; Fri, 24 Jan 2014 14:31:49 +0000 (UTC) Received: from mail-qc0-x22d.google.com (mail-qc0-x22d.google.com [IPv6:2607:f8b0:400d:c01::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 954B7128D; Fri, 24 Jan 2014 14:31:48 +0000 (UTC) Received: by mail-qc0-f173.google.com with SMTP id i8so4414016qcq.18 for ; Fri, 24 Jan 2014 06:31:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Fj+EiKm3xM0nF2Pm7brsEaW4NYG0BPASTKANmXmfHmw=; b=FMdX6gtKFzY9wivtNjMPzo5623yI+9m4kDRFO7odVyE2hGY7oPeUEGul5N+y/FOG55 dKmSZ68HJBgoHY28Xhvu+sH8kGzkbleS15x3PIQTF0BxTAcoNtDtTrUcX86Dst5grbg5 E6gRuqWpVNwhFguRnLA+9HfneFXGv451mS9c6Kpm+TgoW1h/8zgMRIDXeexiaOLaiN/s EKf5qVAVPNsQAOFSFkxZrjiWrrAJK88SdXs3bCP0XCFnsmRSKeMTIbkgN5/SzdAg3/70 hnZpbbLBzcF7MiJWbwfapLJR/4aCF35dQJaa2bMPkPMqtLp4dCwe67k4gzGDeqlWUBTt /XBg== MIME-Version: 1.0 X-Received: by 10.224.46.8 with SMTP id h8mr21065485qaf.49.1390573907085; Fri, 24 Jan 2014 06:31:47 -0800 (PST) Received: by 10.224.52.8 with HTTP; Fri, 24 Jan 2014 06:31:46 -0800 (PST) Received: by 10.224.52.8 with HTTP; Fri, 24 Jan 2014 06:31:46 -0800 (PST) In-Reply-To: <201401240917.s0O9HTBO046991@svn.freebsd.org> References: <201401240917.s0O9HTBO046991@svn.freebsd.org> Date: Fri, 24 Jan 2014 06:31:46 -0800 Message-ID: Subject: Re: svn commit: r261118 - head/sys/dev/usb/wlan From: Adrian Chadd To: Kevin Lo Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jan 2014 14:31:49 -0000 Memmove() isn't portable? To what? Adrian On Jan 24, 2014 4:17 AM, "Kevin Lo" wrote: > Author: kevlo > Date: Fri Jan 24 09:17:29 2014 > New Revision: 261118 > URL: http://svnweb.freebsd.org/changeset/base/261118 > > Log: > Get rid of memmove(). It's not portable. > > Tested on RT3071, RT3573, RT3570, RT3572, and RT5572. > > Reviewed by: hselasky > > Modified: > head/sys/dev/usb/wlan/if_run.c > > Modified: head/sys/dev/usb/wlan/if_run.c > > ============================================================================== > --- head/sys/dev/usb/wlan/if_run.c Fri Jan 24 09:13:30 2014 > (r261117) > +++ head/sys/dev/usb/wlan/if_run.c Fri Jan 24 09:17:29 2014 > (r261118) > @@ -359,8 +359,6 @@ static int run_write(struct run_softc *, > static int run_write_region_1(struct run_softc *, uint16_t, > const uint8_t *, int); > static int run_set_region_4(struct run_softc *, uint16_t, uint32_t, > int); > -static int run_rf3593_efuse_read_1(struct run_softc *, uint16_t, > - uint16_t *); > static int run_efuse_read(struct run_softc *, uint16_t, uint16_t *, > int); > static int run_efuse_read_2(struct run_softc *, uint16_t, uint16_t *); > static int run_eeprom_read_2(struct run_softc *, uint16_t, uint16_t > *); > @@ -1344,12 +1342,6 @@ run_set_region_4(struct run_softc *sc, u > } > > static int > -run_rf3593_efuse_read_1(struct run_softc *sc, uint16_t addr, uint16_t > *val) > -{ > - return (run_efuse_read(sc, addr * 2, val, 1)); > -} > - > -static int > run_efuse_read(struct run_softc *sc, uint16_t addr, uint16_t *val, int > count) > { > uint32_t tmp; > @@ -1390,12 +1382,9 @@ run_efuse_read(struct run_softc *sc, uin > if ((error = run_read(sc, reg, &tmp)) != 0) > return (error); > > - if (count == 2) > - *val = (addr & 2) ? tmp >> 16 : tmp & 0xffff; > - else { > - tmp >>= (8 *(addr & 0x3)); > - memmove(val, &tmp, sizeof(*val)); > - } > + tmp >>= (8 * (addr & 0x3)); > + *val = (addr & 1) ? tmp >> 16 : tmp & 0xffff; > + > return (0); > } > > @@ -1753,10 +1742,8 @@ run_read_eeprom(struct run_softc *sc) > if (sc->mac_ver >= 0x3070) { > run_read(sc, RT3070_EFUSE_CTRL, &tmp); > DPRINTF("EFUSE_CTRL=0x%08x\n", tmp); > - if ((tmp & RT3070_SEL_EFUSE) && sc->mac_ver != 0x3593) > + if ((tmp & RT3070_SEL_EFUSE) || sc->mac_ver == 0x3593) > sc->sc_srom_read = run_efuse_read_2; > - else > - sc->sc_srom_read = run_rf3593_efuse_read_1; > } > > /* read ROM version */ >