Patchwork [net] sctp: fix pr_warn max_data argument type mismatch

login
register
mail settings
Submitter Jakub Audykowicz
Date Dec. 6, 2018, 7:58 a.m.
Message ID <20181206075837.13336-1-jakub.audykowicz@gmail.com>
Download mbox | patch
Permalink /patch/673855/
State New
Headers show

Comments

Jakub Audykowicz - Dec. 6, 2018, 7:58 a.m.
My previous patch introduced a compilation warning regarding a type
mismatch (int vs size_t). This is a one-letter fix for good housekeeping.

Signed-off-by: Jakub Audykowicz <jakub.audykowicz@gmail.com>
---
 net/sctp/chunk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
David Miller - Dec. 6, 2018, 8:03 a.m.
From: Jakub Audykowicz <jakub.audykowicz@gmail.com>
Date: Thu,  6 Dec 2018 08:58:37 +0100

> My previous patch introduced a compilation warning regarding a type
> mismatch (int vs size_t). This is a one-letter fix for good housekeeping.
> 
> Signed-off-by: Jakub Audykowicz <jakub.audykowicz@gmail.com>

Still wrong and I fixed it when I applied your patch.

You need to use the 'Z' prefix for size_t, so %Zu in this case.
Jakub Audykowicz - Dec. 6, 2018, 8:04 a.m.
On 2018-12-06 09:03, David Miller wrote:

> From: Jakub Audykowicz <jakub.audykowicz@gmail.com>
> Date: Thu,  6 Dec 2018 08:58:37 +0100
>
>> My previous patch introduced a compilation warning regarding a type
>> mismatch (int vs size_t). This is a one-letter fix for good housekeeping.
>>
>> Signed-off-by: Jakub Audykowicz <jakub.audykowicz@gmail.com>
> Still wrong and I fixed it when I applied your patch.
>
> You need to use the 'Z' prefix for size_t, so %Zu in this case.

Right, I just realized that as well, thanks!

Patch

diff --git a/net/sctp/chunk.c b/net/sctp/chunk.c
index d5b91bc8a377..ee5638358ad5 100644
--- a/net/sctp/chunk.c
+++ b/net/sctp/chunk.c
@@ -194,7 +194,7 @@  struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc,
 	if (unlikely(!max_data)) {
 		max_data = sctp_min_frag_point(sctp_sk(asoc->base.sk),
 					       sctp_datachk_len(&asoc->stream));
-		pr_warn_ratelimited("%s: asoc:%p frag_point is zero, forcing max_data to default minimum (%d)",
+		pr_warn_ratelimited("%s: asoc:%p frag_point is zero, forcing max_data to default minimum (%ld)",
 				    __func__, asoc, max_data);
 	}