Skip to contentSkip to conversation

brcmfmac: cleanup a sizeof()

PATCH Applied Dan Carpenter 2 participants 2 messages May 7, 2015 – May 9, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 brcmfmac: cleanup a sizeof()

"flowrings" and "*flowrings" are both pointers so this always returns sizeof(void *) and the current code works fine. But "*flowrings" is intended here and static checkers complain, so lets change it.

drivers/net/wireless/brcm80211/brcmfmac/pcie.c +1 -1
index 1831ecd..d371f1e 100644
@@ -1609,7 +1609,7 @@ static void brcmf_pcie_setup(struct device *dev, const struct firmware *fw,
 		bus->msgbuf->commonrings[i]  				&devinfo->shared.commonrings[i]->commonring;
 
-	flowrings = kcalloc(devinfo->shared.nrof_flowrings, sizeof(flowrings),
+	flowrings = kcalloc(devinfo->shared.nrof_flowrings, sizeof(*flowrings),
 			    GFP_KERNEL);
 	if (!flowrings)
 		goto fail;
Applied
#1 lore raw
Quoted 6 lines

"flowrings" and "*flowrings" are both pointers so this always returns sizeof(void *) and the current code works fine. But "*flowrings" is intended here and static checkers complain, so lets change it.

Thanks, applied to wireless-drivers-next.git.

Kalle Valo