Skip to contentSkip to conversation

hfc_sx: Remove unnecessary cast

PATCH New Davidlohr Bueso 1 participant 1 message Aug 14, 2009 Kernel janitors

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hfc_sx: Remove unnecessary cast

Do not need to cast kmalloc, and make the code around it a bit easier to read. Something needed for all the file actually, as the style is not very standard.

Thanks.

---
 drivers/isdn/hisax/hfc_sx.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)
drivers/isdn/hisax/hfc_sx.c +9 -5
index d92e8d6..172bf19 100644
@@ -1480,12 +1480,16 @@ setup_hfcsx(struct IsdnCard *card)
                  release_region(cs->hw.hfcsx.base, 2);
                  return(0);
                }  
-               if (!(cs->hw.hfcsx.extra = (void *)
-                     kmalloc(sizeof(struct hfcsx_extra), GFP_ATOMIC))) {
-                 release_region(cs->hw.hfcsx.base, 2);
-                 printk(KERN_WARNING "HFC-SX: unable to allocate memory\n");
-                 return(0);
+
+               cs->hw.hfcsx.extra = kmalloc(sizeof(struct hfcsx_extra),
+                                       GFP_ATOMIC);
+
+               if (!cs->hw.hfcsx.extra) {
+                       release_region(cs->hw.hfcsx.base, 2);
+                       printk(KERN_WARNING "HFC-SX: unable to allocate memory\n");
+                       return 0;
                }
+
                printk(KERN_INFO "HFC-S%c chip detected at base 0x%x IRQ %d HZ %d\n",
                        tmp[0], (u_int) cs->hw.hfcsx.base, cs->irq, HZ);
                cs->hw.hfcsx.int_m2 = 0;        /* disable alle interrupts */