Re: [PATCH] AFS: Use patched rxrpc_kernel_send_data() correctly

From: Linus Torvalds
Date: Thu Jul 19 2007 - 17:20:49 EST




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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/