From: Adrian Bunk <bunk@kernel.org>
To: krh@redhat.com, stefanr@s5r6.in-berlin.de
Cc: linux1394-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: [2.6 patch] ieee1394_transactions.c: remove dead code
Date: Sun, 28 Oct 2007 16:51:32 +0100 [thread overview]
Message-ID: <20071028155132.GA7227@stusta.de> (raw)
This patch removes dead code spotted by the Intel C Compiler.
Signed-off-by: Adrian Bunk <bunk@kernel.org>
---
drivers/ieee1394/ieee1394_transactions.c | 2 --
1 file changed, 2 deletions(-)
0df395c3e17cd6ac7176707a33580a1836db8bdf
diff --git a/drivers/ieee1394/ieee1394_transactions.c b/drivers/ieee1394/ieee1394_transactions.c
index c39c70a..6779893 100644
--- a/drivers/ieee1394/ieee1394_transactions.c
+++ b/drivers/ieee1394/ieee1394_transactions.c
@@ -208,108 +208,106 @@ void hpsb_free_tlabel(struct hpsb_packet *packet)
/**
* hpsb_packet_success - Make sense of the ack and reply codes
*
* Make sense of the ack and reply codes and return more convenient error codes:
* 0 = success. -%EBUSY = node is busy, try again. -%EAGAIN = error which can
* probably resolved by retry. -%EREMOTEIO = node suffers from an internal
* error. -%EACCES = this transaction is not allowed on requested address.
* -%EINVAL = invalid address at node.
*/
int hpsb_packet_success(struct hpsb_packet *packet)
{
switch (packet->ack_code) {
case ACK_PENDING:
switch ((packet->header[1] >> 12) & 0xf) {
case RCODE_COMPLETE:
return 0;
case RCODE_CONFLICT_ERROR:
return -EAGAIN;
case RCODE_DATA_ERROR:
return -EREMOTEIO;
case RCODE_TYPE_ERROR:
return -EACCES;
case RCODE_ADDRESS_ERROR:
return -EINVAL;
default:
HPSB_ERR("received reserved rcode %d from node %d",
(packet->header[1] >> 12) & 0xf,
packet->node_id);
return -EAGAIN;
}
- BUG();
case ACK_BUSY_X:
case ACK_BUSY_A:
case ACK_BUSY_B:
return -EBUSY;
case ACK_TYPE_ERROR:
return -EACCES;
case ACK_COMPLETE:
if (packet->tcode == TCODE_WRITEQ
|| packet->tcode == TCODE_WRITEB) {
return 0;
} else {
HPSB_ERR("impossible ack_complete from node %d "
"(tcode %d)", packet->node_id, packet->tcode);
return -EAGAIN;
}
case ACK_DATA_ERROR:
if (packet->tcode == TCODE_WRITEB
|| packet->tcode == TCODE_LOCK_REQUEST) {
return -EAGAIN;
} else {
HPSB_ERR("impossible ack_data_error from node %d "
"(tcode %d)", packet->node_id, packet->tcode);
return -EAGAIN;
}
case ACK_ADDRESS_ERROR:
return -EINVAL;
case ACK_TARDY:
case ACK_CONFLICT_ERROR:
case ACKX_NONE:
case ACKX_SEND_ERROR:
case ACKX_ABORTED:
case ACKX_TIMEOUT:
/* error while sending */
return -EAGAIN;
default:
HPSB_ERR("got invalid ack %d from node %d (tcode %d)",
packet->ack_code, packet->node_id, packet->tcode);
return -EAGAIN;
}
- BUG();
}
struct hpsb_packet *hpsb_make_readpacket(struct hpsb_host *host, nodeid_t node,
u64 addr, size_t length)
{
struct hpsb_packet *packet;
if (length == 0)
return NULL;
packet = hpsb_alloc_packet(length);
if (!packet)
return NULL;
packet->host = host;
packet->node_id = node;
if (hpsb_get_tlabel(packet)) {
hpsb_free_packet(packet);
return NULL;
}
if (length == 4)
fill_async_readquad(packet, addr);
else
fill_async_readblock(packet, addr, length);
return packet;
}
next reply other threads:[~2007-10-28 15:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-28 15:51 Adrian Bunk [this message]
2007-10-28 16:21 ` [2.6 patch] ieee1394_transactions.c: remove dead code Stefan Richter
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=20071028155132.GA7227@stusta.de \
--to=bunk@kernel.org \
--cc=krh@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux1394-devel@lists.sourceforge.net \
--cc=stefanr@s5r6.in-berlin.de \
/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