Commit dcb77f85 authored by Erick Archer's avatar Erick Archer Committed by Kalle Valo
Browse files

wifi: brcm80211: use sizeof(*pointer) instead of sizeof(type)



It is preferred to use sizeof(*pointer) instead of sizeof(type)
due to the type of the variable can change and one needs not
change the former (unlike the latter). This patch has no effect
on runtime behavior.

At the same time remove some redundant NULL initializations.

Acked-by: default avatarArend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: default avatarErick Archer <erick.archer@outlook.com>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://msgid.link/AS8PR02MB7237FF1C2E880D1231684D708BF02@AS8PR02MB7237.eurprd02.prod.outlook.com
parent 8526f8c8
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1061,10 +1061,10 @@ static int brcmf_ops_sdio_probe(struct sdio_func *func,
	if (func->num != 2)
		return -ENODEV;

	bus_if = kzalloc(sizeof(struct brcmf_bus), GFP_KERNEL);
	bus_if = kzalloc(sizeof(*bus_if), GFP_KERNEL);
	if (!bus_if)
		return -ENOMEM;
	sdiodev = kzalloc(sizeof(struct brcmf_sdio_dev), GFP_KERNEL);
	sdiodev = kzalloc(sizeof(*sdiodev), GFP_KERNEL);
	if (!sdiodev) {
		kfree(bus_if);
		return -ENOMEM;
+2 −2
Original line number Diff line number Diff line
@@ -358,10 +358,10 @@ static void brcmf_btcoex_handler(struct work_struct *work)
 */
int brcmf_btcoex_attach(struct brcmf_cfg80211_info *cfg)
{
	struct brcmf_btcoex_info *btci = NULL;
	struct brcmf_btcoex_info *btci;
	brcmf_dbg(TRACE, "enter\n");

	btci = kmalloc(sizeof(struct brcmf_btcoex_info), GFP_KERNEL);
	btci = kmalloc(sizeof(*btci), GFP_KERNEL);
	if (!btci)
		return -ENOMEM;

+1 −1
Original line number Diff line number Diff line
@@ -4450,7 +4450,7 @@ struct brcmf_sdio *brcmf_sdio_probe(struct brcmf_sdio_dev *sdiodev)
	brcmf_dbg(TRACE, "Enter\n");

	/* Allocate private bus interface state */
	bus = kzalloc(sizeof(struct brcmf_sdio), GFP_ATOMIC);
	bus = kzalloc(sizeof(*bus), GFP_ATOMIC);
	if (!bus)
		goto fail;

+3 −3
Original line number Diff line number Diff line
@@ -1236,8 +1236,8 @@ brcmf_usb_prepare_fw_request(struct brcmf_usbdev_info *devinfo)
static int brcmf_usb_probe_cb(struct brcmf_usbdev_info *devinfo,
			      enum brcmf_fwvendor fwvid)
{
	struct brcmf_bus *bus = NULL;
	struct brcmf_usbdev *bus_pub = NULL;
	struct brcmf_bus *bus;
	struct brcmf_usbdev *bus_pub;
	struct device *dev = devinfo->dev;
	struct brcmf_fw_request *fwreq;
	int ret;
@@ -1247,7 +1247,7 @@ static int brcmf_usb_probe_cb(struct brcmf_usbdev_info *devinfo,
	if (!bus_pub)
		return -ENODEV;

	bus = kzalloc(sizeof(struct brcmf_bus), GFP_ATOMIC);
	bus = kzalloc(sizeof(*bus), GFP_ATOMIC);
	if (!bus) {
		ret = -ENOMEM;
		goto fail;
+1 −1
Original line number Diff line number Diff line
@@ -512,7 +512,7 @@ ai_attach(struct bcma_bus *pbus)
	struct si_info *sii;

	/* alloc struct si_info */
	sii = kzalloc(sizeof(struct si_info), GFP_ATOMIC);
	sii = kzalloc(sizeof(*sii), GFP_ATOMIC);
	if (sii == NULL)
		return NULL;

Loading