Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net/sctp: Use pr_fmt and pr_<level>

Change SCTP_DEBUG_PRINTK and SCTP_DEBUG_PRINTK_IPADDR to
use do { print } while (0) guards.
Add SCTP_DEBUG_PRINTK_CONT to fix errors in log when
lines were continued.
Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
Add a missing newline in "Failed bind hash alloc"

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Joe Perches and committed by
David S. Miller
145ce502 dee06e47

+136 -117
+30 -18
include/net/sctp/sctp.h
··· 275 275 /* Print debugging messages. */ 276 276 #if SCTP_DEBUG 277 277 extern int sctp_debug_flag; 278 - #define SCTP_DEBUG_PRINTK(whatever...) \ 279 - ((void) (sctp_debug_flag && printk(KERN_DEBUG whatever))) 280 - #define SCTP_DEBUG_PRINTK_IPADDR(lead, trail, leadparm, saddr, otherparms...) \ 281 - if (sctp_debug_flag) { \ 282 - if (saddr->sa.sa_family == AF_INET6) { \ 283 - printk(KERN_DEBUG \ 284 - lead "%pI6" trail, \ 285 - leadparm, \ 286 - &saddr->v6.sin6_addr, \ 287 - otherparms); \ 288 - } else { \ 289 - printk(KERN_DEBUG \ 290 - lead "%pI4" trail, \ 291 - leadparm, \ 292 - &saddr->v4.sin_addr.s_addr, \ 293 - otherparms); \ 294 - } \ 295 - } 278 + #define SCTP_DEBUG_PRINTK(fmt, args...) \ 279 + do { \ 280 + if (sctp_debug_flag) \ 281 + printk(KERN_DEBUG pr_fmt(fmt), ##args); \ 282 + } while (0) 283 + #define SCTP_DEBUG_PRINTK_CONT(fmt, args...) \ 284 + do { \ 285 + if (sctp_debug_flag) \ 286 + pr_cont(fmt, ##args); \ 287 + } while (0) 288 + #define SCTP_DEBUG_PRINTK_IPADDR(fmt_lead, fmt_trail, \ 289 + args_lead, saddr, args_trail...) \ 290 + do { \ 291 + if (sctp_debug_flag) { \ 292 + if (saddr->sa.sa_family == AF_INET6) { \ 293 + printk(KERN_DEBUG \ 294 + pr_fmt(fmt_lead "%pI6" fmt_trail), \ 295 + args_lead, \ 296 + &saddr->v6.sin6_addr, \ 297 + args_trail); \ 298 + } else { \ 299 + printk(KERN_DEBUG \ 300 + pr_fmt(fmt_lead "%pI4" fmt_trail), \ 301 + args_lead, \ 302 + &saddr->v4.sin_addr.s_addr, \ 303 + args_trail); \ 304 + } \ 305 + } \ 306 + } while (0) 296 307 #define SCTP_ENABLE_DEBUG { sctp_debug_flag = 1; } 297 308 #define SCTP_DISABLE_DEBUG { sctp_debug_flag = 0; } 298 309 ··· 317 306 #else /* SCTP_DEBUG */ 318 307 319 308 #define SCTP_DEBUG_PRINTK(whatever...) 309 + #define SCTP_DEBUG_PRINTK_CONT(fmt, args...) 320 310 #define SCTP_DEBUG_PRINTK_IPADDR(whatever...) 321 311 #define SCTP_ENABLE_DEBUG 322 312 #define SCTP_DISABLE_DEBUG
+2
net/sctp/associola.c
··· 48 48 * be incorporated into the next SCTP release. 49 49 */ 50 50 51 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 52 + 51 53 #include <linux/types.h> 52 54 #include <linux/fcntl.h> 53 55 #include <linux/poll.h>
+2
net/sctp/chunk.c
··· 37 37 * be incorporated into the next SCTP release. 38 38 */ 39 39 40 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 41 + 40 42 #include <linux/types.h> 41 43 #include <linux/kernel.h> 42 44 #include <linux/net.h>
+2
net/sctp/inqueue.c
··· 43 43 * be incorporated into the next SCTP release. 44 44 */ 45 45 46 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 47 + 46 48 #include <net/sctp/sctp.h> 47 49 #include <net/sctp/sm.h> 48 50 #include <linux/interrupt.h>
+3 -1
net/sctp/ipv6.c
··· 47 47 * be incorporated into the next SCTP release. 48 48 */ 49 49 50 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 51 + 50 52 #include <linux/module.h> 51 53 #include <linux/errno.h> 52 54 #include <linux/types.h> ··· 338 336 memcpy(saddr, baddr, sizeof(union sctp_addr)); 339 337 SCTP_DEBUG_PRINTK("saddr: %pI6\n", &saddr->v6.sin6_addr); 340 338 } else { 341 - printk(KERN_ERR "%s: asoc:%p Could not find a valid source " 339 + pr_err("%s: asoc:%p Could not find a valid source " 342 340 "address for the dest:%pI6\n", 343 341 __func__, asoc, &daddr->v6.sin6_addr); 344 342 }
+3 -2
net/sctp/objcnt.c
··· 38 38 * be incorporated into the next SCTP release. 39 39 */ 40 40 41 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 42 + 41 43 #include <linux/kernel.h> 42 44 #include <net/sctp/sctp.h> 43 45 ··· 136 134 ent = proc_create("sctp_dbg_objcnt", 0, 137 135 proc_net_sctp, &sctp_objcnt_ops); 138 136 if (!ent) 139 - printk(KERN_WARNING 140 - "sctp_dbg_objcnt: Unable to create /proc entry.\n"); 137 + pr_warn("sctp_dbg_objcnt: Unable to create /proc entry.\n"); 141 138 } 142 139 143 140 /* Cleanup the objcount entry in the proc filesystem. */
+2
net/sctp/output.c
··· 41 41 * be incorporated into the next SCTP release. 42 42 */ 43 43 44 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 45 + 44 46 #include <linux/types.h> 45 47 #include <linux/kernel.h> 46 48 #include <linux/wait.h>
+18 -16
net/sctp/outqueue.c
··· 46 46 * be incorporated into the next SCTP release. 47 47 */ 48 48 49 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 50 + 49 51 #include <linux/types.h> 50 52 #include <linux/list.h> /* For struct list_head */ 51 53 #include <linux/socket.h> ··· 1465 1463 /* Display the end of the 1466 1464 * current range. 1467 1465 */ 1468 - SCTP_DEBUG_PRINTK("-%08x", 1469 - dbg_last_ack_tsn); 1466 + SCTP_DEBUG_PRINTK_CONT("-%08x", 1467 + dbg_last_ack_tsn); 1470 1468 } 1471 1469 1472 1470 /* Start a new range. */ 1473 - SCTP_DEBUG_PRINTK(",%08x", tsn); 1471 + SCTP_DEBUG_PRINTK_CONT(",%08x", tsn); 1474 1472 dbg_ack_tsn = tsn; 1475 1473 break; 1476 1474 1477 1475 case 1: /* The last TSN was NOT ACKed. */ 1478 1476 if (dbg_last_kept_tsn != dbg_kept_tsn) { 1479 1477 /* Display the end of current range. */ 1480 - SCTP_DEBUG_PRINTK("-%08x", 1481 - dbg_last_kept_tsn); 1478 + SCTP_DEBUG_PRINTK_CONT("-%08x", 1479 + dbg_last_kept_tsn); 1482 1480 } 1483 1481 1484 - SCTP_DEBUG_PRINTK("\n"); 1482 + SCTP_DEBUG_PRINTK_CONT("\n"); 1485 1483 1486 1484 /* FALL THROUGH... */ 1487 1485 default: ··· 1528 1526 break; 1529 1527 1530 1528 if (dbg_last_kept_tsn != dbg_kept_tsn) 1531 - SCTP_DEBUG_PRINTK("-%08x", 1532 - dbg_last_kept_tsn); 1529 + SCTP_DEBUG_PRINTK_CONT("-%08x", 1530 + dbg_last_kept_tsn); 1533 1531 1534 - SCTP_DEBUG_PRINTK(",%08x", tsn); 1532 + SCTP_DEBUG_PRINTK_CONT(",%08x", tsn); 1535 1533 dbg_kept_tsn = tsn; 1536 1534 break; 1537 1535 1538 1536 case 0: 1539 1537 if (dbg_last_ack_tsn != dbg_ack_tsn) 1540 - SCTP_DEBUG_PRINTK("-%08x", 1541 - dbg_last_ack_tsn); 1542 - SCTP_DEBUG_PRINTK("\n"); 1538 + SCTP_DEBUG_PRINTK_CONT("-%08x", 1539 + dbg_last_ack_tsn); 1540 + SCTP_DEBUG_PRINTK_CONT("\n"); 1543 1541 1544 1542 /* FALL THROUGH... */ 1545 1543 default: ··· 1558 1556 switch (dbg_prt_state) { 1559 1557 case 0: 1560 1558 if (dbg_last_ack_tsn != dbg_ack_tsn) { 1561 - SCTP_DEBUG_PRINTK("-%08x\n", dbg_last_ack_tsn); 1559 + SCTP_DEBUG_PRINTK_CONT("-%08x\n", dbg_last_ack_tsn); 1562 1560 } else { 1563 - SCTP_DEBUG_PRINTK("\n"); 1561 + SCTP_DEBUG_PRINTK_CONT("\n"); 1564 1562 } 1565 1563 break; 1566 1564 1567 1565 case 1: 1568 1566 if (dbg_last_kept_tsn != dbg_kept_tsn) { 1569 - SCTP_DEBUG_PRINTK("-%08x\n", dbg_last_kept_tsn); 1567 + SCTP_DEBUG_PRINTK_CONT("-%08x\n", dbg_last_kept_tsn); 1570 1568 } else { 1571 - SCTP_DEBUG_PRINTK("\n"); 1569 + SCTP_DEBUG_PRINTK_CONT("\n"); 1572 1570 } 1573 1571 } 1574 1572 #endif /* SCTP_DEBUG */
+3 -1
net/sctp/probe.c
··· 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 */ 24 24 25 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 26 + 25 27 #include <linux/kernel.h> 26 28 #include <linux/kprobes.h> 27 29 #include <linux/socket.h> ··· 194 192 if (ret) 195 193 goto remove_proc; 196 194 197 - pr_info("SCTP probe registered (port=%d)\n", port); 195 + pr_info("probe registered (port=%d)\n", port); 198 196 199 197 return 0; 200 198
+8 -9
net/sctp/protocol.c
··· 46 46 * be incorporated into the next SCTP release. 47 47 */ 48 48 49 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 50 + 49 51 #include <linux/module.h> 50 52 #include <linux/init.h> 51 53 #include <linux/netdevice.h> ··· 709 707 &init_net); 710 708 711 709 if (err < 0) { 712 - printk(KERN_ERR 713 - "SCTP: Failed to create the SCTP control socket.\n"); 710 + pr_err("Failed to create the SCTP control socket\n"); 714 711 return err; 715 712 } 716 713 return 0; ··· 1207 1206 __get_free_pages(GFP_ATOMIC, order); 1208 1207 } while (!sctp_assoc_hashtable && --order > 0); 1209 1208 if (!sctp_assoc_hashtable) { 1210 - printk(KERN_ERR "SCTP: Failed association hash alloc.\n"); 1209 + pr_err("Failed association hash alloc\n"); 1211 1210 status = -ENOMEM; 1212 1211 goto err_ahash_alloc; 1213 1212 } ··· 1221 1220 sctp_ep_hashtable = (struct sctp_hashbucket *) 1222 1221 kmalloc(64 * sizeof(struct sctp_hashbucket), GFP_KERNEL); 1223 1222 if (!sctp_ep_hashtable) { 1224 - printk(KERN_ERR "SCTP: Failed endpoint_hash alloc.\n"); 1223 + pr_err("Failed endpoint_hash alloc\n"); 1225 1224 status = -ENOMEM; 1226 1225 goto err_ehash_alloc; 1227 1226 } ··· 1240 1239 __get_free_pages(GFP_ATOMIC, order); 1241 1240 } while (!sctp_port_hashtable && --order > 0); 1242 1241 if (!sctp_port_hashtable) { 1243 - printk(KERN_ERR "SCTP: Failed bind hash alloc."); 1242 + pr_err("Failed bind hash alloc\n"); 1244 1243 status = -ENOMEM; 1245 1244 goto err_bhash_alloc; 1246 1245 } ··· 1249 1248 INIT_HLIST_HEAD(&sctp_port_hashtable[i].chain); 1250 1249 } 1251 1250 1252 - printk(KERN_INFO "SCTP: Hash tables configured " 1253 - "(established %d bind %d)\n", 1251 + pr_info("Hash tables configured (established %d bind %d)\n", 1254 1252 sctp_assoc_hashsize, sctp_port_hashsize); 1255 1253 1256 1254 /* Disable ADDIP by default. */ ··· 1290 1290 1291 1291 /* Initialize the control inode/socket for handling OOTB packets. */ 1292 1292 if ((status = sctp_ctl_sock_init())) { 1293 - printk (KERN_ERR 1294 - "SCTP: Failed to initialize the SCTP control sock.\n"); 1293 + pr_err("Failed to initialize the SCTP control sock\n"); 1295 1294 goto err_ctl_sock_init; 1296 1295 } 1297 1296
+2
net/sctp/sm_make_chunk.c
··· 50 50 * be incorporated into the next SCTP release. 51 51 */ 52 52 53 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 54 + 53 55 #include <linux/types.h> 54 56 #include <linux/kernel.h> 55 57 #include <linux/ip.h>
+10 -11
net/sctp/sm_sideeffect.c
··· 47 47 * be incorporated into the next SCTP release. 48 48 */ 49 49 50 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 51 + 50 52 #include <linux/skbuff.h> 51 53 #include <linux/types.h> 52 54 #include <linux/socket.h> ··· 1148 1146 1149 1147 case SCTP_DISPOSITION_VIOLATION: 1150 1148 if (net_ratelimit()) 1151 - printk(KERN_ERR "sctp protocol violation state %d " 1152 - "chunkid %d\n", state, subtype.chunk); 1149 + pr_err("protocol violation state %d chunkid %d\n", 1150 + state, subtype.chunk); 1153 1151 break; 1154 1152 1155 1153 case SCTP_DISPOSITION_NOT_IMPL: 1156 - printk(KERN_WARNING "sctp unimplemented feature in state %d, " 1157 - "event_type %d, event_id %d\n", 1158 - state, event_type, subtype.chunk); 1154 + pr_warn("unimplemented feature in state %d, event_type %d, event_id %d\n", 1155 + state, event_type, subtype.chunk); 1159 1156 break; 1160 1157 1161 1158 case SCTP_DISPOSITION_BUG: 1162 - printk(KERN_ERR "sctp bug in state %d, " 1163 - "event_type %d, event_id %d\n", 1159 + pr_err("bug in state %d, event_type %d, event_id %d\n", 1164 1160 state, event_type, subtype.chunk); 1165 1161 BUG(); 1166 1162 break; 1167 1163 1168 1164 default: 1169 - printk(KERN_ERR "sctp impossible disposition %d " 1170 - "in state %d, event_type %d, event_id %d\n", 1165 + pr_err("impossible disposition %d in state %d, event_type %d, event_id %d\n", 1171 1166 status, state, event_type, subtype.chunk); 1172 1167 BUG(); 1173 1168 break; ··· 1678 1679 sctp_cmd_send_asconf(asoc); 1679 1680 break; 1680 1681 default: 1681 - printk(KERN_WARNING "Impossible command: %u, %p\n", 1682 - cmd->verb, cmd->obj.ptr); 1682 + pr_warn("Impossible command: %u, %p\n", 1683 + cmd->verb, cmd->obj.ptr); 1683 1684 break; 1684 1685 } 1685 1686
+10 -10
net/sctp/sm_statefuns.c
··· 50 50 * be incorporated into the next SCTP release. 51 51 */ 52 52 53 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 54 + 53 55 #include <linux/types.h> 54 56 #include <linux/kernel.h> 55 57 #include <linux/ip.h> ··· 1140 1138 if (unlikely(!link)) { 1141 1139 if (from_addr.sa.sa_family == AF_INET6) { 1142 1140 if (net_ratelimit()) 1143 - printk(KERN_WARNING 1144 - "%s association %p could not find address %pI6\n", 1145 - __func__, 1146 - asoc, 1147 - &from_addr.v6.sin6_addr); 1141 + pr_warn("%s association %p could not find address %pI6\n", 1142 + __func__, 1143 + asoc, 1144 + &from_addr.v6.sin6_addr); 1148 1145 } else { 1149 1146 if (net_ratelimit()) 1150 - printk(KERN_WARNING 1151 - "%s association %p could not find address %pI4\n", 1152 - __func__, 1153 - asoc, 1154 - &from_addr.v4.sin_addr.s_addr); 1147 + pr_warn("%s association %p could not find address %pI4\n", 1148 + __func__, 1149 + asoc, 1150 + &from_addr.v4.sin_addr.s_addr); 1155 1151 } 1156 1152 return SCTP_DISPOSITION_DISCARD; 1157 1153 }
+21 -21
net/sctp/sm_statetable.c
··· 46 46 * be incorporated into the next SCTP release. 47 47 */ 48 48 49 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 50 + 49 51 #include <linux/skbuff.h> 50 52 #include <net/sctp/sctp.h> 51 53 #include <net/sctp/sm.h> ··· 68 66 .name = "sctp_sf_bug" 69 67 }; 70 68 71 - #define DO_LOOKUP(_max, _type, _table) \ 72 - if ((event_subtype._type > (_max))) { \ 73 - printk(KERN_WARNING \ 74 - "sctp table %p possible attack:" \ 75 - " event %d exceeds max %d\n", \ 76 - _table, event_subtype._type, _max); \ 77 - return &bug; \ 78 - } \ 79 - return &_table[event_subtype._type][(int)state]; 69 + #define DO_LOOKUP(_max, _type, _table) \ 70 + ({ \ 71 + const sctp_sm_table_entry_t *rtn; \ 72 + \ 73 + if ((event_subtype._type > (_max))) { \ 74 + pr_warn("table %p possible attack: event %d exceeds max %d\n", \ 75 + _table, event_subtype._type, _max); \ 76 + rtn = &bug; \ 77 + } else \ 78 + rtn = &_table[event_subtype._type][(int)state]; \ 79 + \ 80 + rtn; \ 81 + }) 80 82 81 83 const sctp_sm_table_entry_t *sctp_sm_lookup_event(sctp_event_t event_type, 82 84 sctp_state_t state, ··· 89 83 switch (event_type) { 90 84 case SCTP_EVENT_T_CHUNK: 91 85 return sctp_chunk_event_lookup(event_subtype.chunk, state); 92 - break; 93 86 case SCTP_EVENT_T_TIMEOUT: 94 - DO_LOOKUP(SCTP_EVENT_TIMEOUT_MAX, timeout, 95 - timeout_event_table); 96 - break; 97 - 87 + return DO_LOOKUP(SCTP_EVENT_TIMEOUT_MAX, timeout, 88 + timeout_event_table); 98 89 case SCTP_EVENT_T_OTHER: 99 - DO_LOOKUP(SCTP_EVENT_OTHER_MAX, other, other_event_table); 100 - break; 101 - 90 + return DO_LOOKUP(SCTP_EVENT_OTHER_MAX, other, 91 + other_event_table); 102 92 case SCTP_EVENT_T_PRIMITIVE: 103 - DO_LOOKUP(SCTP_EVENT_PRIMITIVE_MAX, primitive, 104 - primitive_event_table); 105 - break; 106 - 93 + return DO_LOOKUP(SCTP_EVENT_PRIMITIVE_MAX, primitive, 94 + primitive_event_table); 107 95 default: 108 96 /* Yikes! We got an illegal event type. */ 109 97 return &bug;
+15 -24
net/sctp/socket.c
··· 57 57 * be incorporated into the next SCTP release. 58 58 */ 59 59 60 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 61 + 60 62 #include <linux/types.h> 61 63 #include <linux/kernel.h> 62 64 #include <linux/wait.h> ··· 2460 2458 if (params.sack_delay == 0 && params.sack_freq == 0) 2461 2459 return 0; 2462 2460 } else if (optlen == sizeof(struct sctp_assoc_value)) { 2463 - printk(KERN_WARNING "SCTP: Use of struct sctp_assoc_value " 2464 - "in delayed_ack socket option deprecated\n"); 2465 - printk(KERN_WARNING "SCTP: Use struct sctp_sack_info instead\n"); 2461 + pr_warn("Use of struct sctp_assoc_value in delayed_ack socket option deprecated\n"); 2462 + pr_warn("Use struct sctp_sack_info instead\n"); 2466 2463 if (copy_from_user(&params, optval, optlen)) 2467 2464 return -EFAULT; 2468 2465 ··· 2869 2868 int val; 2870 2869 2871 2870 if (optlen == sizeof(int)) { 2872 - printk(KERN_WARNING 2873 - "SCTP: Use of int in maxseg socket option deprecated\n"); 2874 - printk(KERN_WARNING 2875 - "SCTP: Use struct sctp_assoc_value instead\n"); 2871 + pr_warn("Use of int in maxseg socket option deprecated\n"); 2872 + pr_warn("Use struct sctp_assoc_value instead\n"); 2876 2873 if (copy_from_user(&val, optval, optlen)) 2877 2874 return -EFAULT; 2878 2875 params.assoc_id = 0; ··· 3120 3121 int assoc_id = 0; 3121 3122 3122 3123 if (optlen == sizeof(int)) { 3123 - printk(KERN_WARNING 3124 - "SCTP: Use of int in max_burst socket option deprecated\n"); 3125 - printk(KERN_WARNING 3126 - "SCTP: Use struct sctp_assoc_value instead\n"); 3124 + pr_warn("Use of int in max_burst socket option deprecated\n"); 3125 + pr_warn("Use struct sctp_assoc_value instead\n"); 3127 3126 if (copy_from_user(&val, optval, optlen)) 3128 3127 return -EFAULT; 3129 3128 } else if (optlen == sizeof(struct sctp_assoc_value)) { ··· 4278 4281 if (copy_from_user(&params, optval, len)) 4279 4282 return -EFAULT; 4280 4283 } else if (len == sizeof(struct sctp_assoc_value)) { 4281 - printk(KERN_WARNING "SCTP: Use of struct sctp_assoc_value " 4282 - "in delayed_ack socket option deprecated\n"); 4283 - printk(KERN_WARNING "SCTP: Use struct sctp_sack_info instead\n"); 4284 + pr_warn("Use of struct sctp_assoc_value in delayed_ack socket option deprecated\n"); 4285 + pr_warn("Use struct sctp_sack_info instead\n"); 4284 4286 if (copy_from_user(&params, optval, len)) 4285 4287 return -EFAULT; 4286 4288 } else ··· 4925 4929 struct sctp_association *asoc; 4926 4930 4927 4931 if (len == sizeof(int)) { 4928 - printk(KERN_WARNING 4929 - "SCTP: Use of int in maxseg socket option deprecated\n"); 4930 - printk(KERN_WARNING 4931 - "SCTP: Use struct sctp_assoc_value instead\n"); 4932 + pr_warn("Use of int in maxseg socket option deprecated\n"); 4933 + pr_warn("Use struct sctp_assoc_value instead\n"); 4932 4934 params.assoc_id = 0; 4933 4935 } else if (len >= sizeof(struct sctp_assoc_value)) { 4934 4936 len = sizeof(struct sctp_assoc_value); ··· 5017 5023 struct sctp_association *asoc; 5018 5024 5019 5025 if (len == sizeof(int)) { 5020 - printk(KERN_WARNING 5021 - "SCTP: Use of int in max_burst socket option deprecated\n"); 5022 - printk(KERN_WARNING 5023 - "SCTP: Use struct sctp_assoc_value instead\n"); 5026 + pr_warn("Use of int in max_burst socket option deprecated\n"); 5027 + pr_warn("Use struct sctp_assoc_value instead\n"); 5024 5028 params.assoc_id = 0; 5025 5029 } else if (len >= sizeof(struct sctp_assoc_value)) { 5026 5030 len = sizeof(struct sctp_assoc_value); ··· 5578 5586 tfm = crypto_alloc_hash(sctp_hmac_alg, 0, CRYPTO_ALG_ASYNC); 5579 5587 if (IS_ERR(tfm)) { 5580 5588 if (net_ratelimit()) { 5581 - printk(KERN_INFO 5582 - "SCTP: failed to load transform for %s: %ld\n", 5589 + pr_info("failed to load transform for %s: %ld\n", 5583 5590 sctp_hmac_alg, PTR_ERR(tfm)); 5584 5591 } 5585 5592 return -ENOSYS;
+5 -4
net/sctp/transport.c
··· 48 48 * be incorporated into the next SCTP release. 49 49 */ 50 50 51 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 52 + 51 53 #include <linux/slab.h> 52 54 #include <linux/types.h> 53 55 #include <linux/random.h> ··· 246 244 struct dst_entry *dst; 247 245 248 246 if (unlikely(pmtu < SCTP_DEFAULT_MINSEGMENT)) { 249 - printk(KERN_WARNING "%s: Reported pmtu %d too low, " 250 - "using default minimum of %d\n", 251 - __func__, pmtu, 252 - SCTP_DEFAULT_MINSEGMENT); 247 + pr_warn("%s: Reported pmtu %d too low, using default minimum of %d\n", 248 + __func__, pmtu, 249 + SCTP_DEFAULT_MINSEGMENT); 253 250 /* Use default minimum segment size and disable 254 251 * pmtu discovery on this transport. 255 252 */