All of lore.kernel.org
 help / color / mirror / Atom feed
* memcpy on const pointer, warning in smbfs/cache.c
@ 2008-08-10 12:18 Himanshu Chauhan
  0 siblings, 0 replies; only message in thread
From: Himanshu Chauhan @ 2008-08-10 12:18 UTC (permalink / raw)
  To: kernel-janitors

Dear all,

I pulled out latest source from Linus's git tree. During compilation of 
smbfs/cache.c in line 148 I got a warning stating

  warning: passing argument 1 of ‘__constant_memcpy’ discards qualifiers 
from pointer target type

This was in function smb_fill_cache where memcpy is being used as following:

memcpy((char *) newdent->d_name.name, qname->name,
		       newdent->d_name.len);

d_name is of type struct qstr and in qstr name is defined as const 
unsigned char *.

struct qstr {
	unsigned int hash;
	unsigned int len;
	const unsigned char *name;
};

So this type cast is wrong.

Is it ok to fix this by defineing name as unsigned char * rather than as 
const unsigned char *?

Regards
--Himanshu

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-08-10 12:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-10 12:18 memcpy on const pointer, warning in smbfs/cache.c Himanshu Chauhan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.