All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hfc_sx: Remove unnecessary cast
@ 2009-08-14 21:06 Davidlohr Bueso
  0 siblings, 0 replies; only message in thread
From: Davidlohr Bueso @ 2009-08-14 21:06 UTC (permalink / raw)
  To: kernel-janitors

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.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>

---
 drivers/isdn/hisax/hfc_sx.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/isdn/hisax/hfc_sx.c b/drivers/isdn/hisax/hfc_sx.c
index d92e8d6..172bf19 100644
--- a/drivers/isdn/hisax/hfc_sx.c
+++ b/drivers/isdn/hisax/hfc_sx.c
@@ -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 */

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-08-14 21:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-14 21:06 [PATCH] hfc_sx: Remove unnecessary cast Davidlohr Bueso

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.