Re: [PATCH] kernel/res_counter.c: move BUG() to the default choice of switch at res_counter_member()

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

 



On Fri, 25 Jan 2013, Jeff Liu wrote:

> diff --git a/kernel/res_counter.c b/kernel/res_counter.c
> index ff55247..748a3bc 100644
> --- a/kernel/res_counter.c
> +++ b/kernel/res_counter.c
> @@ -135,10 +135,9 @@ res_counter_member(struct res_counter *counter, int member)
>  		return &counter->failcnt;
>  	case RES_SOFT_LIMIT:
>  		return &counter->soft_limit;
> +	default:
> +		BUG();
>  	};
> -
> -	BUG();
> -	return NULL;
>  }
>  
>  ssize_t res_counter_read(struct res_counter *counter, int member,

This doesn't work for CONFIG_BUG=n, you still need a return value.  I 
think the original version was better.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]