From: Ricardo Silva Date: Mon, 15 May 2017 19:40:15 +0000 (-0300) Subject: [media] lirc_zilog: Use sizeof(*p) instead of sizeof(struct P) X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d44e07c752ecfed1fb131cd0c5f103e299c22ab4;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git [media] lirc_zilog: Use sizeof(*p) instead of sizeof(struct P) Fix all checkpatch reported issues for "CHECK: Prefer kzalloc(sizeof(*

)...) over kzalloc(sizeof(struct

)...)". Other similar case in the code already using recommended style, so make it all consistent with the recommended practice. Signed-off-by: Ricardo Silva Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/staging/media/lirc/lirc_zilog.c b/drivers/staging/media/lirc/lirc_zilog.c index 4af0068ab0c5..48628bab62fc 100644 --- a/drivers/staging/media/lirc/lirc_zilog.c +++ b/drivers/staging/media/lirc/lirc_zilog.c @@ -1462,7 +1462,7 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) /* Use a single struct IR instance for both the Rx and Tx functions */ ir = get_ir_device_by_adapter(adap); if (!ir) { - ir = kzalloc(sizeof(struct IR), GFP_KERNEL); + ir = kzalloc(sizeof(*ir), GFP_KERNEL); if (!ir) { ret = -ENOMEM; goto out_no_ir; @@ -1502,7 +1502,7 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) rx = get_ir_rx(ir); /* Set up a struct IR_tx instance */ - tx = kzalloc(sizeof(struct IR_tx), GFP_KERNEL); + tx = kzalloc(sizeof(*tx), GFP_KERNEL); if (!tx) { ret = -ENOMEM; goto out_put_xx; @@ -1546,7 +1546,7 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) tx = get_ir_tx(ir); /* Set up a struct IR_rx instance */ - rx = kzalloc(sizeof(struct IR_rx), GFP_KERNEL); + rx = kzalloc(sizeof(*rx), GFP_KERNEL); if (!rx) { ret = -ENOMEM; goto out_put_xx;