[PATCH] net: smc1111: move print_packet function

Robert Jarzmik robert.jarzmik at free.fr
Thu Jan 1 12:04:23 PST 2015


Fix for a compiler complaint, because print_packet is needed by a
function before it is declared.

Signed-off-by: Robert Jarzmik <robert.jarzmik at free.fr>
---
 drivers/net/smc91111.c | 75 +++++++++++++++++++++++++-------------------------
 1 file changed, 37 insertions(+), 38 deletions(-)

diff --git a/drivers/net/smc91111.c b/drivers/net/smc91111.c
index 91bb845..100688c 100644
--- a/drivers/net/smc91111.c
+++ b/drivers/net/smc91111.c
@@ -583,6 +583,43 @@ static inline void SMC_SELECT_BANK(struct smc91c111_priv *p, int bank)
 	SMC_outw(p, bank, BANK_SELECT);
 }
 
+#if SMC_DEBUG > 2
+static void print_packet( unsigned char * buf, int length )
+{
+	int i;
+	int remainder;
+	int lines;
+
+	printf("Packet of length %d \n", length );
+
+#if SMC_DEBUG > 3
+	lines = length / 16;
+	remainder = length % 16;
+
+	for ( i = 0; i < lines ; i ++ ) {
+		int cur;
+
+		for ( cur = 0; cur < 8; cur ++ ) {
+			unsigned char a, b;
+
+			a = *(buf ++ );
+			b = *(buf ++ );
+			printf("%02x%02x ", a, b );
+		}
+		printf("\n");
+	}
+	for ( i = 0; i < remainder/2 ; i++ ) {
+		unsigned char a, b;
+
+		a = *(buf ++ );
+		b = *(buf ++ );
+		printf("%02x%02x ", a, b );
+	}
+	printf("\n");
+#endif
+}
+#endif
+
 /* note: timeout in seconds */
 static int poll4int(struct smc91c111_priv *priv, unsigned char mask,
 			int timeout)
@@ -1281,44 +1318,6 @@ static void smc_dump_mii_stream (unsigned char * bits, int size)
 }
 #endif
 
-
-#if SMC_DEBUG > 2
-static void print_packet( unsigned char * buf, int length )
-{
-	int i;
-	int remainder;
-	int lines;
-
-	printf("Packet of length %d \n", length );
-
-#if SMC_DEBUG > 3
-	lines = length / 16;
-	remainder = length % 16;
-
-	for ( i = 0; i < lines ; i ++ ) {
-		int cur;
-
-		for ( cur = 0; cur < 8; cur ++ ) {
-			unsigned char a, b;
-
-			a = *(buf ++ );
-			b = *(buf ++ );
-			printf("%02x%02x ", a, b );
-		}
-		printf("\n");
-	}
-	for ( i = 0; i < remainder/2 ; i++ ) {
-		unsigned char a, b;
-
-		a = *(buf ++ );
-		b = *(buf ++ );
-		printf("%02x%02x ", a, b );
-	}
-	printf("\n");
-#endif
-}
-#endif
-
 static int smc91c111_init_dev(struct eth_device *edev)
 {
 	return 0;
-- 
2.1.0




More information about the barebox mailing list