[PATCH] Fix romfs void pointer compile error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



commit 82afea9a87740a766e5f2683bf27b312aab95572
Author: Jody Bruchon <jody@xxxxxxxxxxxxxxx>
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 <jody@xxxxxxxxxxxxxxx>
    Committed-by: Jody Bruchon <jody@xxxxxxxxxxxxxxx>


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));
 

[Index of Archives]     [Kernel]     [Linux ia64]     [DCCP]     [Linux for ARM]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux