public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2.6.2-rc1-mm3] fs/xfs/xfs_log_recover.c
@ 2004-01-25  4:48 Bryan Whitehead
  2004-01-25 11:11 ` Tim Cambrant
  2004-01-26 23:41 ` Nathan Scott
  0 siblings, 2 replies; 6+ messages in thread
From: Bryan Whitehead @ 2004-01-25  4:48 UTC (permalink / raw)
  To: nathans; +Cc: linux-kernel

On compile I get this:

fs/xfs/xfs_log_recover.c: In function `xlog_recover_reorder_trans':
fs/xfs/xfs_log_recover.c:1534: warning: `flags' might be used uninitialized in this function

I previously sent this patch and it was wrong.

In the function xlog_recover_reorder_trans the comiler thinks that "flags" might be used uninitialized. This will never happen as the first switch statement takes care of giving flags a value for all CASE statements that will use the flags variable later in the function. To get rid of the warning, flags needs to start off with an initial value. The previous patch merged the 2 switch statements but that would have broken the XFS_LI_BUF case as flags would be overwritten in the XFS_LI_5_3_BUF case.

This patch keeps the same functionality but removes the warning the compiler generates.

--- fs/xfs/xfs_log_recover.c.orig       2004-01-24 20:16:15.726073560 -0800
+++ fs/xfs/xfs_log_recover.c    2004-01-24 20:33:02.720987064 -0800
@@ -1531,7 +1531,7 @@ xlog_recover_reorder_trans(
        xlog_recover_item_t     *first_item, *itemq, *itemq_next;
        xfs_buf_log_format_t    *buf_f;
        xfs_buf_log_format_v1_t *obuf_f;
-       ushort                  flags;
+       ushort                  flags = 0;
                                                                                                             
        first_item = itemq = trans->r_itemq;
        trans->r_itemq = NULL;

--
Bryan Whitehead
driver@megahappy.net

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

end of thread, other threads:[~2004-01-27  0:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-25  4:48 [PATCH 2.6.2-rc1-mm3] fs/xfs/xfs_log_recover.c Bryan Whitehead
2004-01-25 11:11 ` Tim Cambrant
2004-01-25 21:31   ` Bryan Whitehead
2004-01-26 23:41 ` Nathan Scott
2004-01-27  0:09   ` Bryan Whitehead
2004-01-27  0:19   ` Nathan Scott

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