lkml.org 
[lkml]   [2003]   [Jun]   [23]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateMon, 23 Jun 2003 06:21:37 +0100
FromChristoph Hellwig <>
SubjectRe: [PATCH] loop.c - part 1 of many
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/

\
 
 \ /
  Last update: 2005-03-22 12:36    [from the cache]
©2003-2008