Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 220334
b: refs/heads/master
c: 5fcc1fc
h: refs/heads/master
v: v3
  • Loading branch information
mike.rapoport@gmail.com authored and Greg Kroah-Hartman committed Oct 14, 2010
1 parent 75acbae commit 8e60d9f
Show file tree
Hide file tree
Showing 27 changed files with 75 additions and 130 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 97e17d0e7bb861c197e50433325bf2f5f9871f90
refs/heads/master: 5fcc1fcb2ec18094b3a8022b1974c0b2e9f5f73c
5 changes: 2 additions & 3 deletions trunk/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,11 @@ bcmsdh_info_t *bcmsdh_attach(osl_t *osh, void *cfghdl, void **regsva, uint irq)
{
bcmsdh_info_t *bcmsdh;

bcmsdh = (bcmsdh_info_t *) MALLOC(osh, sizeof(bcmsdh_info_t));
bcmsdh = kzalloc(sizeof(bcmsdh_info_t), GFP_ATOMIC);
if (bcmsdh == NULL) {
BCMSDH_ERROR(("bcmsdh_attach: out of memory"));
return NULL;
}
bzero((char *)bcmsdh, sizeof(bcmsdh_info_t));

/* save the handler locally */
l_bcmsdh = bcmsdh;
Expand Down Expand Up @@ -317,7 +316,7 @@ int bcmsdh_cis_read(void *sdh, uint func, u8 * cis, uint length)
if (ascii) {
/* Move binary bits to tmp and format them
into the provided buffer. */
tmp_buf = (u8 *) MALLOC(bcmsdh->osh, length);
tmp_buf = kmalloc(length, GFP_ATOMIC);
if (tmp_buf == NULL) {
BCMSDH_ERROR(("%s: out of memory\n", __func__));
return BCME_NOMEM;
Expand Down
6 changes: 2 additions & 4 deletions trunk/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,11 @@ int bcmsdh_probe(struct device *dev)
SDLX_MSG(("%s: osl_attach failed\n", __func__));
goto err;
}
sdhc = MALLOC(osh, sizeof(bcmsdh_hc_t));
sdhc = kzalloc(sizeof(bcmsdh_hc_t), GFP_ATOMIC);
if (!sdhc) {
SDLX_MSG(("%s: out of memory\n", __func__));
goto err;
}
bzero(sdhc, sizeof(bcmsdh_hc_t));
sdhc->osh = osh;

sdhc->dev = (void *)dev;
Expand Down Expand Up @@ -427,12 +426,11 @@ bcmsdh_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
SDLX_MSG(("%s: osl_attach failed\n", __func__));
goto err;
}
sdhc = MALLOC(osh, sizeof(bcmsdh_hc_t));
sdhc = kzalloc(sizeof(bcmsdh_hc_t), GFP_ATOMIC);
if (!sdhc) {
SDLX_MSG(("%s: out of memory\n", __func__));
goto err;
}
bzero(sdhc, sizeof(bcmsdh_hc_t));
sdhc->osh = osh;

sdhc->dev = pdev;
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,11 @@ extern sdioh_info_t *sdioh_attach(osl_t *osh, void *bar0, uint irq)
return NULL;
}

sd = (sdioh_info_t *) MALLOC(osh, sizeof(sdioh_info_t));
sd = kzalloc(sizeof(sdioh_info_t), GFP_ATOMIC);
if (sd == NULL) {
sd_err(("sdioh_attach: out of memory\n"));
return NULL;
}
bzero((char *)sd, sizeof(sdioh_info_t));
sd->osh = osh;
if (sdioh_sdmmc_osinit(sd) != 0) {
sd_err(("%s:sdioh_sdmmc_osinit() failed\n", __func__));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ int sdioh_sdmmc_osinit(sdioh_info_t *sd)
{
struct sdos_info *sdos;

sdos = (struct sdos_info *)MALLOC(sd->osh, sizeof(struct sdos_info));
sdos = kmalloc(sizeof(struct sdos_info), GFP_ATOMIC);
sd->sdos_info = (void *)sdos;
if (sdos == NULL)
return BCME_NOMEM;
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,12 +406,11 @@ int dhd_prot_attach(dhd_pub_t *dhd)
{
dhd_prot_t *cdc;

cdc = (dhd_prot_t *) MALLOC(dhd->osh, sizeof(dhd_prot_t));
cdc = kzalloc(sizeof(dhd_prot_t), GFP_ATOMIC);
if (!cdc) {
DHD_ERROR(("%s: kmalloc failed\n", __func__));
goto fail;
}
memset(cdc, 0, sizeof(dhd_prot_t));

/* ensure that the msg buf directly follows the cdc msg struct */
if ((uintptr) (&cdc->msg + 1) != (uintptr) cdc->buf) {
Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/staging/brcm80211/brcmfmac/dhd_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,7 @@ dhd_pktfilter_offload_enable(dhd_pub_t *dhd, char *arg, int enable,
wl_pkt_filter_enable_t enable_parm;
wl_pkt_filter_enable_t *pkt_filterp;

arg_save = MALLOC(dhd->osh, strlen(arg) + 1);
arg_save = kmalloc(strlen(arg) + 1, GFP_ATOMIC);
if (!arg_save) {
DHD_ERROR(("%s: kmalloc failed\n", __func__));
goto fail;
Expand Down Expand Up @@ -1070,15 +1070,15 @@ void dhd_pktfilter_offload_set(dhd_pub_t *dhd, char *arg)
char *arg_save = 0, *arg_org = 0;
#define BUF_SIZE 2048

arg_save = MALLOC(dhd->osh, strlen(arg) + 1);
arg_save = kmalloc(strlen(arg) + 1, GFP_ATOMIC);
if (!arg_save) {
DHD_ERROR(("%s: kmalloc failed\n", __func__));
goto fail;
}

arg_org = arg_save;

buf = MALLOC(dhd->osh, BUF_SIZE);
buf = kmalloc(BUF_SIZE, GFP_ATOMIC);
if (!buf) {
DHD_ERROR(("%s: kmalloc failed\n", __func__));
goto fail;
Expand Down Expand Up @@ -1363,7 +1363,7 @@ iscan_buf_t *dhd_iscan_allocate_buf(dhd_pub_t *dhd, iscan_buf_t **iscanbuf)

dhd_iscan_lock();

iscanbuf_alloc = (iscan_buf_t *) MALLOC(dhd->osh, sizeof(iscan_buf_t));
iscanbuf_alloc = kmalloc(sizeof(iscan_buf_t), GFP_ATOMIC);
if (iscanbuf_alloc == NULL)
goto fail;

Expand Down
10 changes: 5 additions & 5 deletions trunk/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ static void _dhd_set_multicast_list(dhd_info_t *dhd, int ifidx)
/* Send down the multicast list first. */

buflen = sizeof("mcast_list") + sizeof(cnt) + (cnt * ETHER_ADDR_LEN);
bufp = buf = MALLOC(dhd->pub.osh, buflen);
bufp = buf = kmalloc(buflen, GFP_ATOMIC);
if (!bufp) {
DHD_ERROR(("%s: out of memory for mcast_list, cnt %d\n",
dhd_ifname(&dhd->pub, ifidx), cnt));
Expand Down Expand Up @@ -755,7 +755,7 @@ static void _dhd_set_multicast_list(dhd_info_t *dhd, int ifidx)
*/

buflen = sizeof("allmulti") + sizeof(allmulti);
buf = MALLOC(dhd->pub.osh, buflen);
buf = kmalloc(buflen, GFP_ATOMIC);
if (!buf) {
DHD_ERROR(("%s: out of memory for allmulti\n",
dhd_ifname(&dhd->pub, ifidx)));
Expand Down Expand Up @@ -1676,7 +1676,7 @@ static int dhd_ioctl_entry(struct net_device *net, struct ifreq *ifr, int cmd)
} else {
*/
{
buf = (char *)MALLOC(dhd->pub.osh, buflen);
buf = kmalloc(buflen, GFP_ATOMIC);
if (!buf) {
bcmerror = -BCME_NOMEM;
goto done;
Expand Down Expand Up @@ -1841,7 +1841,7 @@ dhd_add_if(dhd_info_t *dhd, int ifidx, void *handle, char *name,
ASSERT(dhd && (ifidx < DHD_MAX_IFS));

ifp = dhd->iflist[ifidx];
if (!ifp && !(ifp = MALLOC(dhd->pub.osh, sizeof(dhd_if_t)))) {
if (!ifp && !(ifp = kmalloc(sizeof(dhd_if_t), GFP_ATOMIC))) {
DHD_ERROR(("%s: OOM - dhd_if_t\n", __func__));
return -ENOMEM;
}
Expand Down Expand Up @@ -1904,7 +1904,7 @@ dhd_pub_t *dhd_attach(osl_t *osh, struct dhd_bus *bus, uint bus_hdrlen)
}

/* Allocate primary dhd_info */
dhd = MALLOC(osh, sizeof(dhd_info_t));
dhd = kmalloc(sizeof(dhd_info_t), GFP_ATOMIC);
if (!dhd) {
DHD_ERROR(("%s: OOM - alloc dhd_info\n", __func__));
goto fail;
Expand Down
39 changes: 19 additions & 20 deletions trunk/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1822,18 +1822,18 @@ static int dhdsdio_checkdied(dhd_bus_t *bus, u8 *data, uint size)
* allocate memory to trace the trap or assert.
*/
size = msize;
mbuffer = data = MALLOC(bus->dhd->osh, msize);
mbuffer = data = kmalloc(msize, GFP_ATOMIC);
if (mbuffer == NULL) {
DHD_ERROR(("%s: MALLOC(%d) failed\n", __func__,
DHD_ERROR(("%s: kmalloc(%d) failed\n", __func__,
msize));
bcmerror = BCME_NOMEM;
goto done;
}
}

str = MALLOC(bus->dhd->osh, maxstrlen);
str = kmalloc(maxstrlen, GFP_ATOMIC);
if (str == NULL) {
DHD_ERROR(("%s: MALLOC(%d) failed\n", __func__, maxstrlen));
DHD_ERROR(("%s: kmalloc(%d) failed\n", __func__, maxstrlen));
bcmerror = BCME_NOMEM;
goto done;
}
Expand Down Expand Up @@ -1944,7 +1944,7 @@ static int dhdsdio_mem_dump(dhd_bus_t *bus)

/* Get full mem size */
size = bus->ramsize;
buf = MALLOC(bus->dhd->osh, size);
buf = kmalloc(size, GFP_ATOMIC);
if (!buf) {
printf("%s: Out of memory (%d bytes)\n", __func__, size);
return -1;
Expand Down Expand Up @@ -2004,7 +2004,7 @@ static int dhdsdio_readconsole(dhd_bus_t *bus)
/* Allocate console buffer (one time only) */
if (c->buf == NULL) {
c->bufsize = ltoh32(c->log.buf_size);
c->buf = MALLOC(bus->dhd->osh, c->bufsize);
c->buf = kmalloc(c->bufsize, GFP_ATOMIC);
if (c->buf == NULL)
return BCME_NOMEM;
}
Expand Down Expand Up @@ -2080,7 +2080,7 @@ int dhdsdio_downloadvars(dhd_bus_t *bus, void *arg, int len)
if (bus->vars)
MFREE(bus->dhd->osh, bus->vars, bus->varsz);

bus->vars = MALLOC(bus->dhd->osh, len);
bus->vars = kmalloc(len, GFP_ATOMIC);
bus->varsz = bus->vars ? len : 0;
if (bus->vars == NULL) {
bcmerror = BCME_NOMEM;
Expand Down Expand Up @@ -2526,7 +2526,7 @@ static int dhdsdio_write_vars(dhd_bus_t *bus)
varaddr = (bus->ramsize - 4) - varsize;

if (bus->vars) {
vbuffer = (u8 *) MALLOC(bus->dhd->osh, varsize);
vbuffer = kmalloc(varsize, GFP_ATOMIC);
if (!vbuffer)
return BCME_NOMEM;

Expand All @@ -2539,7 +2539,7 @@ static int dhdsdio_write_vars(dhd_bus_t *bus)
#ifdef DHD_DEBUG
/* Verify NVRAM bytes */
DHD_INFO(("Compare NVRAM dl & ul; varsize=%d\n", varsize));
nvram_ularray = (char *)MALLOC(bus->dhd->osh, varsize);
nvram_ularray = kmalloc(varsize, GFP_ATOMIC);
if (!nvram_ularray)
return BCME_NOMEM;

Expand Down Expand Up @@ -5147,12 +5147,11 @@ static void *dhdsdio_probe(u16 venid, u16 devid, u16 bus_no,
}

/* Allocate private bus interface state */
bus = MALLOC(osh, sizeof(dhd_bus_t));
bus = kzalloc(sizeof(dhd_bus_t), GFP_ATOMIC);
if (!bus) {
DHD_ERROR(("%s: MALLOC of dhd_bus_t failed\n", __func__));
DHD_ERROR(("%s: kmalloc of dhd_bus_t failed\n", __func__));
goto fail;
}
bzero(bus, sizeof(dhd_bus_t));
bus->sdh = sdh;
bus->cl_devid = (u16) devid;
bus->bus = DHD_BUS;
Expand Down Expand Up @@ -5274,7 +5273,7 @@ dhdsdio_probe_attach(struct dhd_bus *bus, osl_t *osh, void *sdh, void *regsva,
udelay(65);

for (fn = 0; fn <= numfn; fn++) {
cis[fn] = MALLOC(osh, SBSDIO_CIS_SIZE_LIMIT);
cis[fn] = kmalloc(SBSDIO_CIS_SIZE_LIMIT, GFP_ATOMIC);
if (!cis[fn]) {
DHD_INFO(("dhdsdio_probe: fn %d cis malloc "
"failed\n", fn));
Expand Down Expand Up @@ -5386,18 +5385,18 @@ static bool dhdsdio_probe_malloc(dhd_bus_t *bus, osl_t *osh, void *sdh)
bus->rxblen =
roundup((bus->dhd->maxctl + SDPCM_HDRLEN),
ALIGNMENT) + DHD_SDALIGN;
bus->rxbuf = MALLOC(osh, bus->rxblen);
bus->rxbuf = kmalloc(bus->rxblen, GFP_ATOMIC);
if (!(bus->rxbuf)) {
DHD_ERROR(("%s: MALLOC of %d-byte rxbuf failed\n",
DHD_ERROR(("%s: kmalloc of %d-byte rxbuf failed\n",
__func__, bus->rxblen));
goto fail;
}
}

/* Allocate buffer to receive glomed packet */
bus->databuf = MALLOC(osh, MAX_DATA_BUF);
bus->databuf = kmalloc(MAX_DATA_BUF, GFP_ATOMIC);
if (!(bus->databuf)) {
DHD_ERROR(("%s: MALLOC of %d-byte databuf failed\n",
DHD_ERROR(("%s: kmalloc of %d-byte databuf failed\n",
__func__, MAX_DATA_BUF));
/* release rxbuf which was already located as above */
if (!bus->rxblen)
Expand Down Expand Up @@ -5672,7 +5671,7 @@ static int dhdsdio_download_code_array(struct dhd_bus *bus)
{
unsigned char *ularray;

ularray = MALLOC(bus->dhd->osh, bus->ramsize);
ularray = kmalloc(bus->ramsize, GFP_ATOMIC);
/* Upload image to verify downloaded contents. */
offset = 0;
memset(ularray, 0xaa, bus->ramsize);
Expand Down Expand Up @@ -5734,7 +5733,7 @@ static int dhdsdio_download_code_file(struct dhd_bus *bus, char *fw_path)
if (image == NULL)
goto err;

memptr = memblock = MALLOC(bus->dhd->osh, MEMBLOCK + DHD_SDALIGN);
memptr = memblock = kmalloc(MEMBLOCK + DHD_SDALIGN, GFP_ATOMIC);
if (memblock == NULL) {
DHD_ERROR(("%s: Failed to allocate memory %d bytes\n",
__func__, MEMBLOCK));
Expand Down Expand Up @@ -5861,7 +5860,7 @@ static int dhdsdio_download_nvram(struct dhd_bus *bus)
goto err;
}

memblock = MALLOC(bus->dhd->osh, MEMBLOCK);
memblock = kmalloc(MEMBLOCK, GFP_ATOMIC);
if (memblock == NULL) {
DHD_ERROR(("%s: Failed to allocate memory %d bytes\n",
__func__, MEMBLOCK));
Expand Down
2 changes: 0 additions & 2 deletions trunk/drivers/staging/brcm80211/include/linux_osl.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,7 @@ typedef struct {

#define BUS_SWAP32(v) (v)

#define MALLOC(osh, size) osl_malloc((osh), (size))
#define MFREE(osh, addr, size) osl_mfree((osh), (addr), (size))
extern void *osl_malloc(osl_t *osh, uint size);
extern void osl_mfree(osl_t *osh, void *addr, uint size);

#define NATIVE_MALLOC(osh, size) kmalloc(size, GFP_ATOMIC)
Expand Down
6 changes: 2 additions & 4 deletions trunk/drivers/staging/brcm80211/phy/wlc_phy_cmn.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,11 +555,10 @@ shared_phy_t *wlc_phy_shared_attach(shared_phy_params_t *shp)
{
shared_phy_t *sh;

sh = (shared_phy_t *) MALLOC(shp->osh, sizeof(shared_phy_t));
sh = kzalloc(sizeof(shared_phy_t), GFP_ATOMIC);
if (sh == NULL) {
return NULL;
}
bzero((char *)sh, sizeof(shared_phy_t));

sh->osh = shp->osh;
sh->sih = shp->sih;
Expand Down Expand Up @@ -633,11 +632,10 @@ wlc_phy_t *wlc_phy_attach(shared_phy_t *sh, void *regs, int bandtype, char *vars
return &pi->pubpi_ro;
}

pi = (phy_info_t *) MALLOC(osh, sizeof(phy_info_t));
pi = kzalloc(sizeof(phy_info_t), GFP_ATOMIC);
if (pi == NULL) {
return NULL;
}
bzero((char *)pi, sizeof(phy_info_t));
pi->regs = (d11regs_t *) regs;
pi->sh = sh;
pi->phy_init_por = true;
Expand Down
13 changes: 5 additions & 8 deletions trunk/drivers/staging/brcm80211/phy/wlc_phy_lcn.c
Original file line number Diff line number Diff line change
Expand Up @@ -1882,7 +1882,7 @@ wlc_lcnphy_tx_iqlo_cal(phy_info_t *pi,
if (NORADIO_ENAB(pi->pubpi))
return;

values_to_save = MALLOC(pi->sh->osh, sizeof(u16) * 20);
values_to_save = kmalloc(sizeof(u16) * 20, GFP_ATOMIC);
if (NULL == values_to_save) {
return;
}
Expand Down Expand Up @@ -3289,7 +3289,7 @@ wlc_lcnphy_rx_iq_cal(phy_info_t *pi, const lcnphy_rx_iqcomp_t *iqcomp,
s16 *ptr;
phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;

ptr = MALLOC(pi->sh->osh, sizeof(s16) * 131);
ptr = kmalloc(sizeof(s16) * 131, GFP_ATOMIC);
if (NULL == ptr) {
return false;
}
Expand Down Expand Up @@ -4038,12 +4038,12 @@ wlc_lcnphy_a1(phy_info_t *pi, int cal_type, int num_levels, int step_size_lg2)
u16 *phy_c32;
phy_c21 = 0;
phy_c10 = phy_c13 = phy_c14 = phy_c8 = 0;
ptr = MALLOC(pi->sh->osh, sizeof(s16) * 131);
ptr = kmalloc(sizeof(s16) * 131, GFP_ATOMIC);
if (NULL == ptr) {
return;
}

phy_c32 = MALLOC(pi->sh->osh, sizeof(u16) * 20);
phy_c32 = kmalloc(sizeof(u16) * 20, GFP_ATOMIC);
if (NULL == phy_c32) {
return;
}
Expand Down Expand Up @@ -5054,13 +5054,10 @@ bool wlc_phy_attach_lcnphy(phy_info_t *pi)
{
phy_info_lcnphy_t *pi_lcn;

pi->u.pi_lcnphy =
(phy_info_lcnphy_t *) MALLOC(pi->sh->osh,
sizeof(phy_info_lcnphy_t));
pi->u.pi_lcnphy = kzalloc(sizeof(phy_info_lcnphy_t), GFP_ATOMIC);
if (pi->u.pi_lcnphy == NULL) {
return false;
}
bzero((char *)pi->u.pi_lcnphy, sizeof(phy_info_lcnphy_t));

pi_lcn = pi->u.pi_lcnphy;

Expand Down
Loading

0 comments on commit 8e60d9f

Please sign in to comment.