[Top] [All Lists]

Re: [PATCH] XFS: Fix gcc 4.6 set but not read and unused statement warni

To: Christoph Hellwig <hch@xxxxxx>
Subject: Re: [PATCH] XFS: Fix gcc 4.6 set but not read and unused statement warnings v2
From: Andi Kleen <ak@xxxxxxxxxxxxxxx>
Date: Mon, 14 Jun 2010 10:59:33 +0200
Cc: Andi Kleen <andi@xxxxxxxxxxxxxx>, xfs@xxxxxxxxxxx, dgc@xxxxxxxxxxxxx
In-reply-to: <20100614083021.GA29354@xxxxxx>
References: <20100614081356.GA27499@xxxxxxxxxxxxxxx> <20100614083021.GA29354@xxxxxx>
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv: Gecko/20100317 Thunderbird/3.0.4
, Christoph Hellwig wrote:
On Mon, Jun 14, 2010 at 10:13:56AM +0200, Andi Kleen wrote:
-       /* REFERENCED */
-       xfs_da_blkinfo_t *blkinfo;
        xfs_da_args_t *args;
        xfs_dablk_t child;
        xfs_dabuf_t *bp;
@@ -742,15 +738,14 @@ xfs_da_root_join(xfs_da_state_t *state,
        if (error)
        ASSERT(bp != NULL);
-       blkinfo = bp->data;
        if (be16_to_cpu(oldroot->hdr.level) == 1) {
-               ASSERT(be16_to_cpu(blkinfo->magic) == XFS_DIR2_LEAFN_MAGIC ||
-                      be16_to_cpu(blkinfo->magic) == XFS_ATTR_LEAF_MAGIC);
+               ASSERT(be16_to_cpu(bp->data->magic) == XFS_DIR2_LEAFN_MAGIC ||
+                      be16_to_cpu(bp->data->magic) == XFS_ATTR_LEAF_MAGIC);
        } else {
-               ASSERT(be16_to_cpu(blkinfo->magic) == XFS_DA_NODE_MAGIC);
+               ASSERT(be16_to_cpu(bp->data->magic) == XFS_DA_NODE_MAGIC);

How can this work?  bp->data is a void pointer.

It compiled with CONFIG_XFS_DEBUG enabled. Do I need to set some other
option to test this?

Anyways I don't plan to do any more heavy lifting on this patch,
so if you need any other complicated changes someone else
will have to do it.


<Prev in Thread] Current Thread [Next in Thread>