From: Davidlohr Bueso <dave@gnu.org>
To: kernel-janitors@vger.kernel.org
Subject: [PATCH] hfc_sx: Remove unnecessary cast
Date: Fri, 14 Aug 2009 21:06:09 +0000 [thread overview]
Message-ID: <20090814210609.GA4024@fencepost.gnu.org> (raw)
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 */
reply other threads:[~2009-08-14 21:06 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090814210609.GA4024@fencepost.gnu.org \
--to=dave@gnu.org \
--cc=kernel-janitors@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).