mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: David Howells <dhowells@redhat.com>
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] AFS: Use patched rxrpc_kernel_send_data() correctly
Date: Thu, 19 Jul 2007 14:20:27 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LFD.0.999.0707191417530.27249@woody.linux-foundation.org> (raw)
In-Reply-To: <20070719180631.8684.65977.stgit@warthog.cambridge.redhat.com>



On Thu, 19 Jul 2007, David Howells wrote:
>
> @@ -806,8 +807,9 @@ void afs_send_simple_reply(struct afs_call *call, const void *buf, size_t len)
>  	msg.msg_flags		= 0;
>  
>  	call->state = AFS_CALL_AWAIT_ACK;
> -	switch (rxrpc_kernel_send_data(call->rxcall, &msg, len)) {
> -	case 0:
> +	n = rxrpc_kernel_send_data(call->rxcall, &msg, len);
> +	switch (n) {
> +	case 0 ... INT_MAX:
>  		_leave(" [replied]");
>  		return;

Please don't do this. There's no reason to. Why not just use the much 
simpler

	if (n >= 0) {
		_leave(" [replied]");
		return;
	}
	if (n == -ENOMEM) {
		_debug("oom");
		rxrpc_kernel_abort_call(call->rxcall, RX_USER_ABORT);
	}

rather than have a silly and totally pointless case-statement with three 
really odd cases?

			Linus

      reply	other threads:[~2007-07-19 21:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-19 18:06 David Howells
2007-07-19 21:20 ` Linus Torvalds [this message]

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=alpine.LFD.0.999.0707191417530.27249@woody.linux-foundation.org \
    --to=torvalds@linux-foundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®