All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cifs: Fix build warning in dns_resolve.c
@ 2009-06-16  9:28 Suresh Jayaraman
  2009-06-16 10:46 ` Jeff Layton
  0 siblings, 1 reply; 2+ messages in thread
From: Suresh Jayaraman @ 2009-06-16  9:28 UTC (permalink / raw)
  To: Steve French, linux-next, linux-cifs-client; +Cc: Jeff Layton

Fix a build warning in dns_resolve.c.

fs/cifs/dns_resolve.c: In function 'is_ip':
fs/cifs/dns_resolve.c:42: warning: passing argument 1 of 'cifs_convert_address' discards qualifiers from pointer target type

Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de>
---
 fs/cifs/cifsproto.h |    2 +-
 fs/cifs/netmisc.c   |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h
index c419416..53267a3 100644
--- a/fs/cifs/cifsproto.h
+++ b/fs/cifs/cifsproto.h
@@ -74,7 +74,7 @@ extern unsigned int smbCalcSize(struct smb_hdr *ptr);
 extern unsigned int smbCalcSize_LE(struct smb_hdr *ptr);
 extern int decode_negTokenInit(unsigned char *security_blob, int length,
 			enum securityEnum *secType);
-extern int cifs_convert_address(char *src, void *dst);
+extern int cifs_convert_address(const char *src, void *dst);
 extern int map_smb_to_linux_error(struct smb_hdr *smb, int logErr);
 extern void header_assemble(struct smb_hdr *, char /* command */ ,
 			    const struct cifsTconInfo *, int /* length of
diff --git a/fs/cifs/netmisc.c b/fs/cifs/netmisc.c
index f9a54da..390ef00 100644
--- a/fs/cifs/netmisc.c
+++ b/fs/cifs/netmisc.c
@@ -163,7 +163,7 @@ cifs_inet_pton(const int address_family, const char *cp, void *dst)
  * Returns 0 on failure.
  */
 int
-cifs_convert_address(char *src, void *dst)
+cifs_convert_address(const char *src, void *dst)
 {
 	struct sockaddr_in *s4 = (struct sockaddr_in *) dst;
 	struct sockaddr_in6 *s6 = (struct sockaddr_in6 *) dst;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] cifs: Fix build warning in dns_resolve.c
  2009-06-16  9:28 [PATCH] cifs: Fix build warning in dns_resolve.c Suresh Jayaraman
@ 2009-06-16 10:46 ` Jeff Layton
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Layton @ 2009-06-16 10:46 UTC (permalink / raw)
  To: Suresh Jayaraman; +Cc: Steve French, linux-next, linux-cifs-client

On Tue, 16 Jun 2009 14:58:18 +0530
Suresh Jayaraman <sjayaraman@suse.de> wrote:

> Fix a build warning in dns_resolve.c.
> 
> fs/cifs/dns_resolve.c: In function 'is_ip':
> fs/cifs/dns_resolve.c:42: warning: passing argument 1 of 'cifs_convert_address' discards qualifiers from pointer target type
> 
> Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de>
> ---
>  fs/cifs/cifsproto.h |    2 +-
>  fs/cifs/netmisc.c   |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h
> index c419416..53267a3 100644
> --- a/fs/cifs/cifsproto.h
> +++ b/fs/cifs/cifsproto.h
> @@ -74,7 +74,7 @@ extern unsigned int smbCalcSize(struct smb_hdr *ptr);
>  extern unsigned int smbCalcSize_LE(struct smb_hdr *ptr);
>  extern int decode_negTokenInit(unsigned char *security_blob, int length,
>  			enum securityEnum *secType);
> -extern int cifs_convert_address(char *src, void *dst);
> +extern int cifs_convert_address(const char *src, void *dst);
>  extern int map_smb_to_linux_error(struct smb_hdr *smb, int logErr);
>  extern void header_assemble(struct smb_hdr *, char /* command */ ,
>  			    const struct cifsTconInfo *, int /* length of
> diff --git a/fs/cifs/netmisc.c b/fs/cifs/netmisc.c
> index f9a54da..390ef00 100644
> --- a/fs/cifs/netmisc.c
> +++ b/fs/cifs/netmisc.c
> @@ -163,7 +163,7 @@ cifs_inet_pton(const int address_family, const char *cp, void *dst)
>   * Returns 0 on failure.
>   */
>  int
> -cifs_convert_address(char *src, void *dst)
> +cifs_convert_address(const char *src, void *dst)
>  {
>  	struct sockaddr_in *s4 = (struct sockaddr_in *) dst;
>  	struct sockaddr_in6 *s6 = (struct sockaddr_in6 *) dst;

I'd prefer that that warning get fixed by having Steve commit the last
patch in that series. That patch changes cifs_convert_address to
temporarily add termination to the middle of the src string so the
"const" qualifier will have to go. Until then though, the warning is
harmless since this version of cifs_convert_address doesn't actually
change src.

-- 
Jeff Layton <jlayton@redhat.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-06-16 10:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-16  9:28 [PATCH] cifs: Fix build warning in dns_resolve.c Suresh Jayaraman
2009-06-16 10:46 ` Jeff Layton

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.