* [PATCH] drivers/isdn/hisax: Drop unused list
@ 2011-05-13 14:15 Julia Lawall
2011-05-13 20:10 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Julia Lawall @ 2011-05-13 14:15 UTC (permalink / raw)
To: Karsten Keil; +Cc: kernel-janitors, netdev, linux-kernel
The file st5481_init.c locally defines and initializes the adapter_list
variable, but does not use it for anything. Removing the list makes it
possible to remove the list field from the st5481_adapter data structure.
In the function probe_st5481, it also makes it possible to free the locally
allocated adapter value on an error exit.
Signed-off-by: Julia Lawall <julia@diku.dk>
---
drivers/isdn/hisax/st5481.h | 1 -
drivers/isdn/hisax/st5481_init.c | 6 +-----
2 files changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/isdn/hisax/st5481.h b/drivers/isdn/hisax/st5481.h
index 64f78a8..b9054cb 100644
--- a/drivers/isdn/hisax/st5481.h
+++ b/drivers/isdn/hisax/st5481.h
@@ -377,7 +377,6 @@ struct st5481_bcs {
};
struct st5481_adapter {
- struct list_head list;
int number_of_leds;
struct usb_device *usb_dev;
struct hisax_d_if hisax_d_if;
diff --git a/drivers/isdn/hisax/st5481_init.c b/drivers/isdn/hisax/st5481_init.c
index 1375123..9f7fd18 100644
--- a/drivers/isdn/hisax/st5481_init.c
+++ b/drivers/isdn/hisax/st5481_init.c
@@ -46,8 +46,6 @@ module_param(debug, int, 0);
#endif
int st5481_debug;
-static LIST_HEAD(adapter_list);
-
/* ======================================================================
* registration/deregistration with the USB layer
*/
@@ -86,7 +84,6 @@ static int probe_st5481(struct usb_interface *intf,
adapter->bcs[i].b_if.ifc.priv = &adapter->bcs[i];
adapter->bcs[i].b_if.ifc.l2l1 = st5481_b_l2l1;
}
- list_add(&adapter->list, &adapter_list);
retval = st5481_setup_usb(adapter);
if (retval < 0)
@@ -125,6 +122,7 @@ static int probe_st5481(struct usb_interface *intf,
err_usb:
st5481_release_usb(adapter);
err:
+ kfree(adapter);
return -EIO;
}
@@ -142,8 +140,6 @@ static void disconnect_st5481(struct usb_interface *intf)
if (!adapter)
return;
- list_del(&adapter->list);
-
st5481_stop(adapter);
st5481_release_b(&adapter->bcs[1]);
st5481_release_b(&adapter->bcs[0]);
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drivers/isdn/hisax: Drop unused list
2011-05-13 14:15 [PATCH] drivers/isdn/hisax: Drop unused list Julia Lawall
@ 2011-05-13 20:10 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2011-05-13 20:10 UTC (permalink / raw)
To: julia; +Cc: isdn, kernel-janitors, netdev, linux-kernel
From: Julia Lawall <julia@diku.dk>
Date: Fri, 13 May 2011 16:15:39 +0200
> The file st5481_init.c locally defines and initializes the adapter_list
> variable, but does not use it for anything. Removing the list makes it
> possible to remove the list field from the st5481_adapter data structure.
> In the function probe_st5481, it also makes it possible to free the locally
> allocated adapter value on an error exit.
>
> Signed-off-by: Julia Lawall <julia@diku.dk>
Applied, thanks a lot Julia.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-05-13 20:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-13 14:15 [PATCH] drivers/isdn/hisax: Drop unused list Julia Lawall
2011-05-13 20:10 ` David Miller
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).