diff options
author | Tilman Schmidt <tilman@imap.cc> | 2007-05-08 23:27:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-08 23:41:14 -0400 |
commit | 21d364954f5a2a97b4e378f34a13fbf296aa16ec (patch) | |
tree | 75d507fe9ffc5032189d3f3f683044528571e46f /drivers/isdn/gigaset | |
parent | b590d2baf17f8890f648e76436abdb8674d564eb (diff) |
usb_gigaset: don't kmalloc(0)
Zero-sized allocations are pointless anyway, and the SLUB allocator
complains about them, so stop doing that.
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: Hansjoerg Lipp <hjlipp@web.de>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/isdn/gigaset')
-rw-r--r-- | drivers/isdn/gigaset/usb-gigaset.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/isdn/gigaset/usb-gigaset.c b/drivers/isdn/gigaset/usb-gigaset.c index c8e1c357cec8..a1263019df5e 100644 --- a/drivers/isdn/gigaset/usb-gigaset.c +++ b/drivers/isdn/gigaset/usb-gigaset.c | |||
@@ -138,8 +138,6 @@ struct usb_cardstate { | |||
138 | char bchars[6]; /* for request 0x19 */ | 138 | char bchars[6]; /* for request 0x19 */ |
139 | }; | 139 | }; |
140 | 140 | ||
141 | struct usb_bc_state {}; | ||
142 | |||
143 | static inline unsigned tiocm_to_gigaset(unsigned state) | 141 | static inline unsigned tiocm_to_gigaset(unsigned state) |
144 | { | 142 | { |
145 | return ((state & TIOCM_DTR) ? 1 : 0) | ((state & TIOCM_RTS) ? 2 : 0); | 143 | return ((state & TIOCM_DTR) ? 1 : 0) | ((state & TIOCM_RTS) ? 2 : 0); |
@@ -579,25 +577,21 @@ static int gigaset_brkchars(struct cardstate *cs, const unsigned char buf[6]) | |||
579 | 577 | ||
580 | static int gigaset_freebcshw(struct bc_state *bcs) | 578 | static int gigaset_freebcshw(struct bc_state *bcs) |
581 | { | 579 | { |
582 | if (!bcs->hw.usb) | 580 | /* unused */ |
583 | return 0; | ||
584 | //FIXME | ||
585 | kfree(bcs->hw.usb); | ||
586 | return 1; | 581 | return 1; |
587 | } | 582 | } |
588 | 583 | ||
589 | /* Initialize the b-channel structure */ | 584 | /* Initialize the b-channel structure */ |
590 | static int gigaset_initbcshw(struct bc_state *bcs) | 585 | static int gigaset_initbcshw(struct bc_state *bcs) |
591 | { | 586 | { |
592 | bcs->hw.usb = kmalloc(sizeof(struct usb_bc_state), GFP_KERNEL); | 587 | /* unused */ |
593 | if (!bcs->hw.usb) | 588 | bcs->hw.usb = NULL; |
594 | return 0; | ||
595 | |||
596 | return 1; | 589 | return 1; |
597 | } | 590 | } |
598 | 591 | ||
599 | static void gigaset_reinitbcshw(struct bc_state *bcs) | 592 | static void gigaset_reinitbcshw(struct bc_state *bcs) |
600 | { | 593 | { |
594 | /* nothing to do for M10x */ | ||
601 | } | 595 | } |
602 | 596 | ||
603 | static void gigaset_freecshw(struct cardstate *cs) | 597 | static void gigaset_freecshw(struct cardstate *cs) |