diff mbox

[v2,2/2] cpufreq: powernv: Remove unnecessary devm_kzalloc() cast

Message ID 1521906759-6856-2-git-send-email-festevam@gmail.com (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Fabio Estevam March 24, 2018, 3:52 p.m. UTC
From: Fabio Estevam <fabio.estevam@nxp.com>

There is no need to use cast for the returned value
from memory allocation functions, so remove the unnecessary cast.

Detected via Coccinelle script:
scripts/coccinelle/api/alloc/alloc_cast.cocci.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
Changes since v1:
- None

 drivers/cpufreq/powernv-cpufreq.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox

Patch

diff --git a/drivers/cpufreq/powernv-cpufreq.c b/drivers/cpufreq/powernv-cpufreq.c
index 4ddfec9..eabb1c4 100644
--- a/drivers/cpufreq/powernv-cpufreq.c
+++ b/drivers/cpufreq/powernv-cpufreq.c
@@ -327,8 +327,7 @@  static int init_powernv_pstates(void)
 		powernv_freqs[i].frequency = freq * 1000; /* kHz */
 		powernv_freqs[i].driver_data = id & 0xFF;
 
-		revmap_data = (struct pstate_idx_revmap_data *)
-			      kmalloc(sizeof(*revmap_data), GFP_KERNEL);
+		revmap_data = kmalloc(sizeof(*revmap_data), GFP_KERNEL);
 		if (!revmap_data)
 			return -ENOMEM;