lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 8 Feb 2023 08:33:57 -0800
From:   Boqun Feng <boqun.feng@...il.com>
To:     Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
Cc:     linux-kernel@...r.kernel.org, rust-for-linux@...r.kernel.org,
        Miguel Ojeda <ojeda@...nel.org>,
        Alex Gaynor <alex.gaynor@...il.com>,
        Wedson Almeida Filho <wedsonaf@...il.com>,
        Gary Guo <gary@...yguo.net>,
        Björn Roy Baron <bjorn3_gh@...tonmail.com>,
        Vincenzo Palazzo <vincenzopalazzodev@...il.com>,
        Will Deacon <will@...nel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Mark Rutland <mark.rutland@....com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Sergio González Collado 
        <sergio.collado@...il.com>, Finn Behrens <fin@...ntec.com>
Subject: Re: [PATCH v2 2/2] sample: rust: print: Add sampe code for Arc
 printing

On Wed, Feb 08, 2023 at 04:19:04PM +0100, Miguel Ojeda wrote:
> On Tue, Feb 7, 2023 at 7:52 PM Boqun Feng <boqun.feng@...il.com> wrote:
> >
> > +    // Uses `dbg` to print, will move `c`.
> > +    dbg!(c);
> 
> Perhaps:
> 
>     // Uses `dbg` to print, will move `c` (for temporary debugging purposes).
>     dbg!(c);
> 
> To make it clear it is not meant to be usually committed into the tree.
> 

Thanks!

> > +    // Prints debug fmt with pretty-print "#" and number-in-hex "x".
> > +    pr_info!("{:#x?}", a);
> 
> Apparently, `:#x?` is a bit of an accident: `#` means "alternate"
> form, but it turns out it applies to both `x` and `?`, i.e. it is not
> that `#` alone implies pretty-printing.
> 

Oh, good to know!

> Given the above and that there are improvements under discussion
> upstream, perhaps we could avoid giving details for the moment and
> just say what it does as a whole, e.g.
> 
>     // Pretty-prints the debug formatting with lower-case hexadecimal integers.
>     pr_info!("{:#x?}", a);
> 
> Some links for those interested:
> https://doc.rust-lang.org/std/fmt/index.html#sign0,
> https://github.com/rust-lang/rust/issues/75766,
> https://github.com/rust-lang/rust/pull/99138#issuecomment-1385331055
> and https://github.com/rust-lang/libs-team/issues/165.
> 
> Finally, there is a small typo in the commit title. What about:
> 
>     rust: samples: print: add sample code for `Arc` printing
> 

Hmm.. I'm OK with this change, but it's not a typo ;-)

I deliberately

1)	capitalize the first letter after subsystem tags in the title
	since that's kinda the rule for a few subsystems I usually work
	on, I don't have my own preference, just something I'm used to
	;-)

2)	avoid using "`" in the title to save space because title space
	is precious.

> I can change these bits on my side if you want & agree with them, to
> avoid a v3 just for this.
> 

That'll be great, thanks!

Regards,
Boqun

> Thanks for these patches, Boqun!
> 
> Cheers,
> Miguel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ