lkml.org 
[lkml]   [2005]   [Dec]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 15/17] s390: convert /proc/cio_ignore.
2005/12/10, Andrew Morton <akpm@osdl.org>:
> Martin Schwidefsky <schwidefsky@de.ibm.com> wrote:
> >
> > +static void *
> > +cio_ignore_proc_seq_start(struct seq_file *s, loff_t *offset)
> > +{
> > + struct ccwdev_iter *iter;
> > +
> > + if (*offset > __MAX_SUBCHANNEL)
> > + return NULL;
> > + iter = kmalloc(sizeof(struct ccwdev_iter), GFP_KERNEL);
> > + if (!iter)
> > + return ERR_PTR(-ENOMEM);
> > + memset(iter, 0, sizeof(struct ccwdev_iter));
>
> kzalloc()

OK, will do.

>
> > + iter->devno = *offset;
> > + return iter;
> > +}
> > +
> > +static void
> > +cio_ignore_proc_seq_stop(struct seq_file *s, void *it)
> > +{
> > + if (!IS_ERR(it))
> > + kfree(it);
> > +}
> > +
> > +static void *
> > +cio_ignore_proc_seq_next(struct seq_file *s, void *it, loff_t *offset)
> > +{
> > + struct ccwdev_iter *iter;
> > +
> > + if (*offset > __MAX_SUBCHANNEL)
> > + return NULL;
> > + iter = (struct ccwdev_iter *)it;
>
> Unneeded (and undesirable) cast of void*.

Some people seem to prefer explicit casts to make the
type more clear. Is there any concensus on this? (I don't care
either way ;))

Cornelia
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-12-10 10:32    [W:0.033 / U:0.284 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site