Re: [patch 02/13] GRU - dump chiplet state

From: Andrew Morton
Date: Thu Apr 09 2009 - 18:39:53 EST


On Mon, 06 Apr 2009 11:08:11 -0500
steiner@xxxxxxx wrote:

> From: Jack Steiner <steiner@xxxxxxx>
>
> Add support for dumpping the state of an entire GRU chiplet.
>
> ...
>
> +static int gru_user_copy_handle(void __user **dp, void *s)
> +{
> + if (copy_to_user(*(void __user **)dp, s, GRU_HANDLE_BYTES))

the typecast appears to be unneeded?

> + return -1;
> + *dp += GRU_HANDLE_BYTES;
> + return 0;
> +}
> +
>
> ...
>
> --- linux.orig/drivers/misc/sgi-gru/grutables.h 2009-03-04 10:49:00.000000000 -0600
> +++ linux/drivers/misc/sgi-gru/grutables.h 2009-03-04 10:50:44.000000000 -0600
> @@ -554,6 +554,12 @@ struct gru_blade_state {
>
> /* Lock hierarchy checking enabled only in emulator */
>
> +/* 0 = lock failed, 1 = locked */
> +static inline int __trylock_handle(void *h)
> +{
> + return !test_and_set_bit(1, h);
> +}

It would be safer were this header to include bitops.h.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/