Skip to contentSkip to conversation

drivers/net/cassini.c: fix undefined variable

KJ walter harms 3 participants 5 messages Dec 6, 2005 – Dec 10, 2005

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

The variable compwb is not defined if USE_TX_COMPWB is not defined. Also fixed is a trivial format warning.

in case tunderbird wraped my lines i added the patch as attachment also

drivers/net/cassini.c renamed from drivers/net/cassini.c.bak +3 -2
@@ -1922,11 +1922,12 @@
 		   u32 status)
 {
         int limit, ring;
+	u64 compwb=0;
 #ifdef USE_TX_COMPWB
-	u64 compwb = le64_to_cpu(cp->init_block->tx_compwb);
+	compwb = le64_to_cpu(cp->init_block->tx_compwb);
 #endif
 	if (netif_msg_intr(cp))
-		printk(KERN_DEBUG "%s: tx interrupt, status: 0x%x, %lx\n",
+		printk(KERN_DEBUG "%s: tx interrupt, status: 0x%x, %Lx\n",
 			cp->dev->name, status, compwb);
 	/* process all the rings */
 	for (ring = 0; ring < N_TX_RINGS; ring++) {

The variable compwb is not defined if USE_TX_COMPWB is not defined. Also fixed is a trivial format warning.

sign-off: walter <[email protected]>

drivers/net/cassini.c renamed from drivers/net/cassini.c.bak +3 -2
@@ -1922,11 +1922,12 @@
 		   u32 status)
 {
         int limit, ring;
+	u64 compwb=0;
 #ifdef USE_TX_COMPWB
-	u64 compwb = le64_to_cpu(cp->init_block->tx_compwb);
+	compwb = le64_to_cpu(cp->init_block->tx_compwb);
 #endif
 	if (netif_msg_intr(cp))
-		printk(KERN_DEBUG "%s: tx interrupt, status: 0x%x, %lx\n",
+		printk(KERN_DEBUG "%s: tx interrupt, status: 0x%x, %Lx\n",
 			cp->dev->name, status, compwb);
 	/* process all the rings */
 	for (ring = 0; ring < N_TX_RINGS; ring++) {

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

#1 lore raw
Quoted 8 lines · walter harms

The variable compwb is not defined if USE_TX_COMPWB is not defined. Also fixed is a trivial format warning.

drivers/net/cassini.c renamed from drivers/net/cassini.c.bak +0 -0
@@ -1922,11 +1922,12 @@
 		   u32 status)
 {

drivers/net/cassini.c line 1931

Quoted 10 lines
drivers/net/cassini.c renamed from drivers/net/cassini.c.bak +3 -2
         int limit, ring;
+	u64 compwb=0;
 #ifdef USE_TX_COMPWB
-	u64 compwb = le64_to_cpu(cp->init_block->tx_compwb);
+	compwb = le64_to_cpu(cp->init_block->tx_compwb);
 #endif
 	if (netif_msg_intr(cp))
-		printk(KERN_DEBUG "%s: tx interrupt, status: 0x%x, %lx\n",
+		printk(KERN_DEBUG "%s: tx interrupt, status: 0x%x, %Lx\n",
 			cp->dev->name, status, compwb);

AFAICS, u64 variables are printed as "%llx", (unsigned long long)

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

#2 lore raw
In reply to walter harms

Hi Alexey,
lets say i tried and it worked.
If i understand the code in vsprintf.c correcly the 'll' is equal 'L'.

re,
walter

Quoted 13 lines · Alexey Dobriyan
Quoted 12 lines · walter harms

The variable compwb is not defined if USE_TX_COMPWB is not defined. Also fixed is a trivial format warning.

drivers/net/cassini.c renamed from drivers/net/cassini.c.bak +1 -1
@@ -1922,11 +1922,12 @@
 		   u32 status)
 {
         int limit, ring;
+	u64 compwb=0;
 #ifdef USE_TX_COMPWB
-	u64 compwb = le64_to_cpu(cp->init_block->tx_compwb);
Quoted 11 lines

drivers/net/cassini.c line 1931

Quoted 6 lines
drivers/net/cassini.c renamed from drivers/net/cassini.c.bak +2 -1
+	compwb = le64_to_cpu(cp->init_block->tx_compwb);
 #endif
 	if (netif_msg_intr(cp))
-		printk(KERN_DEBUG "%s: tx interrupt, status: 0x%x, %lx\n",
+		printk(KERN_DEBUG "%s: tx interrupt, status: 0x%x, %Lx\n",
 			cp->dev->name, status, compwb);

AFAICS, u64 variables are printed as "%llx", (unsigned long long)

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

#3 lore raw
In reply to walter harms
Quoted 13 lines · On Sat, 10 Dec 2005 18:53:01 +0300 Alexey Dobriyan wrote:
Quoted 12 lines · walter harms

The variable compwb is not defined if USE_TX_COMPWB is not defined. Also fixed is a trivial format warning.

drivers/net/cassini.c renamed from drivers/net/cassini.c.bak +1 -1
@@ -1922,11 +1922,12 @@
 		   u32 status)
 {
         int limit, ring;
+	u64 compwb=0;
 #ifdef USE_TX_COMPWB
-	u64 compwb = le64_to_cpu(cp->init_block->tx_compwb);
Quoted 8 lines

drivers/net/cassini.c line 1931

Quoted 6 lines
drivers/net/cassini.c renamed from drivers/net/cassini.c.bak +2 -1
+	compwb = le64_to_cpu(cp->init_block->tx_compwb);
 #endif
 	if (netif_msg_intr(cp))
-		printk(KERN_DEBUG "%s: tx interrupt, status: 0x%x, %lx\n",
+		printk(KERN_DEBUG "%s: tx interrupt, status: 0x%x, %Lx\n",
 			cp->dev->name, status, compwb);

AFAICS, u64 variables are printed as "%llx", (unsigned long long)

AFAIK, they are cast to (unsigned long long) and printed with %llx, as:

		printk(KERN_DEBUG "%s: tx interrupt, status: 0x%x, %llx\n",
			cp->dev->name, status, (unsigned long long)compwb);

but I didn't test this, it's just from memory.

---
~Randy

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

#4 lore raw
In reply to walter harms
Quoted 2 lines · walter harms

Hi Alexey,
lets say i tried and it worked.

On i386. On alpha you added the warning. And %llx is 4 times more common than %Lx.

Quoted 14 lines
Quoted 13 lines · Alexey Dobriyan
Quoted 12 lines · walter harms

The variable compwb is not defined if USE_TX_COMPWB is not defined. Also fixed is a trivial format warning.

drivers/net/cassini.c renamed from drivers/net/cassini.c.bak +1 -1
@@ -1922,11 +1922,12 @@
 		   u32 status)
 {
        int limit, ring;
+	u64 compwb=0;
 #ifdef USE_TX_COMPWB
-	u64 compwb = le64_to_cpu(cp->init_block->tx_compwb);
Quoted 8 lines
Quoted 8 lines

drivers/net/cassini.c line 1931

Quoted 6 lines
drivers/net/cassini.c renamed from drivers/net/cassini.c.bak +2 -1
+	compwb = le64_to_cpu(cp->init_block->tx_compwb);
 #endif
 	if (netif_msg_intr(cp))
-		printk(KERN_DEBUG "%s: tx interrupt, status: 0x%x, %lx\n",
+		printk(KERN_DEBUG "%s: tx interrupt, status: 0x%x, %Lx\n",
 			cp->dev->name, status, compwb);

AFAICS, u64 variables are printed as "%llx", (unsigned long long)

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