Re: [patch 15/17] s390: convert /proc/cio_ignore.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Martin Schwidefsky <[email protected]> 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()

>  +	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*.

>  +	iter->devno++;
>  +	(*offset)++;
>  +	return iter;
>  +}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux