Skip to content

Commit

Permalink
staging: brcm80211: replace bcopy with memcpy
Browse files Browse the repository at this point in the history
Use native linux memcpy instead of legacy bcopy

Signed-off-by: Stanislav Fomichev <kernel@fomichev.me>
Reviewed-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Stanislav Fomichev authored and Greg Kroah-Hartman committed Feb 18, 2011
1 parent 70de655 commit 0216069
Show file tree
Hide file tree
Showing 23 changed files with 196 additions and 207 deletions.
2 changes: 1 addition & 1 deletion drivers/staging/brcm80211/brcmfmac/bcmsdh.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ int bcmsdh_cis_read(void *sdh, uint func, u8 * cis, uint length)
BCMSDH_ERROR(("%s: out of memory\n", __func__));
return BCME_NOMEM;
}
bcopy(cis, tmp_buf, length);
memcpy(tmp_buf, cis, length);
for (tmp_ptr = tmp_buf, ptr = cis; ptr < (cis + length - 4);
tmp_ptr++) {
ptr += sprintf((char *)ptr, "%.2x ", *tmp_ptr & 0xff);
Expand Down
40 changes: 20 additions & 20 deletions drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,15 +441,15 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
val_size = sizeof(int);

if (plen >= (int)sizeof(int_val))
bcopy(params, &int_val, sizeof(int_val));
memcpy(&int_val, params, sizeof(int_val));

bool_val = (int_val != 0) ? true : false;

actionid = set ? IOV_SVAL(vi->varid) : IOV_GVAL(vi->varid);
switch (actionid) {
case IOV_GVAL(IOV_MSGLEVEL):
int_val = (s32) sd_msglevel;
bcopy(&int_val, arg, val_size);
memcpy(arg, &int_val, val_size);
break;

case IOV_SVAL(IOV_MSGLEVEL):
Expand All @@ -458,7 +458,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,

case IOV_GVAL(IOV_BLOCKMODE):
int_val = (s32) si->sd_blockmode;
bcopy(&int_val, arg, val_size);
memcpy(arg, &int_val, val_size);
break;

case IOV_SVAL(IOV_BLOCKMODE):
Expand All @@ -472,7 +472,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
break;
}
int_val = (s32) si->client_block_size[int_val];
bcopy(&int_val, arg, val_size);
memcpy(arg, &int_val, val_size);
break;

case IOV_SVAL(IOV_BLOCKSIZE):
Expand Down Expand Up @@ -514,12 +514,12 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,

case IOV_GVAL(IOV_RXCHAIN):
int_val = false;
bcopy(&int_val, arg, val_size);
memcpy(arg, &int_val, val_size);
break;

case IOV_GVAL(IOV_DMA):
int_val = (s32) si->sd_use_dma;
bcopy(&int_val, arg, val_size);
memcpy(arg, &int_val, val_size);
break;

case IOV_SVAL(IOV_DMA):
Expand All @@ -528,7 +528,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,

case IOV_GVAL(IOV_USEINTS):
int_val = (s32) si->use_client_ints;
bcopy(&int_val, arg, val_size);
memcpy(arg, &int_val, val_size);
break;

case IOV_SVAL(IOV_USEINTS):
Expand All @@ -542,7 +542,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,

case IOV_GVAL(IOV_DIVISOR):
int_val = (u32) sd_divisor;
bcopy(&int_val, arg, val_size);
memcpy(arg, &int_val, val_size);
break;

case IOV_SVAL(IOV_DIVISOR):
Expand All @@ -551,7 +551,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,

case IOV_GVAL(IOV_POWER):
int_val = (u32) sd_power;
bcopy(&int_val, arg, val_size);
memcpy(arg, &int_val, val_size);
break;

case IOV_SVAL(IOV_POWER):
Expand All @@ -560,7 +560,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,

case IOV_GVAL(IOV_CLOCK):
int_val = (u32) sd_clock;
bcopy(&int_val, arg, val_size);
memcpy(arg, &int_val, val_size);
break;

case IOV_SVAL(IOV_CLOCK):
Expand All @@ -569,7 +569,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,

case IOV_GVAL(IOV_SDMODE):
int_val = (u32) sd_sdmode;
bcopy(&int_val, arg, val_size);
memcpy(arg, &int_val, val_size);
break;

case IOV_SVAL(IOV_SDMODE):
Expand All @@ -578,7 +578,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,

case IOV_GVAL(IOV_HISPEED):
int_val = (u32) sd_hiok;
bcopy(&int_val, arg, val_size);
memcpy(arg, &int_val, val_size);
break;

case IOV_SVAL(IOV_HISPEED):
Expand All @@ -587,12 +587,12 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,

case IOV_GVAL(IOV_NUMINTS):
int_val = (s32) si->intrcount;
bcopy(&int_val, arg, val_size);
memcpy(arg, &int_val, val_size);
break;

case IOV_GVAL(IOV_NUMLOCALINTS):
int_val = (s32) 0;
bcopy(&int_val, arg, val_size);
memcpy(arg, &int_val, val_size);
break;

case IOV_GVAL(IOV_HOSTREG):
Expand Down Expand Up @@ -621,7 +621,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
int_val = 32; /* sdioh_sdmmc_rreg(si,
sd_ptr->offset); */

bcopy(&int_val, arg, sizeof(int_val));
memcpy(arg, &int_val, sizeof(int_val));
break;
}

Expand Down Expand Up @@ -657,7 +657,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
}

int_val = (int)data;
bcopy(&int_val, arg, sizeof(int_val));
memcpy(arg, &int_val, sizeof(int_val));
break;
}

Expand Down Expand Up @@ -1048,14 +1048,14 @@ sdioh_request_buffer(sdioh_info_t *sd, uint pio_dma, uint fix_inc, uint write,

/* For a write, copy the buffer data into the packet. */
if (write)
bcopy(buffer, mypkt->data, buflen_u);
memcpy(mypkt->data, buffer, buflen_u);

Status =
sdioh_request_packet(sd, fix_inc, write, func, addr, mypkt);

/* For a read, copy the packet data back to the buffer. */
if (!write)
bcopy(mypkt->data, buffer, buflen_u);
memcpy(buffer, mypkt->data, buflen_u);

pkt_buf_free_skb(sd->osh, mypkt, write ? true : false);
} else if (((u32) (pkt->data) & DMA_ALIGN_MASK) != 0) {
Expand All @@ -1075,14 +1075,14 @@ sdioh_request_buffer(sdioh_info_t *sd, uint pio_dma, uint fix_inc, uint write,

/* For a write, copy the buffer data into the packet. */
if (write)
bcopy(pkt->data, mypkt->data, pkt->len);
memcpy(mypkt->data, pkt->data, pkt->len);

Status =
sdioh_request_packet(sd, fix_inc, write, func, addr, mypkt);

/* For a read, copy the packet data back to the buffer. */
if (!write)
bcopy(mypkt->data, pkt->data, mypkt->len);
memcpy(pkt->data, mypkt->data, mypkt->len);

pkt_buf_free_skb(sd->osh, mypkt, write ? true : false);
} else { /* case 3: We have a packet and
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ dhd_prot_ioctl(dhd_pub_t *dhd, int ifidx, wl_ioctl_t *ioc, void *buf, int len)

slen = strlen("wme_dp") + 1;
if (len >= (int)(slen + sizeof(int)))
bcopy(((char *)buf + slen), &val, sizeof(int));
memcpy(&val, (char *)buf + slen, sizeof(int));
dhd->wme_dp = (u8) ltoh32(val);
}

Expand Down
16 changes: 8 additions & 8 deletions drivers/staging/brcm80211/brcmfmac/dhd_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ dhd_doiovar(dhd_pub_t *dhd_pub, const bcm_iovar_t *vi, u32 actionid,
goto exit;

if (plen >= (int)sizeof(int_val))
bcopy(params, &int_val, sizeof(int_val));
memcpy(&int_val, params, sizeof(int_val));

switch (actionid) {
case IOV_GVAL(IOV_VERSION):
Expand All @@ -224,7 +224,7 @@ dhd_doiovar(dhd_pub_t *dhd_pub, const bcm_iovar_t *vi, u32 actionid,

case IOV_GVAL(IOV_MSGLEVEL):
int_val = (s32) dhd_msg_level;
bcopy(&int_val, arg, val_size);
memcpy(arg, &int_val, val_size);
break;

case IOV_SVAL(IOV_MSGLEVEL):
Expand All @@ -239,12 +239,12 @@ dhd_doiovar(dhd_pub_t *dhd_pub, const bcm_iovar_t *vi, u32 actionid,

case IOV_GVAL(IOV_BCMERROR):
int_val = (s32) dhd_pub->bcmerror;
bcopy(&int_val, arg, val_size);
memcpy(arg, &int_val, val_size);
break;

case IOV_GVAL(IOV_WDTICK):
int_val = (s32) dhd_watchdog_ms;
bcopy(&int_val, arg, val_size);
memcpy(arg, &int_val, val_size);
break;

case IOV_SVAL(IOV_WDTICK):
Expand All @@ -262,7 +262,7 @@ dhd_doiovar(dhd_pub_t *dhd_pub, const bcm_iovar_t *vi, u32 actionid,
#ifdef DHD_DEBUG
case IOV_GVAL(IOV_DCONSOLE_POLL):
int_val = (s32) dhd_console_ms;
bcopy(&int_val, arg, val_size);
memcpy(arg, &int_val, val_size);
break;

case IOV_SVAL(IOV_DCONSOLE_POLL):
Expand Down Expand Up @@ -290,7 +290,7 @@ dhd_doiovar(dhd_pub_t *dhd_pub, const bcm_iovar_t *vi, u32 actionid,

case IOV_GVAL(IOV_IOCTLTIMEOUT):{
int_val = (s32) dhd_os_get_ioctl_resp_timeout();
bcopy(&int_val, arg, sizeof(int_val));
memcpy(arg, &int_val, sizeof(int_val));
break;
}

Expand Down Expand Up @@ -1498,7 +1498,7 @@ int dhd_iscan_delete_bss(void *dhdp, void *addr, iscan_buf_t *iscan_skip)
(bi->length));
/*
if(bi && bi_new) {
bcopy(bi, bi_new, results->buflen -
memcpy(bi_new, bi, results->buflen -
dtoh32(bi_new->length));
results->buflen -= dtoh32(bi_new->length);
}
Expand All @@ -1522,7 +1522,7 @@ int dhd_iscan_delete_bss(void *dhdp, void *addr, iscan_buf_t *iscan_skip)
(wl_bss_info_t *)((unsigned long)bi +
dtoh32
(bi->length));
bcopy(bi, bi_new,
memcpy(bi_new, bi,
dtoh32
(bi->length));
bi_new =
Expand Down
5 changes: 2 additions & 3 deletions drivers/staging/brcm80211/brcmfmac/dhd_custom_gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,8 @@ int dhd_custom_get_mac_address(unsigned char *buf)
#ifdef EXAMPLE_GET_MAC
/* EXAMPLE code */
{
u8 ea_example[ETH_ALEN] = {
{0x00, 0x11, 0x22, 0x33, 0x44, 0xFF} };
bcopy((char *)ea_example, buf, ETH_ALEN);
u8 ea_example[ETH_ALEN] = {0x00, 0x11, 0x22, 0x33, 0x44, 0xFF};
memcpy(buf, ea_example, ETH_ALEN);
}
#endif /* EXAMPLE_GET_MAC */

Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/brcm80211/brcmfmac/dhd_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -2167,7 +2167,7 @@ int dhd_bus_start(dhd_pub_t *dhdp)
bcm_mkiovar("event_msgs", dhdp->eventmask, WL_EVENTING_MASK_LEN, iovbuf,
sizeof(iovbuf));
dhdcdc_query_ioctl(dhdp, 0, WLC_GET_VAR, iovbuf, sizeof(iovbuf));
bcopy(iovbuf, dhdp->eventmask, WL_EVENTING_MASK_LEN);
memcpy(dhdp->eventmask, iovbuf, WL_EVENTING_MASK_LEN);

setbit(dhdp->eventmask, WLC_E_SET_SSID);
setbit(dhdp->eventmask, WLC_E_PRUNE);
Expand Down
Loading

0 comments on commit 0216069

Please sign in to comment.