[linux-cifs-client] [PATCH] [CIFS] cast destination qstr->name in memcpy called from cifs_ci_compare

Jeff Layton jlayton at redhat.com
Tue Apr 29 19:51:02 GMT 2008


One of the ACL handling patches removed an explict cast in a memcpy
call in cifs_ci_compare. This is causing the following compile time
warning:

    fs/cifs/dir.c: In function ‘cifs_ci_compare’:
    fs/cifs/dir.c:593: warning: passing argument 1 of ‘memcpy’
    discards qualifiers from pointer target type

I don't see any reason for the removal, and putting it back silences
this warning.
---

 fs/cifs/dir.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index 6ed7759..31ae007 100644
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -580,7 +580,7 @@ static int cifs_ci_compare(struct dentry *dentry, struct qstr *a,
 		 * case take precedence.  If a is not a negative dentry, this
 		 * should have no side effects
 		 */
-		memcpy(a->name, b->name, a->len);
+		memcpy((unsigned char *) a->name, b->name, a->len);
 		return 0;
 	}
 	return 1;



More information about the linux-cifs-client mailing list