Skip to contentSkip to conversation

Fix GCC4 warning: 'current_time.tv_sec &

PATCH In review Jesse Millan 1 participant 2 messages Jun 28, 2005

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

PATCH 1/1 Fix GCC4 warning: 'current_time.tv_sec &

The timeval current_time is conditionally initialized and unconditionally used. Moving the call to do_gettimeofday() above the #if directive eliminates the possibility of using current_time uninitialized.

drivers/net/wireless/prism54/isl_38xx.c renamed from drivers/net/wireless/prism54/isl_38xx.c.orig +3 -1
@@ -122,8 +122,10 @@ isl38xx_trigger_device(int asleep, void
 	/* check whether the device is in power save mode */
 	if (asleep) {
 		/* device is in powersave, trigger the device for wakeup */
-#if VERBOSE > SHOW_ERROR_MESSAGES
+
 		do_gettimeofday(&current_time);
+
+#if VERBOSE > SHOW_ERROR_MESSAGES
 		DEBUG(SHOW_TRACING, "%08li.%08li Device wakeup triggered\n",
 		      current_time.tv_sec, (long)current_time.tv_usec);
 #endif

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

#1 lore raw
Quoted 28 lines · Jesse Millan

------------------------------------------------------------------------

The timeval current_time is conditionally initialized and unconditionally used. Moving the call to do_gettimeofday() above the #if directive eliminates the possibility of using current_time uninitialized.

drivers/net/wireless/prism54/isl_38xx.c renamed from drivers/net/wireless/prism54/isl_38xx.c.orig +3 -2
@@ -122,8 +122,10 @@ isl38xx_trigger_device(int asleep, void
 	/* check whether the device is in power save mode */
 	if (asleep) {
 		/* device is in powersave, trigger the device for wakeup */
-#if VERBOSE > SHOW_ERROR_MESSAGES
+
 		do_gettimeofday(&current_time);
+
+#if VERBOSE > SHOW_ERROR_MESSAGES
 		DEBUG(SHOW_TRACING, "%08li.%08li Device wakeup triggered\n",
 		      current_time.tv_sec, (long)current_time.tv_usec);
 #endif
 
 
------------------------------------------------------------------------
Quoted 4 lines

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

Disregard this patch. This was fixed by pulling the last DEBUG above the #endif directive as of git10.

Signature · 12 lines
Jesse Millan
CNS Unix Team
Portland State University
Phone: (503) 725-9151
Mobile: (503) 453-0748
GPG key: www.system-calls.com/gpg.php

grep --recursive --ignore-case 'SHOULD WORK' /usr/src/linux/* | wc
_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors