Skip to contentSkip to conversation

sctp: fix pr_warn max_data argument type mismatch

PATCH In review Jakub Audykowicz 2 participants 3 messages Dec 6, 2018

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

PATCH 1/1 sctp: fix pr_warn max_data argument type mismatch

My previous patch introduced a compilation warning regarding a type mismatch (int vs size_t). This is a one-letter fix for good housekeeping.

---
 net/sctp/chunk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/sctp/chunk.c +1 -1
index d5b91bc8a377..ee5638358ad5 100644
@@ -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);
 	}
 
Signature · 1 line
2.17.1
maintainer
#1 lore raw

From: Jakub Audykowicz <[email protected]>
Date: Thu, 6 Dec 2018 08:58:37 +0100

Quoted 4 lines

My previous patch introduced a compilation warning regarding a type mismatch (int vs size_t). This is a one-letter fix for good housekeeping.

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.

#2 lore raw
Quoted 10 lines · David Miller

From: Jakub Audykowicz <[email protected]>
Date: Thu, 6 Dec 2018 08:58:37 +0100

Quoted 4 lines

My previous patch introduced a compilation warning regarding a type mismatch (int vs size_t). This is a one-letter fix for good housekeeping.

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!