Skip to contentSkip to conversation

Unreachable Code

KJ Aaron Grothe 3 participants 5 messages Oct 6, 2005 – Oct 8, 2005

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

Hi,

The following is a small patch against the 2.6.14-rc3 tree. It removes some code that won't/can't be reached. I came across the code while building the kernel with the Intel C compiler.

I've thrown a couple of quick webpages and a little project on sourceforge up at http://www.linuxicc.org
with some more of the "interesting" results from using Intel's compiler. I think with Intel's compiler reporting a couple of things than gcc it might lead to some interesting results.

Regards,

Aaron
=-=-=
"The Journey is the Reward" - Old Zen Buddhist Saying

__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com

drivers/char/drm/i830_dma.c +0 -15
diff -uprN -X dontdiff linux-2.6.14-rc3/drivers/char/drm/i830_dma.c linux-2.6.14-rc3-patch/drivers/char/drm/i830_dma.c
@@ -594,21 +594,6 @@ static void i830EmitTexPalette( drm_devi
 
 	return;
 
-	BEGIN_LP_RING( 258 );
-
-	if(is_shared == 1) {
-		OUT_RING(CMD_OP_MAP_PALETTE_LOAD |
-			 MAP_PALETTE_NUM(0) |
-			 MAP_PALETTE_BOTH);
-	} else {
-		OUT_RING(CMD_OP_MAP_PALETTE_LOAD | MAP_PALETTE_NUM(number));
-	}
-	for(i = 0; i < 256; i++) {
-		OUT_RING(palette[i]);
-	}
-	OUT_RING(0);
-	/* KW:  WHERE IS THE ADVANCE_LP_RING?  This is effectively a noop! 
-	 */
 }
 
 /* Need to do some additional checking when setting the dest buffer.
fs/udf/super.c +0 -49

55 lines not on this page · raw message

net/rxrpc/transport.c +0 -5
diff -uprN -X dontdiff linux-2.6.14-rc3/net/rxrpc/transport.c linux-2.6.14-rc3-patch/net/rxrpc/transport.c
@@ -563,8 +563,6 @@ void rxrpc_trans_receive_packet(struct r
 		kfree_skb(pkt);
 	}
 
-	_leave("");
-
 } /* end rxrpc_trans_receive_packet() */
 
 /*****************************************************************************/
@@ -848,7 +846,4 @@ static void rxrpc_trans_receive_error_re
 			rxrpc_put_peer(peer);
 		}
 	}
-
-	_leave("");
-	return;
 } /* end rxrpc_trans_receive_error_report() */

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors

#1 lore raw

drivers/char/drm/i830_dma.c static void i830EmitTexPalette( drm_devi · line 595

Quoted 9 lines · Aaron Grothe

The following is a small patch against the 2.6.14-rc3 tree. It removes some code that won't/can't be reached. I came across the code while building the

drivers/char/drm/i830_dma.c +0 -0
@@ -594,21 +594,6 @@ static void i830EmitTexPalette( drm_devi
 
 	return;

Placed here on 29 Mar 2003, so it should be safe to remove. But after removal i830EmitTexPalette() will become NOP. Applied as-is, send incremental patch if i830 people will say i830EmitTexPalette() is a dead code nobody will fix.

Quoted 20 lines
drivers/char/drm/i830_dma.c +0 -15
-	BEGIN_LP_RING( 258 );
-
-	if(is_shared == 1) {
-		OUT_RING(CMD_OP_MAP_PALETTE_LOAD |
-			 MAP_PALETTE_NUM(0) |
-			 MAP_PALETTE_BOTH);
-	} else {
-		OUT_RING(CMD_OP_MAP_PALETTE_LOAD | MAP_PALETTE_NUM(number));
-	}
-	for(i = 0; i < 256; i++) {
-		OUT_RING(palette[i]);
-	}
-	OUT_RING(0);
-	/* KW:  WHERE IS THE ADVANCE_LP_RING?  This is effectively a noop! 
-	 */
 }
 

fs/udf/super.c udf_find_fileset(struct super_block *sb, · line 795

Quoted 3 lines
fs/udf/super.c +0 -0
@@ -793,55 +793,6 @@ udf_find_fileset(struct super_block *sb,
 		kernel_lb_addr newfileset;
 
 		return 1;

5 Feb 2002. OK. Note that newfileset will become unused.

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors

#3 lore raw
In reply to Aaron Grothe

net/rxrpc/transport.c void rxrpc_trans_receive_packet(struct r · line 566

Quoted 8 lines · Aaron Grothe

+++ linux-2.6.14-rc3-patch/net/rxrpc/transport.c 2005-10-06 04:45:59.000000000 +0200

net/rxrpc/transport.c +0 -2
@@ -563,8 +563,6 @@ void rxrpc_trans_receive_packet(struct r
 		kfree_skb(pkt);
 	}
 
-	_leave("");
-
 } /* end rxrpc_trans_receive_packet() */

Why delete these? They seem to be useful:

#define _leave(FMT, a...) do { if (rxrpc_ktrace) kleave(FMT , ##a); } while(0)

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors

#4 lore raw
In reply to Aaron Grothe
Quoted 6 lines · Matthew Wilcox
Quoted 5 lines · Aaron Grothe

+++ linux-2.6.14-rc3-patch/net/rxrpc/transport.c 2005-10-06 04:45:59.000000000 +0200

net/rxrpc/transport.c +0 -0
@@ -563,8 +563,6 @@ void rxrpc_trans_receive_packet(struct r
 		kfree_skb(pkt);
 	}
 
Quoted 7 lines

net/rxrpc/transport.c void rxrpc_trans_receive_packet(struct r · line 566

Quoted 3 lines
net/rxrpc/transport.c +0 -2
-	_leave("");
-
 } /* end rxrpc_trans_receive_packet() */

Why delete these? They seem to be useful:

#define _leave(FMT, a...) do { if (rxrpc_ktrace) kleave(FMT , ##a); } while(0)

How can you reach it without break;s from infinite loop?

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors