public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: Linus Torvalds <torvalds@osdl.org>,
	akpm@osdl.org,
	Michal Piotrowski <michal.k.k.piotrowski@gmail.com>
Cc: keyrings@linux-nfs.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH] Keys: Get rid of warning in kmod.c if keys disabled
Date: Fri, 21 Oct 2005 11:31:31 +0100	[thread overview]
Message-ID: <7369.1129890691@warthog.cambridge.redhat.com> (raw)
In-Reply-To: <6bffcb0e0510201124t66284e7ct@mail.gmail.com>


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 <dhowells@redhat.com>
---
warthog>diffstat -p1 keys-kmodwarn-2614rc1mm1.diff
 kernel/kmod.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff -uNrp linux-2.6.14-rc4-mm1/kernel/kmod.c linux-2.6.14-rc4-michal/kernel/kmod.c
--- linux-2.6.14-rc4-mm1/kernel/kmod.c	2005-08-30 13:56:39.000000000 +0100
+++ linux-2.6.14-rc4-michal/kernel/kmod.c	2005-10-21 11:13:16.000000000 +0100
@@ -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(&current->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(&current->blocked);
 	recalc_sigpending();

  reply	other threads:[~2005-10-21 10:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-20  6:33 Linux v2.6.14-rc5 Linus Torvalds
2005-10-20 10:25 ` Michael Neuffer
2005-10-20 13:07   ` Felix Oxley
2005-10-20 18:24 ` Michal Piotrowski
2005-10-21 10:31   ` David Howells [this message]
2005-10-21 14:07     ` [PATCH] Keys: Get rid of warning in kmod.c if keys disabled Michal Piotrowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7369.1129890691@warthog.cambridge.redhat.com \
    --to=dhowells@redhat.com \
    --cc=akpm@osdl.org \
    --cc=keyrings@linux-nfs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.k.k.piotrowski@gmail.com \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox