Re: [PATCH v2 06/10] rust: add `dev_*` print macros.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jun 19, 2024 at 01:39:52AM +0200, Danilo Krummrich wrote:
> From: Wedson Almeida Filho <wedsonaf@xxxxxxxxxx>
> 
> Implement `dev_*` print macros for `device::Device`.
> 
> They behave like the macros with the same names in C, i.e., they print
> messages to the kernel ring buffer with the given level, prefixing the
> messages with corresponding device information.

Nice, but one issue:

> +    /// Prints a debug-level message (level 7) prefixed with device information.
> +    ///
> +    /// More details are available from [`dev_dbg`].
> +    ///
> +    /// [`dev_dbg`]: crate::dev_dbg
> +    pub fn pr_dbg(&self, args: fmt::Arguments<'_>) {
> +        if cfg!(debug_assertions) {

That should not be an issue here.  debug_assertions is something
independent of dev_dbg() calls.  You made this a Rust-only thing, that
doesn't tie properly into the existing dynamic printk functionality by
having yet-another-way to turn this on/off, right?

So just remove the check please.

And if you want to send this as a single patch after fixing this, I'll
be glad to add it to the tree now, as it's "obviously" correct :)

thanks,

greg k-h




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux