[Yaffs] patch: fix compile warnings
Frank Rowand
frowand@mvista.com
Mon, 22 Nov 2004 15:40:57 -0800
This is a multi-part message in MIME format.
--------------000603050103040204040509
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
If you want to eliminate some compile warnings, the attached patch allows
a warning free compile of mkyaffs and mkyaffsimage on RedHat 9.0
-Frank
--
Frank Rowand <frank_rowand@mvista.com>
MontaVista Software, Inc
--------------000603050103040204040509
Content-Type: text/plain;
name="yaffs_userland_03_fix_warnings.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="yaffs_userland_03_fix_warnings.patch"
Index: yaffs/nand_ecc.c
===================================================================
--- yaffs.orig/nand_ecc.c
+++ yaffs/nand_ecc.c
@@ -25,6 +25,7 @@
#endif
#include "yportenv.h"
+#include "nand_ecc.h"
/*
* Pre-calculated 256-way 1 byte column parity
Index: yaffs/utils/mkyaffsimage.c
===================================================================
--- yaffs.orig/utils/mkyaffsimage.c
+++ yaffs/utils/mkyaffsimage.c
@@ -32,16 +32,13 @@
#include <unistd.h>
#include "yaffs_guts.h"
+#include "nand_ecc.h"
#define MAX_OBJECTS 10000
const char * mkyaffsimage_c_version = "$Id: mkyaffsimage.c,v 1.7 2003/07/16 03:00:48 charles Exp $";
-// External functions for ECC on data
-void nand_calculate_ecc (const u_char *dat, u_char *ecc_code);
-int nand_correct_data (u_char *dat, u_char *read_ecc, u_char *calc_ecc);
-
typedef struct
{
@@ -119,6 +116,7 @@
return -1;
}
+#if 0
// NCB added 10/9/2002
static __u16 yaffs_CalcNameSum(const char *name)
{
@@ -135,6 +133,7 @@
}
return sum;
}
+#endif
static void yaffs_CalcECC(const __u8 *data, yaffs_Spare *spare)
Index: yaffs/utils/mkyaffs.c
===================================================================
--- yaffs.orig/utils/mkyaffs.c
+++ yaffs/utils/mkyaffs.c
@@ -27,6 +27,7 @@
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
+#include <string.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <sys/types.h>
Index: yaffs/devextras.h
===================================================================
--- yaffs.orig/devextras.h
+++ yaffs/devextras.h
@@ -201,6 +201,7 @@
+#ifndef DT_UNKNOWN
/*
* File types
*/
@@ -213,6 +214,7 @@
#define DT_LNK 10
#define DT_SOCK 12
#define DT_WHT 14
+#endif
#ifndef WIN32
#include <sys/stat.h>
Index: yaffs/nand_ecc.h
===================================================================
--- /dev/null
+++ yaffs/nand_ecc.h
@@ -0,0 +1,28 @@
+/*
+ * YAFFS: Yet another FFS. A NAND-flash specific file system.
+ * yportenv.h: Portable services used by yaffs. This is done to allow
+ * simple migration from kernel space into app space for testing.
+ *
+ * Copyright (C) 2002 Aleph One Ltd.
+ * for Toby Churchill Ltd and Brightstar Engineering
+ *
+ * Created by Charles Manning <charles@aleph1.co.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 2.1 as
+ * published by the Free Software Foundation.
+ *
+ *
+ * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
+ *
+ */
+
+#ifndef __NAND_ECC_H__
+#define __NAND_ECC_H__
+
+/* External functions for ECC on data */
+
+void nand_calculate_ecc (const u_char *dat, u_char *ecc_code);
+int nand_correct_data (u_char *dat, u_char *read_ecc, u_char *calc_ecc);
+
+#endif
--------------000603050103040204040509--