From 7b7df122f894f5b731e0f06777302ec248a7d9f1 Mon Sep 17 00:00:00 2001 From: Ioana Ciornei Date: Sun, 18 Oct 2015 15:51:51 +0300 Subject: staging: gdm724x: correct kzalloc/kmalloc sizeof argument This patch converts sizeof(TYPE) to sizeof(VAR) when used as a kzalloc/kmaloc argument. Signed-off-by: Ioana Ciornei Signed-off-by: Greg Kroah-Hartman diff --git a/drivers/staging/gdm724x/gdm_mux.c b/drivers/staging/gdm724x/gdm_mux.c index 47148cf..79af94f 100644 --- a/drivers/staging/gdm724x/gdm_mux.c +++ b/drivers/staging/gdm724x/gdm_mux.c @@ -67,7 +67,7 @@ static struct mux_tx *alloc_mux_tx(int len) { struct mux_tx *t = NULL; - t = kzalloc(sizeof(struct mux_tx), GFP_ATOMIC); + t = kzalloc(sizeof(*t), GFP_ATOMIC); if (!t) return NULL; @@ -96,7 +96,7 @@ static struct mux_rx *alloc_mux_rx(void) { struct mux_rx *r = NULL; - r = kzalloc(sizeof(struct mux_rx), GFP_KERNEL); + r = kzalloc(sizeof(*r), GFP_KERNEL); if (!r) return NULL; @@ -526,11 +526,11 @@ static int gdm_mux_probe(struct usb_interface *intf, if (bInterfaceNumber != 2) return -ENODEV; - mux_dev = kzalloc(sizeof(struct mux_dev), GFP_KERNEL); + mux_dev = kzalloc(sizeof(*mux_dev), GFP_KERNEL); if (!mux_dev) return -ENOMEM; - tty_dev = kzalloc(sizeof(struct tty_dev), GFP_KERNEL); + tty_dev = kzalloc(sizeof(*tty_dev), GFP_KERNEL); if (!tty_dev) { ret = -ENOMEM; goto err_free_mux; diff --git a/drivers/staging/gdm724x/gdm_tty.c b/drivers/staging/gdm724x/gdm_tty.c index c1412a8..e2c0f22 100644 --- a/drivers/staging/gdm724x/gdm_tty.c +++ b/drivers/staging/gdm724x/gdm_tty.c @@ -226,7 +226,7 @@ int register_lte_tty_device(struct tty_dev *tty_dev, struct device *device) for (i = 0; i < TTY_MAX_COUNT; i++) { - gdm = kmalloc(sizeof(struct gdm), GFP_KERNEL); + gdm = kmalloc(sizeof(*gdm), GFP_KERNEL); if (!gdm) return -ENOMEM; diff --git a/drivers/staging/gdm724x/gdm_usb.c b/drivers/staging/gdm724x/gdm_usb.c index d046769..92ea1a1 100644 --- a/drivers/staging/gdm724x/gdm_usb.c +++ b/drivers/staging/gdm724x/gdm_usb.c @@ -92,7 +92,7 @@ static struct usb_tx *alloc_tx_struct(int len) struct usb_tx *t = NULL; int ret = 0; - t = kzalloc(sizeof(struct usb_tx), GFP_ATOMIC); + t = kzalloc(sizeof(*t), GFP_ATOMIC); if (!t) { ret = -ENOMEM; goto out; @@ -125,7 +125,7 @@ static struct usb_tx_sdu *alloc_tx_sdu_struct(void) { struct usb_tx_sdu *t_sdu; - t_sdu = kzalloc(sizeof(struct usb_tx_sdu), GFP_KERNEL); + t_sdu = kzalloc(sizeof(*t_sdu), GFP_KERNEL); if (!t_sdu) return NULL; @@ -183,7 +183,7 @@ static struct usb_rx *alloc_rx_struct(void) struct usb_rx *r = NULL; int ret = 0; - r = kmalloc(sizeof(struct usb_rx), GFP_KERNEL); + r = kmalloc(sizeof(*r), GFP_KERNEL); if (!r) { ret = -ENOMEM; goto out; @@ -830,11 +830,11 @@ static int gdm_usb_probe(struct usb_interface *intf, return -ENODEV; } - phy_dev = kzalloc(sizeof(struct phy_dev), GFP_KERNEL); + phy_dev = kzalloc(sizeof(*phy_dev), GFP_KERNEL); if (!phy_dev) return -ENOMEM; - udev = kzalloc(sizeof(struct lte_udev), GFP_KERNEL); + udev = kzalloc(sizeof(*udev), GFP_KERNEL); if (!udev) { ret = -ENOMEM; goto err_udev; -- cgit v0.10.2