[PATCH] Fix romfs void pointer compile error

Jody Bruchon <[email protected]>
Newsgroups org.kernel.vger.linux-8086
Message-ID <[email protected]>
commit 82afea9a87740a766e5f2683bf27b312aab95572
Author: Jody Bruchon <[email protected]>
Date:   Sat Feb 11 01:17:00 2012 -0500

     In elks/fs/romfs/inode.c, the function romfs_copyfrom() accepts
     Void *dest, but an invalid lvalue error was generated by this:

       ((char *)dest) += maxsize;

     By asking for char *dest instead, the function compiles properly.
     Since romfs is "in development," I cannot test the code, but it
     at least compiles now.

     Signed-off-by: Jody Bruchon <[email protected]>
     Committed-by: Jody Bruchon <[email protected]>
0001-fix_romfs_void_pointer.patch (text/plain, 703 B)
diff --git a/elks/fs/romfs/inode.c b/elks/fs/romfs/inode.c
index 551e99f..d1381d5 100644
--- a/elks/fs/romfs/inode.c
+++ b/elks/fs/romfs/inode.c
@@ -243,7 +243,7 @@ static int romfs_strnlen(struct inode *i, loff_t offset, size_t count)
     return res;
 }
 
-static int romfs_copyfrom(struct inode *i, void *dest, loff_t offset,
+static int romfs_copyfrom(struct inode *i, char *dest, loff_t offset,
 			  size_t count)
 {
     struct buffer_head *bh;
@@ -279,7 +279,7 @@ static int romfs_copyfrom(struct inode *i, void *dest, loff_t offset,
 
     while (res < count) {
 	offset += maxsize;
-	((char *) dest) += maxsize;
+	*dest += maxsize;
 
 	bh = bread(i->i_dev, (block_t) (offset >> ROMBSBITS));
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.