Re: [PATCH] loop.c - part 1 of many

Christoph Hellwig (hch@infradead.org)
Mon, 23 Jun 2003 06:21:37 +0100


On Mon, Jun 23, 2003 at 03:27:51AM +0200, Andries.Brouwer@cwi.nl wrote:
> -static int figure_loop_size(struct loop_device *lo)
> +static int
> +figure_loop_size(struct loop_device *lo)

This moves away from Documentation/CondingStyle..

> int loop_register_transfer(struct loop_func_table *funcs)
> {
> - if ((unsigned)funcs->number > MAX_LO_CRYPT || xfer_funcs[funcs->number])
> + unsigned int n = funcs->number;
> +
> + if (n >= MAX_LO_CRYPT || xfer_funcs[n])
> return -EINVAL;
> - xfer_funcs[funcs->number] = funcs;
> - return 0;
> + xfer_funcs[n] = funcs;
> + return 0;
> }

Once you start touching loop_{,un}register_transfer please also get
rid of the array in favour of a linked list..

-
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/