public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [2.6 patch] ieee1394_transactions.c: remove dead code
@ 2007-10-28 15:51 Adrian Bunk
  2007-10-28 16:21 ` Stefan Richter
  0 siblings, 1 reply; 2+ messages in thread
From: Adrian Bunk @ 2007-10-28 15:51 UTC (permalink / raw)
  To: krh, stefanr; +Cc: linux1394-devel, linux-kernel

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;
 }
 


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [2.6 patch] ieee1394_transactions.c: remove dead code
  2007-10-28 15:51 [2.6 patch] ieee1394_transactions.c: remove dead code Adrian Bunk
@ 2007-10-28 16:21 ` Stefan Richter
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Richter @ 2007-10-28 16:21 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: krh, linux1394-devel, linux-kernel

Adrian Bunk wrote:
> This patch removes dead code spotted by the Intel C Compiler.

Committed to linux1394-2.6.git, thanks.
-- 
Stefan Richter
-=====-=-=== =-=- ===--
http://arcgraph.de/sr/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-10-28 16:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-28 15:51 [2.6 patch] ieee1394_transactions.c: remove dead code Adrian Bunk
2007-10-28 16:21 ` Stefan Richter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox