From: Himanshu Chauhan <chauhan.jpr@gmail.com>
To: kernel-janitors@vger.kernel.org
Subject: memcpy on const pointer, warning in smbfs/cache.c
Date: Sun, 10 Aug 2008 12:18:33 +0000 [thread overview]
Message-ID: <g7mlka$8lc$1@ger.gmane.org> (raw)
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
reply other threads:[~2008-08-10 12:18 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='g7mlka$8lc$1@ger.gmane.org' \
--to=chauhan.jpr@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.