* [PATCH 2.6.2-rc1-mm2] fs/xfs/xfs_log_recover.c
@ 2004-01-24 7:31 Bryan Whitehead
2004-01-24 8:26 ` Christoph Hellwig
0 siblings, 1 reply; 5+ messages in thread
From: Bryan Whitehead @ 2004-01-24 7:31 UTC (permalink / raw)
To: linux-kernel; +Cc: akpm, nathans, owner-xfs
This fixes a warning on compile of the xfs fs module.
--- fs/xfs/xfs_log_recover.c.orig 2004-01-23 23:17:35.402907768 -0800
+++ fs/xfs/xfs_log_recover.c 2004-01-23 23:19:09.368622808 -0800
@@ -1542,21 +1542,14 @@
case XFS_LI_BUF:
flags = buf_f->blf_flags;
break;
case XFS_LI_6_1_BUF:
case XFS_LI_5_3_BUF:
obuf_f = (xfs_buf_log_format_v1_t*)buf_f;
flags = obuf_f->blf_flags;
- break;
- }
-
- switch (ITEM_TYPE(itemq)) {
- case XFS_LI_BUF:
- case XFS_LI_6_1_BUF:
- case XFS_LI_5_3_BUF:
if (!(flags & XFS_BLI_CANCEL)) {
xlog_recover_insert_item_frontq(&trans->r_itemq,
itemq);
break;
}
case XFS_LI_INODE:
case XFS_LI_6_1_INODE:
--
Bryan Whitehead
driver@megahappy.net
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2.6.2-rc1-mm2] fs/xfs/xfs_log_recover.c
2004-01-24 7:31 [PATCH 2.6.2-rc1-mm2] fs/xfs/xfs_log_recover.c Bryan Whitehead
@ 2004-01-24 8:26 ` Christoph Hellwig
2004-01-25 0:38 ` Bryan Whitehead
2004-01-25 0:57 ` Bryan Whitehead
0 siblings, 2 replies; 5+ messages in thread
From: Christoph Hellwig @ 2004-01-24 8:26 UTC (permalink / raw)
To: Bryan Whitehead; +Cc: linux-kernel, akpm, nathans, owner-xfs
On Fri, Jan 23, 2004 at 11:31:11PM -0800, Bryan Whitehead wrote:
>
> This fixes a warning on compile of the xfs fs module.
This patch looks very strange. What error do you get without it?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2.6.2-rc1-mm2] fs/xfs/xfs_log_recover.c
2004-01-24 8:26 ` Christoph Hellwig
@ 2004-01-25 0:38 ` Bryan Whitehead
2004-01-25 0:57 ` Bryan Whitehead
1 sibling, 0 replies; 5+ messages in thread
From: Bryan Whitehead @ 2004-01-25 0:38 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: linux-kernel, akpm, nathans, owner-xfs
I should have been more clear in the frist email. Sorry.
The variable "flags" is used in an if statement without having a value
assigned.
There is 2 switch statements that do this: (ITEM_TYPE(itemq) They execute
one right after the other with no returns. So it is redundant.
I think the patch fixes a cut/paste accident...
Here is a more complete diff so you can see what is going on:
--- fs/xfs/xfs_log_recover.c.orig 2004-01-23 23:17:35.402907768
-0800
+++ fs/xfs/xfs_log_recover.c 2004-01-23 23:19:09.368622808 -0800
@@ -1539,27 +1539,20 @@
itemq_next = itemq->ri_next;
buf_f = (xfs_buf_log_format_t *)itemq->ri_buf[0].i_addr;
switch (ITEM_TYPE(itemq)) {
case XFS_LI_BUF:
flags = buf_f->blf_flags;
break;
case XFS_LI_6_1_BUF:
case XFS_LI_5_3_BUF:
obuf_f = (xfs_buf_log_format_v1_t*)buf_f;
flags = obuf_f->blf_flags;
- break;
- }
-
- switch (ITEM_TYPE(itemq)) {
- case XFS_LI_BUF:
- case XFS_LI_6_1_BUF:
- case XFS_LI_5_3_BUF:
if (!(flags & XFS_BLI_CANCEL)) {
xlog_recover_insert_item_frontq(&trans->r_itemq,
itemq);
break;
}
case XFS_LI_INODE:
case XFS_LI_6_1_INODE:
case XFS_LI_5_3_INODE:
case XFS_LI_DQUOT:
case XFS_LI_QUOTAOFF:
On Sat, 24 Jan 2004, Christoph Hellwig wrote:
> On Fri, Jan 23, 2004 at 11:31:11PM -0800, Bryan Whitehead wrote:
> >
> > This fixes a warning on compile of the xfs fs module.
>
> This patch looks very strange. What error do you get without it?
>
--
Bryan Whitehead
Email:driver@megahappy.net
WorkE:driver@jpl.nasa.gov
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2.6.2-rc1-mm2] fs/xfs/xfs_log_recover.c
2004-01-24 8:26 ` Christoph Hellwig
2004-01-25 0:38 ` Bryan Whitehead
@ 2004-01-25 0:57 ` Bryan Whitehead
2004-01-25 1:10 ` Bryan Whitehead
1 sibling, 1 reply; 5+ messages in thread
From: Bryan Whitehead @ 2004-01-25 0:57 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: linux-kernel, akpm, nathans, owner-xfs
Oh, one more thing. After removed the superflurous switch statement flags
will have a value which fixes the warning.
If you look at the flow of code it is impossible for flags to not have a
value when it gets to the if statement as the previous switch statement
would give it a value. But since that switch statement only catches that
one case anyway, it's better to merge the 2 switch statemnets.
On Sat, 24 Jan 2004, Christoph Hellwig wrote:
> On Fri, Jan 23, 2004 at 11:31:11PM -0800, Bryan Whitehead wrote:
> >
> > This fixes a warning on compile of the xfs fs module.
>
> This patch looks very strange. What error do you get without it?
>
--
Bryan Whitehead
Email:driver@megahappy.net
WorkE:driver@jpl.nasa.gov
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2.6.2-rc1-mm2] fs/xfs/xfs_log_recover.c
2004-01-25 0:57 ` Bryan Whitehead
@ 2004-01-25 1:10 ` Bryan Whitehead
0 siblings, 0 replies; 5+ messages in thread
From: Bryan Whitehead @ 2004-01-25 1:10 UTC (permalink / raw)
To: Bryan Whitehead; +Cc: Christoph Hellwig, linux-kernel, akpm, nathans, owner-xfs
If I'm off base on this then sorry for the trouble. Just thought I'd
take a hit at getting rid of some compiler warnings..
Bryan Whitehead wrote:
> Oh, one more thing. After removed the superflurous switch statement flags
> will have a value which fixes the warning.
>
> If you look at the flow of code it is impossible for flags to not have a
> value when it gets to the if statement as the previous switch statement
> would give it a value. But since that switch statement only catches that
> one case anyway, it's better to merge the 2 switch statemnets.
>
> On Sat, 24 Jan 2004, Christoph Hellwig wrote:
>
>
>>On Fri, Jan 23, 2004 at 11:31:11PM -0800, Bryan Whitehead wrote:
>>
>>>This fixes a warning on compile of the xfs fs module.
>>
>>This patch looks very strange. What error do you get without it?
>>
>
>
--
Bryan Whitehead
Email:driver@megahappy.net
WorkE:driver@jpl.nasa.gov
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2004-01-25 1:15 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-24 7:31 [PATCH 2.6.2-rc1-mm2] fs/xfs/xfs_log_recover.c Bryan Whitehead
2004-01-24 8:26 ` Christoph Hellwig
2004-01-25 0:38 ` Bryan Whitehead
2004-01-25 0:57 ` Bryan Whitehead
2004-01-25 1:10 ` Bryan Whitehead
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®