Skip to contentSkip to conversation

nfs4: The difference of 2 pointers is size_t

PATCH Applied Geert Uytterhoeven 3 participants 5 messages Oct 28, 2010

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

PATCH 1/1 nfs4: The difference of 2 pointers is size_t

On m68k, which is 32-bit:

fs/nfs/nfs4proc.c: In function ‘nfs41_sequence_done’:
fs/nfs/nfs4proc.c:432: warning: format ‘%ld’ expects type ‘long int’, but argument 3 has type ‘int’ fs/nfs/nfs4proc.c: In function ‘nfs4_setup_sequence’:
fs/nfs/nfs4proc.c:576: warning: format ‘%ld’ expects type ‘long int’, but argument 5 has type ‘int’

On 32-bit, size_t is int; on 64-bit, size_t is long.

Introduced by commit dfb4f309830359352539919f23accc59a20a3758 ("NFSv4.1: keep seq_res.sr_slot as pointer rather than an index")

---
 fs/nfs/nfs4proc.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
fs/nfs/nfs4proc.c +2 -2
index 32c8758..80229dc 100644
@@ -429,7 +429,7 @@ static int nfs41_sequence_done(struct rpc_task *task, struct nfs4_sequence_res *
 		 * returned NFS4ERR_DELAY as per Section 2.10.6.2
 		 * of RFC5661.
 		 */
-		dprintk("%s: slot=%ld seq=%d: Operation in progress\n",
+		dprintk("%s: slot=%zd seq=%d: Operation in progress\n",
 			__func__,
 			res->sr_slot - res->sr_session->fc_slot_table.slots,
 			res->sr_slot->seq_nr);
@@ -573,7 +573,7 @@ int nfs4_setup_sequence(const struct nfs_server *server,
 		goto out;
 	}
 
-	dprintk("--> %s clp %p session %p sr_slot %ld\n",
+	dprintk("--> %s clp %p session %p sr_slot %zd\n",
 		__func__, session->clp, session, res->sr_slot ?
 			res->sr_slot - session->fc_slot_table.slots : -1);
 
Signature · 12 lines
1.7.0.4

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds
#1 lore raw
Quoted 4 lines · Geert Uytterhoeven

On m68k, which is 32-bit:
=20
fs/nfs/nfs4proc.c: In function =E2=80=98nfs41_sequence_done=E2=80=99:
fs/nfs/nfs4proc.c:432: warning: format =E2=80=98%ld=E2=80=99 expects =

type =E2=80=98long int=E2=80=99, but argument 3 has type =E2=80=98int=E2= =80=99

Quoted 2 lines

fs/nfs/nfs4proc.c: In function =E2=80=98nfs4_setup_sequence=E2=80=99:
fs/nfs/nfs4proc.c:576: warning: format =E2=80=98%ld=E2=80=99 expects =

type =E2=80=98long int=E2=80=99, but argument 5 has type =E2=80=98int=E2= =80=99

Quoted 4 lines

=20
On 32-bit, size_t is int; on 64-bit, size_t is long.
=20
Introduced by commit dfb4f309830359352539919f23accc59a20a3758 ("NFSv4=

=2E1: keep

fs/nfs/nfs4proc.c static int nfs41_sequence_done(struct rpc_task *t=

Quoted 12 lines

seq_res.sr_slot as pointer rather than an index")
=20

---
 fs/nfs/nfs4proc.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

=20

fs/nfs/nfs4proc.c +0 -0
index 32c8758..80229dc 100644
@@ -429,7 +429,7 @@ static int nfs41_sequence_done(struct rpc_task *t=

ask, struct nfs4_sequence_res *

fs/nfs/nfs4proc.c int nfs4_setup_sequence(const struct nfs_server *=

Quoted 9 lines
fs/nfs/nfs4proc.c +1 -1
 		 * returned NFS4ERR_DELAY as per Section 2.10.6.2
 		 * of RFC5661.
 		 */
-		dprintk("%s: slot=3D%ld seq=3D%d: Operation in progress\n",
+		dprintk("%s: slot=3D%zd seq=3D%d: Operation in progress\n",
 			__func__,
 			res->sr_slot - res->sr_session->fc_slot_table.slots,
 			res->sr_slot->seq_nr);
@@ -573,7 +573,7 @@ int nfs4_setup_sequence(const struct nfs_server *=

server,

Quoted 8 lines
fs/nfs/nfs4proc.c +0 -0
 		goto out;
 	}

=20

fs/nfs/nfs4proc.c +1 -1
-	dprintk("--> %s clp %p session %p sr_slot %ld\n",
+	dprintk("--> %s clp %p session %p sr_slot %zd\n",
 		__func__, session->clp, session, res->sr_slot ?
 			res->sr_slot - session->fc_slot_table.slots : -1);

=20

Thanks! Applied.

Trond

#2 lore raw
In reply to Geert Uytterhoeven
Quoted 31 lines · On Thu, 28 Oct 2010 20:06:19 +0200 (CEST) Geert Uytterhoeven…

On m68k, which is 32-bit:

fs/nfs/nfs4proc.c: In function ___nfs41_sequence_done___:
fs/nfs/nfs4proc.c:432: warning: format ___%ld___ expects type ___long int___, but argument 3 has type ___int___ fs/nfs/nfs4proc.c: In function ___nfs4_setup_sequence___:
fs/nfs/nfs4proc.c:576: warning: format ___%ld___ expects type ___long int___, but argument 5 has type ___int___

On 32-bit, size_t is int; on 64-bit, size_t is long.

Introduced by commit dfb4f309830359352539919f23accc59a20a3758 ("NFSv4.1: keep seq_res.sr_slot as pointer rather than an index")

---
 fs/nfs/nfs4proc.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
fs/nfs/nfs4proc.c +1 -1
index 32c8758..80229dc 100644
@@ -429,7 +429,7 @@ static int nfs41_sequence_done(struct rpc_task *task, struct nfs4_sequence_res *
 		 * returned NFS4ERR_DELAY as per Section 2.10.6.2
 		 * of RFC5661.
 		 */
-		dprintk("%s: slot=%ld seq=%d: Operation in progress\n",
+		dprintk("%s: slot=%zd seq=%d: Operation in progress\n",
 			__func__,
 			res->sr_slot - res->sr_session->fc_slot_table.slots,
 			res->sr_slot->seq_nr);

fs/nfs/nfs4proc.c int nfs4_setup_sequence(const struct nfs_server *server, · line 579

Quoted 8 lines
fs/nfs/nfs4proc.c +1 -1
@@ -573,7 +573,7 @@ int nfs4_setup_sequence(const struct nfs_server *server,
 		goto out;
 	}
 
-	dprintk("--> %s clp %p session %p sr_slot %ld\n",
+	dprintk("--> %s clp %p session %p sr_slot %zd\n",
 		__func__, session->clp, session, res->sr_slot ?
 			res->sr_slot - session->fc_slot_table.slots : -1);
 

I think it should formally be %t, for a ptrdiff_t.

#3 lore raw
Quoted 37 lines · Andrew Morton
Quoted 34 lines · On Thu, 28 Oct 2010 20:06:19 +0200 (CEST) Geert Uytterhoeven…

On m68k, which is 32-bit:

fs/nfs/nfs4proc.c: In function ___nfs41_sequence_done___:
fs/nfs/nfs4proc.c:432: warning: format ___%ld___ expects type ___long int___, but argument 3 has type ___int___ fs/nfs/nfs4proc.c: In function ___nfs4_setup_sequence___:
fs/nfs/nfs4proc.c:576: warning: format ___%ld___ expects type ___long int___, but argument 5 has type ___int___

On 32-bit, size_t is int; on 64-bit, size_t is long.

Introduced by commit dfb4f309830359352539919f23accc59a20a3758 ("NFSv4.1: keep seq_res.sr_slot as pointer rather than an index")

---
 fs/nfs/nfs4proc.c |    4 ++--

 1 files changed, 2 insertions(+), 2 deletions(-)
fs/nfs/nfs4proc.c +1 -1
index 32c8758..80229dc 100644
@@ -429,7 +429,7 @@ static int nfs41_sequence_done(struct rpc_task *task, struct nfs4_sequence_res *
                * returned NFS4ERR_DELAY as per Section 2.10.6.2
                * of RFC5661.
                */
-             dprintk("%s: slot=%ld seq=%d: Operation in progress\n",
+             dprintk("%s: slot=%zd seq=%d: Operation in progress\n",
                       __func__,
                       res->sr_slot - res->sr_session->fc_slot_table.slots,
                       res->sr_slot->seq_nr);
@@ -573,7 +573,7 @@ int nfs4_setup_sequence(const struct nfs_server *server,
               goto out;
       }
 
Quoted 7 lines
Quoted 5 lines
fs/nfs/nfs4proc.c +1 -1
-     dprintk("--> %s clp %p session %p sr_slot %ld\n",
+     dprintk("--> %s clp %p session %p sr_slot %zd\n",

              __func__, session->clp, session, res->sr_slot ? res->sr_slot - session->fc_slot_table.slots : -1);

I think it should formally be %t, for a ptrdiff_t.

You're correct.

I didn't know we "did" %t. I almost have enough fingers and toes to count its users ;-)

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds

#4 lore raw
Quoted 46 lines · Geert Uytterhoeven
Quoted 37 lines · Andrew Morton
Quoted 34 lines · On Thu, 28 Oct 2010 20:06:19 +0200 (CEST) Geert Uytterhoeven…

On m68k, which is 32-bit:

fs/nfs/nfs4proc.c: In function ___nfs41_sequence_done___:
fs/nfs/nfs4proc.c:432: warning: format ___%ld___ expects type ___long int___, but argument 3 has type ___int___ fs/nfs/nfs4proc.c: In function ___nfs4_setup_sequence___:
fs/nfs/nfs4proc.c:576: warning: format ___%ld___ expects type ___long int___, but argument 5 has type ___int___

On 32-bit, size_t is int; on 64-bit, size_t is long.

Introduced by commit dfb4f309830359352539919f23accc59a20a3758 ("NFSv4.1: keep seq_res.sr_slot as pointer rather than an index")

---
 fs/nfs/nfs4proc.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
fs/nfs/nfs4proc.c +1 -1
index 32c8758..80229dc 100644
@@ -429,7 +429,7 @@ static int nfs41_sequence_done(struct rpc_task *task, struct nfs4_sequence_res *
               * returned NFS4ERR_DELAY as per Section 2.10.6.2
               * of RFC5661.
               */
-             dprintk("%s: slot=%ld seq=%d: Operation in progress\n",
+             dprintk("%s: slot=%zd seq=%d: Operation in progress\n",
                      __func__,
                      res->sr_slot - res->sr_session->fc_slot_table.slots,
                      res->sr_slot->seq_nr);
@@ -573,7 +573,7 @@ int nfs4_setup_sequence(const struct nfs_server *server,
              goto out;
      }
 
Quoted 7 lines

fs/nfs/nfs4proc.c int nfs4_setup_sequence(const struct nfs_server *server, · line 579

Quoted 5 lines
fs/nfs/nfs4proc.c +1 -1
-     dprintk("--> %s clp %p session %p sr_slot %ld\n",
+     dprintk("--> %s clp %p session %p sr_slot %zd\n",
              __func__, session->clp, session, res->sr_slot ?
                      res->sr_slot - session->fc_slot_table.slots : -1);
 

I think it should formally be %t, for a ptrdiff_t.

Quoted 8 lines

You're correct.

I didn't know we "did" %t. I almost have enough fingers and toes to count its users ;-)

Gr{oetje,eeting}s,

Geert

I did a s/size_t/ptrdiff_t/, s/%z/%t/ to the above and committed the result with no other changes.

Cheers
Trond