Skip to contentSkip to conversation

linux-next: build warning after merge of the cifs tree

PATCH New Stephen Rothwell 5 participants 7 messages Jan 31, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hi all,

After merging the cifs tree, today's linux-next build (powerpc ppc64_defconfig) produced this warning:

fs/cifs/file.c: In function 'cifs_iovec_write':
fs/cifs/file.c:1740: warning: passing argument 6 of 'CIFSSMBWrite2' from incompatible pointer type fs/cifs/cifsproto.h:343: note: expected 'unsigned int *' but argument is of type 'size_t *'

Introduced by commit 72432ffcf555decbbae47f1be338e1d2f210aa69 ("CIFS:
Implement cifs_strict_writev (try #4)").

Signature · 3 lines
Cheers,
Stephen Rothwell                    [email protected]
http://www.canb.auug.org.au/~sfr/
#1 lore raw
Quoted 5 lines · Stephen Rothwell

Hi all,

After merging the cifs tree, today's linux-next build (powerpc ppc64_defconfig) produced this warning:

Quoted 7 lines

fs/cifs/file.c: In function 'cifs_iovec_write':
fs/cifs/file.c:1740: warning: passing argument 6 of 'CIFSSMBWrite2' from incompatible pointer type fs/cifs/cifsproto.h:343: note: expected 'unsigned int *' but argument is of type 'size_t *'

Introduced by commit 72432ffcf555decbbae47f1be338e1d2f210aa69 ("CIFS:
Implement cifs_strict_writev (try #4)").

The following patch should silence that warning.

From: Suresh Jayaraman <[email protected]>
Subject: [PATCH] cifs: fix compiler warning about incompatible pointer type

fs/cifs/file.c: In function ‘cifs_iovec_write’:
fs/cifs/file.c:1740:9: warning: passing argument 6 of ‘CIFSSMBWrite2’ from incompatible pointer type fs/cifs/cifsproto.h:343:12: note: expected ‘unsigned int *’ but argument is of type ‘size_t *’

---
 fs/cifs/file.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/cifs/file.c +1 -1
index 0de17c1..2a3c5d8 100644
@@ -1667,7 +1667,7 @@ static ssize_t
 cifs_iovec_write(struct file *file, const struct iovec *iov,
 		 unsigned long nr_segs, loff_t *poffset)
 {
-	size_t total_written = 0, written = 0;
+	unsigned int total_written = 0, written = 0;
 	unsigned long num_pages, npages;
 	size_t copied, len, cur_len, i;
 	struct kvec *to_send;
#2 lore raw

2011/1/31 Suresh Jayaraman <[email protected]>:

Quoted 35 lines · Stephen Rothwell
Quoted 5 lines

Hi all,

After merging the cifs tree, today's linux-next build (powerpc ppc64_defconfig) produced this warning:

Quoted 7 lines

fs/cifs/file.c: In function 'cifs_iovec_write':
fs/cifs/file.c:1740: warning: passing argument 6 of 'CIFSSMBWrite2' from incompatible pointer type fs/cifs/cifsproto.h:343: note: expected 'unsigned int *' but argument is of type 'size_t *'

Introduced by commit 72432ffcf555decbbae47f1be338e1d2f210aa69 ("CIFS:
Implement cifs_strict_writev (try #4)").

The following patch should silence that warning.

From: Suresh Jayaraman <[email protected]>
Subject: [PATCH] cifs: fix compiler warning about incompatible pointer type

fs/cifs/file.c: In function ‘cifs_iovec_write’:
fs/cifs/file.c:1740:9: warning: passing argument 6 of ‘CIFSSMBWrite2’ from incompatible pointer type fs/cifs/cifsproto.h:343:12: note: expected ‘unsigned int *’ but argument is of type ‘size_t *’

---
 fs/cifs/file.c |    2 +-

 1 files changed, 1 insertions(+), 1 deletions(-)
fs/cifs/file.c +0 -0
index 0de17c1..2a3c5d8 100644

fs/cifs/file.c static ssize_t · line 1673

Quoted 8 lines
fs/cifs/file.c +1 -1
@@ -1667,7 +1667,7 @@ static ssize_t
  cifs_iovec_write(struct file *file, const struct iovec *iov,
                 unsigned long nr_segs, loff_t *poffset)
  {
-       size_t total_written = 0, written = 0;
+       unsigned int total_written = 0, written = 0;
        unsigned long num_pages, npages;
        size_t copied, len, cur_len, i;
        struct kvec *to_send;

I've just noriced another bug: that 'i' variable should be unsigned long. I will recreate the patch with this fix.

Signature · 2 lines
Best regards,
Pavel Shilovsky.
#3 lore raw

PATCH 1/1 cifs: fix compiler warning about incompatible pointer type (try #2)

In reply to Suresh Jayaraman

fs/cifs/file.c: In function ‘cifs_iovec_write’:
fs/cifs/file.c:1740:9: warning: passing argument 6 of ‘CIFSSMBWrite2’ from incompatible pointer type fs/cifs/cifsproto.h:343:12: note: expected ‘unsigned int *’ but argument is of type ‘size_t *’

---
 fs/cifs/file.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
fs/cifs/file.c +3 -3
index 0de17c1..4940bac 100644
@@ -1667,9 +1667,9 @@ static ssize_t
 cifs_iovec_write(struct file *file, const struct iovec *iov,
 		 unsigned long nr_segs, loff_t *poffset)
 {
-	size_t total_written = 0, written = 0;
-	unsigned long num_pages, npages;
-	size_t copied, len, cur_len, i;
+	unsigned int written = 0;
+	unsigned long num_pages, npages, i;
+	size_t copied, len, cur_len, total_written = 0;
 	struct kvec *to_send;
 	struct page **pages;
 	struct iov_iter it;
Signature · 1 line
1.7.1
#4 lore raw

PATCH 1/1 cifs: fix compiler warning about incompatible pointer type (try #3)

In reply to Suresh Jayaraman

fs/cifs/file.c: In function ‘cifs_iovec_write’:
fs/cifs/file.c:1740:9: warning: passing argument 6 of ‘CIFSSMBWrite2’ from incompatible pointer type fs/cifs/cifsproto.h:343:12: note: expected ‘unsigned int *’ but argument is of type ‘size_t *’

---
 fs/cifs/file.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
fs/cifs/file.c +6 -4
index 0de17c1..d8338e7 100644
@@ -1667,9 +1667,10 @@ static ssize_t
 cifs_iovec_write(struct file *file, const struct iovec *iov,
 		 unsigned long nr_segs, loff_t *poffset)
 {
-	size_t total_written = 0, written = 0;
-	unsigned long num_pages, npages;
-	size_t copied, len, cur_len, i;
+	unsigned int written;
+	ssize_t total_written = 0;
+	unsigned long num_pages, npages, i;
+	size_t copied, len, cur_len;
 	struct kvec *to_send;
 	struct page **pages;
 	struct iov_iter it;
@@ -1825,7 +1826,8 @@ cifs_iovec_read(struct file *file, const struct iovec *iov,
 {
 	int rc;
 	int xid;
-	unsigned int total_read, bytes_read = 0;
+	ssize_t total_read;
+	unsigned int bytes_read = 0;
 	size_t len, cur_len;
 	int iov_offset = 0;
 	struct cifs_sb_info *cifs_sb;
Signature · 1 line
1.7.1
#5 lore raw

Re: [PATCH] cifs: fix compiler warning about incompatible pointer type (try #3)

2011/1/31 Pavel Shilovsky <[email protected]>:

Quoted 39 lines

fs/cifs/file.c: In function ‘cifs_iovec_write’:
fs/cifs/file.c:1740:9: warning: passing argument 6 of ‘CIFSSMBWrite2’ from incompatible pointer type fs/cifs/cifsproto.h:343:12: note: expected ‘unsigned int *’ but argument is of type ‘size_t *’

---
 fs/cifs/file.c |   10 ++++++----

 1 files changed, 6 insertions(+), 4 deletions(-)
fs/cifs/file.c +6 -5
index 0de17c1..d8338e7 100644
@@ -1667,9 +1667,10 @@ static ssize_t
  cifs_iovec_write(struct file *file, const struct iovec *iov,
                 unsigned long nr_segs, loff_t *poffset)
  {
-       size_t total_written = 0, written = 0;
-       unsigned long num_pages, npages;
-       size_t copied, len, cur_len, i;
+       unsigned int written;
+       ssize_t total_written = 0;
+       unsigned long num_pages, npages, i;
+       size_t copied, len, cur_len;
        struct kvec *to_send;
        struct page **pages;
        struct iov_iter it;
@@ -1825,7 +1826,8 @@ cifs_iovec_read(struct file *file, const struct iovec *iov,
  {
        int rc;
        int xid;
-       unsigned int total_read, bytes_read = 0;
+       ssize_t total_read;
+       unsigned int bytes_read = 0;
        size_t len, cur_len;
        int iov_offset = 0;
        struct cifs_sb_info *cifs_sb;
--
Quoted 3 lines

1.7.1

Let's drop this one according to [PATCH] cifs: clean up some compiler warnings patch.

Signature · 2 lines
Best regards,
Pavel Shilovsky.
#6 lore raw
In reply to Suresh Jayaraman
Quoted 43 lines · On Mon, 31 Jan 2011 16:19:51 +0530 Suresh Jayaraman <[email protected]> wrote:
Quoted 5 lines · Stephen Rothwell

Hi all,

After merging the cifs tree, today's linux-next build (powerpc ppc64_defconfig) produced this warning:

Quoted 7 lines

fs/cifs/file.c: In function 'cifs_iovec_write':
fs/cifs/file.c:1740: warning: passing argument 6 of 'CIFSSMBWrite2' from incompatible pointer type fs/cifs/cifsproto.h:343: note: expected 'unsigned int *' but argument is of type 'size_t *'

Introduced by commit 72432ffcf555decbbae47f1be338e1d2f210aa69 ("CIFS:
Implement cifs_strict_writev (try #4)").

The following patch should silence that warning.

From: Suresh Jayaraman <[email protected]>
Subject: [PATCH] cifs: fix compiler warning about incompatible pointer type

fs/cifs/file.c: In function ‘cifs_iovec_write’:
fs/cifs/file.c:1740:9: warning: passing argument 6 of ‘CIFSSMBWrite2’ from incompatible pointer type fs/cifs/cifsproto.h:343:12: note: expected ‘unsigned int *’ but argument is of type ‘size_t *’

---
 fs/cifs/file.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/cifs/file.c +1 -2
index 0de17c1..2a3c5d8 100644
@@ -1667,7 +1667,7 @@ static ssize_t
 cifs_iovec_write(struct file *file, const struct iovec *iov,
 		 unsigned long nr_segs, loff_t *poffset)
 {
-	size_t total_written = 0, written = 0;
+	unsigned int total_written = 0, written = 0;
 	unsigned long num_pages, npages;
 	size_t copied, len, cur_len, i;
 	struct kvec *to_send;
--
Quoted 3 lines

To unsubscribe from this list: send the line "unsubscribe linux-cifs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

I fixed this a few days ago along with a number of other compiler warnings in:

[PATCH] cifs: clean up some compiler warnings

...just waiting for Steve to merge it.

Signature · 1 line
Jeff Layton <[email protected]>