[PATCH] s390: Fix missing release function and cosmetic changes
- Use kzalloc() in blacklist.c. - Kill unwanted casts in blacklist.c. - Provide release function for struct channel_subsystem. Signed-off-by: Cornelia Huck <huckc@de.ibm.com> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
88fbf18399
commit
3b793060e7
|
@ -299,10 +299,9 @@ cio_ignore_proc_seq_start(struct seq_file *s, loff_t *offset)
|
||||||
|
|
||||||
if (*offset >= (__MAX_SUBCHANNEL + 1) * (__MAX_SSID + 1))
|
if (*offset >= (__MAX_SUBCHANNEL + 1) * (__MAX_SSID + 1))
|
||||||
return NULL;
|
return NULL;
|
||||||
iter = kmalloc(sizeof(struct ccwdev_iter), GFP_KERNEL);
|
iter = kzalloc(sizeof(struct ccwdev_iter), GFP_KERNEL);
|
||||||
if (!iter)
|
if (!iter)
|
||||||
return ERR_PTR(-ENOMEM);
|
return ERR_PTR(-ENOMEM);
|
||||||
memset(iter, 0, sizeof(struct ccwdev_iter));
|
|
||||||
iter->ssid = *offset / (__MAX_SUBCHANNEL + 1);
|
iter->ssid = *offset / (__MAX_SUBCHANNEL + 1);
|
||||||
iter->devno = *offset % (__MAX_SUBCHANNEL + 1);
|
iter->devno = *offset % (__MAX_SUBCHANNEL + 1);
|
||||||
return iter;
|
return iter;
|
||||||
|
@ -322,7 +321,7 @@ cio_ignore_proc_seq_next(struct seq_file *s, void *it, loff_t *offset)
|
||||||
|
|
||||||
if (*offset >= (__MAX_SUBCHANNEL + 1) * (__MAX_SSID + 1))
|
if (*offset >= (__MAX_SUBCHANNEL + 1) * (__MAX_SSID + 1))
|
||||||
return NULL;
|
return NULL;
|
||||||
iter = (struct ccwdev_iter *)it;
|
iter = it;
|
||||||
if (iter->devno == __MAX_SUBCHANNEL) {
|
if (iter->devno == __MAX_SUBCHANNEL) {
|
||||||
iter->devno = 0;
|
iter->devno = 0;
|
||||||
iter->ssid++;
|
iter->ssid++;
|
||||||
|
@ -339,7 +338,7 @@ cio_ignore_proc_seq_show(struct seq_file *s, void *it)
|
||||||
{
|
{
|
||||||
struct ccwdev_iter *iter;
|
struct ccwdev_iter *iter;
|
||||||
|
|
||||||
iter = (struct ccwdev_iter *)it;
|
iter = it;
|
||||||
if (!is_blacklisted(iter->ssid, iter->devno))
|
if (!is_blacklisted(iter->ssid, iter->devno))
|
||||||
/* Not blacklisted, nothing to output. */
|
/* Not blacklisted, nothing to output. */
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -444,6 +444,15 @@ css_generate_pgid(struct channel_subsystem *css, u32 tod_high)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
channel_subsystem_release(struct device *dev)
|
||||||
|
{
|
||||||
|
struct channel_subsystem *css;
|
||||||
|
|
||||||
|
css = to_css(dev);
|
||||||
|
kfree(css);
|
||||||
|
}
|
||||||
|
|
||||||
static inline void __init
|
static inline void __init
|
||||||
setup_css(int nr)
|
setup_css(int nr)
|
||||||
{
|
{
|
||||||
|
@ -453,6 +462,7 @@ setup_css(int nr)
|
||||||
css[nr]->valid = 1;
|
css[nr]->valid = 1;
|
||||||
css[nr]->cssid = nr;
|
css[nr]->cssid = nr;
|
||||||
sprintf(css[nr]->device.bus_id, "css%x", nr);
|
sprintf(css[nr]->device.bus_id, "css%x", nr);
|
||||||
|
css[nr]->device.release = channel_subsystem_release;
|
||||||
tod_high = (u32) (get_clock() >> 32);
|
tod_high = (u32) (get_clock() >> 32);
|
||||||
css_generate_pgid(css[nr], tod_high);
|
css_generate_pgid(css[nr], tod_high);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue