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

Configure Feed

Select the types of activity you want to include in your feed.

rust: replace rustdoc references to alloc::format

Replace alloc::format[1] in the pr_* and dev_* macros' doc comments
with std::format[2] because they are identical but less likely to get
confused with the kernel's alloc crate.

And add a url link for the std::format! macro.

Link: https://doc.rust-lang.org/alloc/macro.format.html [1]
Link: https://doc.rust-lang.org/std/macro.format.html [2]
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Signed-off-by: Andrew Ballance <andrewjballance@gmail.com>
Link: https://lore.kernel.org/r/20250325133352.441425-1-andrewjballance@gmail.com
[ Fixed typo and reworded slightly. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

authored by

Andrew Ballance and committed by
Miguel Ojeda
edc5e6e0 86d990c7

+34 -17
+16 -8
rust/kernel/device.rs
··· 252 252 /// Equivalent to the kernel's `dev_emerg` macro. 253 253 /// 254 254 /// Mimics the interface of [`std::print!`]. More information about the syntax is available from 255 - /// [`core::fmt`] and `alloc::format!`. 255 + /// [`core::fmt`] and [`std::format!`]. 256 256 /// 257 257 /// [`std::print!`]: https://doc.rust-lang.org/std/macro.print.html 258 + /// [`std::format!`]: https://doc.rust-lang.org/std/macro.format.html 258 259 /// 259 260 /// # Examples 260 261 /// ··· 278 277 /// Equivalent to the kernel's `dev_alert` macro. 279 278 /// 280 279 /// Mimics the interface of [`std::print!`]. More information about the syntax is available from 281 - /// [`core::fmt`] and `alloc::format!`. 280 + /// [`core::fmt`] and [`std::format!`]. 282 281 /// 283 282 /// [`std::print!`]: https://doc.rust-lang.org/std/macro.print.html 283 + /// [`std::format!`]: https://doc.rust-lang.org/std/macro.format.html 284 284 /// 285 285 /// # Examples 286 286 /// ··· 304 302 /// Equivalent to the kernel's `dev_crit` macro. 305 303 /// 306 304 /// Mimics the interface of [`std::print!`]. More information about the syntax is available from 307 - /// [`core::fmt`] and `alloc::format!`. 305 + /// [`core::fmt`] and [`std::format!`]. 308 306 /// 309 307 /// [`std::print!`]: https://doc.rust-lang.org/std/macro.print.html 308 + /// [`std::format!`]: https://doc.rust-lang.org/std/macro.format.html 310 309 /// 311 310 /// # Examples 312 311 /// ··· 330 327 /// Equivalent to the kernel's `dev_err` macro. 331 328 /// 332 329 /// Mimics the interface of [`std::print!`]. More information about the syntax is available from 333 - /// [`core::fmt`] and `alloc::format!`. 330 + /// [`core::fmt`] and [`std::format!`]. 334 331 /// 335 332 /// [`std::print!`]: https://doc.rust-lang.org/std/macro.print.html 333 + /// [`std::format!`]: https://doc.rust-lang.org/std/macro.format.html 336 334 /// 337 335 /// # Examples 338 336 /// ··· 356 352 /// Equivalent to the kernel's `dev_warn` macro. 357 353 /// 358 354 /// Mimics the interface of [`std::print!`]. More information about the syntax is available from 359 - /// [`core::fmt`] and `alloc::format!`. 355 + /// [`core::fmt`] and [`std::format!`]. 360 356 /// 361 357 /// [`std::print!`]: https://doc.rust-lang.org/std/macro.print.html 358 + /// [`std::format!`]: https://doc.rust-lang.org/std/macro.format.html 362 359 /// 363 360 /// # Examples 364 361 /// ··· 382 377 /// Equivalent to the kernel's `dev_notice` macro. 383 378 /// 384 379 /// Mimics the interface of [`std::print!`]. More information about the syntax is available from 385 - /// [`core::fmt`] and `alloc::format!`. 380 + /// [`core::fmt`] and [`std::format!`]. 386 381 /// 387 382 /// [`std::print!`]: https://doc.rust-lang.org/std/macro.print.html 383 + /// [`std::format!`]: https://doc.rust-lang.org/std/macro.format.html 388 384 /// 389 385 /// # Examples 390 386 /// ··· 408 402 /// Equivalent to the kernel's `dev_info` macro. 409 403 /// 410 404 /// Mimics the interface of [`std::print!`]. More information about the syntax is available from 411 - /// [`core::fmt`] and `alloc::format!`. 405 + /// [`core::fmt`] and [`std::format!`]. 412 406 /// 413 407 /// [`std::print!`]: https://doc.rust-lang.org/std/macro.print.html 408 + /// [`std::format!`]: https://doc.rust-lang.org/std/macro.format.html 414 409 /// 415 410 /// # Examples 416 411 /// ··· 434 427 /// Equivalent to the kernel's `dev_dbg` macro, except that it doesn't support dynamic debug yet. 435 428 /// 436 429 /// Mimics the interface of [`std::print!`]. More information about the syntax is available from 437 - /// [`core::fmt`] and `alloc::format!`. 430 + /// [`core::fmt`] and [`std::format!`]. 438 431 /// 439 432 /// [`std::print!`]: https://doc.rust-lang.org/std/macro.print.html 433 + /// [`std::format!`]: https://doc.rust-lang.org/std/macro.format.html 440 434 /// 441 435 /// # Examples 442 436 ///
+18 -9
rust/kernel/print.rs
··· 198 198 /// Equivalent to the kernel's [`pr_emerg`] macro. 199 199 /// 200 200 /// Mimics the interface of [`std::print!`]. See [`core::fmt`] and 201 - /// `alloc::format!` for information about the formatting syntax. 201 + /// [`std::format!`] for information about the formatting syntax. 202 202 /// 203 203 /// [`pr_emerg`]: https://docs.kernel.org/core-api/printk-basics.html#c.pr_emerg 204 204 /// [`std::print!`]: https://doc.rust-lang.org/std/macro.print.html 205 + /// [`std::format!`]: https://doc.rust-lang.org/std/macro.format.html 205 206 /// 206 207 /// # Examples 207 208 /// ··· 223 222 /// Equivalent to the kernel's [`pr_alert`] macro. 224 223 /// 225 224 /// Mimics the interface of [`std::print!`]. See [`core::fmt`] and 226 - /// `alloc::format!` for information about the formatting syntax. 225 + /// [`std::format!`] for information about the formatting syntax. 227 226 /// 228 227 /// [`pr_alert`]: https://docs.kernel.org/core-api/printk-basics.html#c.pr_alert 229 228 /// [`std::print!`]: https://doc.rust-lang.org/std/macro.print.html 229 + /// [`std::format!`]: https://doc.rust-lang.org/std/macro.format.html 230 230 /// 231 231 /// # Examples 232 232 /// ··· 248 246 /// Equivalent to the kernel's [`pr_crit`] macro. 249 247 /// 250 248 /// Mimics the interface of [`std::print!`]. See [`core::fmt`] and 251 - /// `alloc::format!` for information about the formatting syntax. 249 + /// [`std::format!`] for information about the formatting syntax. 252 250 /// 253 251 /// [`pr_crit`]: https://docs.kernel.org/core-api/printk-basics.html#c.pr_crit 254 252 /// [`std::print!`]: https://doc.rust-lang.org/std/macro.print.html 253 + /// [`std::format!`]: https://doc.rust-lang.org/std/macro.format.html 255 254 /// 256 255 /// # Examples 257 256 /// ··· 273 270 /// Equivalent to the kernel's [`pr_err`] macro. 274 271 /// 275 272 /// Mimics the interface of [`std::print!`]. See [`core::fmt`] and 276 - /// `alloc::format!` for information about the formatting syntax. 273 + /// [`std::format!`] for information about the formatting syntax. 277 274 /// 278 275 /// [`pr_err`]: https://docs.kernel.org/core-api/printk-basics.html#c.pr_err 279 276 /// [`std::print!`]: https://doc.rust-lang.org/std/macro.print.html 277 + /// [`std::format!`]: https://doc.rust-lang.org/std/macro.format.html 280 278 /// 281 279 /// # Examples 282 280 /// ··· 298 294 /// Equivalent to the kernel's [`pr_warn`] macro. 299 295 /// 300 296 /// Mimics the interface of [`std::print!`]. See [`core::fmt`] and 301 - /// `alloc::format!` for information about the formatting syntax. 297 + /// [`std::format!`] for information about the formatting syntax. 302 298 /// 303 299 /// [`pr_warn`]: https://docs.kernel.org/core-api/printk-basics.html#c.pr_warn 304 300 /// [`std::print!`]: https://doc.rust-lang.org/std/macro.print.html 301 + /// [`std::format!`]: https://doc.rust-lang.org/std/macro.format.html 305 302 /// 306 303 /// # Examples 307 304 /// ··· 323 318 /// Equivalent to the kernel's [`pr_notice`] macro. 324 319 /// 325 320 /// Mimics the interface of [`std::print!`]. See [`core::fmt`] and 326 - /// `alloc::format!` for information about the formatting syntax. 321 + /// [`std::format!`] for information about the formatting syntax. 327 322 /// 328 323 /// [`pr_notice`]: https://docs.kernel.org/core-api/printk-basics.html#c.pr_notice 329 324 /// [`std::print!`]: https://doc.rust-lang.org/std/macro.print.html 325 + /// [`std::format!`]: https://doc.rust-lang.org/std/macro.format.html 330 326 /// 331 327 /// # Examples 332 328 /// ··· 348 342 /// Equivalent to the kernel's [`pr_info`] macro. 349 343 /// 350 344 /// Mimics the interface of [`std::print!`]. See [`core::fmt`] and 351 - /// `alloc::format!` for information about the formatting syntax. 345 + /// [`std::format!`] for information about the formatting syntax. 352 346 /// 353 347 /// [`pr_info`]: https://docs.kernel.org/core-api/printk-basics.html#c.pr_info 354 348 /// [`std::print!`]: https://doc.rust-lang.org/std/macro.print.html 349 + /// [`std::format!`]: https://doc.rust-lang.org/std/macro.format.html 355 350 /// 356 351 /// # Examples 357 352 /// ··· 375 368 /// yet. 376 369 /// 377 370 /// Mimics the interface of [`std::print!`]. See [`core::fmt`] and 378 - /// `alloc::format!` for information about the formatting syntax. 371 + /// [`std::format!`] for information about the formatting syntax. 379 372 /// 380 373 /// [`pr_debug`]: https://docs.kernel.org/core-api/printk-basics.html#c.pr_debug 381 374 /// [`std::print!`]: https://doc.rust-lang.org/std/macro.print.html 375 + /// [`std::format!`]: https://doc.rust-lang.org/std/macro.format.html 382 376 /// 383 377 /// # Examples 384 378 /// ··· 403 395 /// Equivalent to the kernel's [`pr_cont`] macro. 404 396 /// 405 397 /// Mimics the interface of [`std::print!`]. See [`core::fmt`] and 406 - /// `alloc::format!` for information about the formatting syntax. 398 + /// [`std::format!`] for information about the formatting syntax. 407 399 /// 408 400 /// [`pr_info!`]: crate::pr_info! 409 401 /// [`pr_cont`]: https://docs.kernel.org/core-api/printk-basics.html#c.pr_cont 410 402 /// [`std::print!`]: https://doc.rust-lang.org/std/macro.print.html 403 + /// [`std::format!`]: https://doc.rust-lang.org/std/macro.format.html 411 404 /// 412 405 /// # Examples 413 406 ///