Changes to fix below checkpatch reported issues.
CHECK: Prefer kmalloc(sizeof(*priv->wilc_gtk[idx])...) over
kmalloc(sizeof(struct wilc_wfi_key)...)
CHECK: Prefer kmalloc(sizeof(*priv->wilc_ptk[idx])...) over
kmalloc(sizeof(struct wilc_wfi_key)...)
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
static int wilc_wfi_cfg_allocate_wpa_entry(struct wilc_priv *priv, u8 idx)
{
if (!priv->wilc_gtk[idx]) {
- priv->wilc_gtk[idx] = kzalloc(sizeof(struct wilc_wfi_key),
- GFP_KERNEL);
+ priv->wilc_gtk[idx] = kzalloc(sizeof(*priv->wilc_gtk[idx]),
+ GFP_KERNEL);
if (!priv->wilc_gtk[idx])
return -ENOMEM;
}
if (!priv->wilc_ptk[idx]) {
- priv->wilc_ptk[idx] = kzalloc(sizeof(struct wilc_wfi_key),
- GFP_KERNEL);
+ priv->wilc_ptk[idx] = kzalloc(sizeof(*priv->wilc_ptk[idx]),
+ GFP_KERNEL);
if (!priv->wilc_ptk[idx])
return -ENOMEM;
}