From: David Howells Date: Sun, 30 Oct 2005 23:02:44 +0000 (-0800) Subject: [PATCH] Keys: Get rid of warning in kmod.c if keys disabled X-Git-Tag: v2.6.15-rc1~59^2~15^2~76 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=20e1129ab831486c811d50d3905343ad48c4275f;p=linux-2.6 [PATCH] Keys: Get rid of warning in kmod.c if keys disabled The attached patch gets rid of a "statement without effect" warning when CONFIG_KEYS is disabled by making use of the return value of key_get(). The compiler will optimise all of this away when keys are disabled. Signed-Off-By: David Howells Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/kmod.c b/kernel/kmod.c index 44166e3bb8..51a892063a 100644 --- a/kernel/kmod.c +++ b/kernel/kmod.c @@ -131,14 +131,14 @@ struct subprocess_info { static int ____call_usermodehelper(void *data) { struct subprocess_info *sub_info = data; - struct key *old_session; + struct key *new_session, *old_session; int retval; /* Unblock all signals and set the session keyring. */ - key_get(sub_info->ring); + new_session = key_get(sub_info->ring); flush_signals(current); spin_lock_irq(¤t->sighand->siglock); - old_session = __install_session_keyring(current, sub_info->ring); + old_session = __install_session_keyring(current, new_session); flush_signal_handlers(current, 1); sigemptyset(¤t->blocked); recalc_sigpending();