Whamcloud - gitweb
brw_check_page(): suppress "use before initialization" compiler warning.
[fs/lustre-release.git] / lnet / selftest / brw_test.c
index 78bed3c..15f72f8 100644 (file)
@@ -1,12 +1,43 @@
 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
  * vim:expandtab:shiftwidth=8:tabstop=8:
  *
- * Copyright (C) 2001, 2002 Cluster File Systems, Inc.
- *   Author: Isaac Huang <isaac@clusterfs.com>
+ * GPL HEADER START
  *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 only,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License version 2 for more details (a copy is included
+ * in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License
+ * version 2 along with this program; If not, see
+ * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ *
+ * GPL HEADER END
+ */
+/*
+ * Copyright  2008 Sun Microsystems, Inc. All rights reserved
+ * Use is subject to license terms.
+ */
+/*
+ * This file is part of Lustre, http://www.lustre.org/
+ * Lustre is a trademark of Sun Microsystems, Inc.
+ *
+ * lnet/selftest/brw_test.c
+ *
+ * Author: Isaac Huang <isaac@clusterfs.com>
  */
 
-#include <libcfs/kp30.h>
 #include "selftest.h"
 
 
@@ -119,7 +150,7 @@ int
 brw_check_page (cfs_page_t *pg, int pattern, __u64 magic)
 {
         char  *addr = cfs_page_address(pg);
-        __u64  data;
+        __u64  data = 0; /* make compiler happy */
         int    i;
 
         LASSERT (addr != NULL);
@@ -150,7 +181,7 @@ brw_check_page (cfs_page_t *pg, int pattern, __u64 magic)
         LBUG ();
 
 bad_data:
-        CERROR ("Bad data in page %p: "LPU64", "LPU64" expected\n",
+        CERROR ("Bad data in page %p: "LPX64", "LPX64" expected\n",
                 pg, data, magic);
         return 1;
 }
@@ -222,7 +253,7 @@ brw_client_prep_rpc (sfw_test_unit_t *tsu,
 
         req = &rpc->crpc_reqstmsg.msg_body.brw_reqst;
         req->brw_flags = flags;
-        req->brw_rw    = breq->blk_opc; 
+        req->brw_rw    = breq->blk_opc;
         req->brw_len   = npg * CFS_PAGE_SIZE;
 
         *rpcpp = rpc;
@@ -370,7 +401,7 @@ brw_server_handle (srpc_server_rpc_t *rpc)
                 reply->brw_status = EINVAL;
                 return 0;
         }
-        
+
         reply->brw_status = 0;
         rc = sfw_alloc_pages(rpc, reqst->brw_len / CFS_PAGE_SIZE,
                              reqst->brw_rw == LST_BRW_WRITE);