[Intel-gfx] [PATCH v3 04/38] lib: Add a simple prime number generator

Chris Wilson chris at chris-wilson.co.uk
Fri Dec 16 19:38:38 UTC 2016


On Fri, Dec 16, 2016 at 07:25:16PM +0000, Chris Wilson wrote:
> +static void __exit primes_exit(void)
> +{
> +	const struct primes *p;
> +
> +	mutex_lock(&lock);
> +	p = rcu_dereference_protected(primes, lockdep_is_held(&lock));
> +	if (p != &small_primes) {
> +		kfree_rcu((struct primes *)p, rcu);
> +		rcu_assign_pointer(p, &small_primes);

Too much sparse appleasing, too little thinking. It's only the module
shutdown path, but we might as well be correct: s/p/primes here.
-Chris
> 

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list