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]
Message-ID: <Yga7cDO00Hmk9+BL@mail.google.com>
Date:   Sat, 12 Feb 2022 08:39:28 +1300
From:   Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@...il.com>
To:     Greg KH <gregkh@...uxfoundation.org>
Cc:     realwakka@...il.com, linux-staging@...ts.linux.dev,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: pi433: add rf69_dbg_hex function

On Fri, Feb 11, 2022 at 09:14:40AM +0100, Greg KH wrote:
> 
> This is a lot of additional complexity for almost no real benefit.
> 

you're right. I will no longer pursue this approach. 

> > -	/* print content read from fifo for debugging purposes */
> > -	for (i = 0; i < size; i++)
> > -		dev_dbg(&spi->dev, "%d - 0x%x\n", i, local_buffer[i + 1]);
> 
> What is wrong with this simple line?
> 

to be honest, I think that 1 register per line isn't the easiest way to
read them. Given that print_hex_dump_debug existed and had this
horizontal-style priting format, I thought that it would be a better
way of visualizing the fifo data.

the only problems with print_hex_dump_debug was the absense of device
name and string format... so I saw a couple of drivers implementing
alternative hex_dump-like functions and thought that pi433 would benefit
from similar approach.

> > -	/* print content written from fifo for debugging purposes */
> > -	for (i = 0; i < size; i++)
> > -		dev_dbg(&spi->dev, "0x%x\n", buffer[i]);

if we are keeping this format, I may need to add the register idx to
dev_dbg: 
		dev_dbg(&spi->dev, "%d - 0x%x\n", i, buffer[i]);

> Again, the original is fine here, why make this so complex?

[thinking out loud/brainstorm]

I do agree that, for just a single driver, having a method like that
seemed unnecessary but do you think it would be a good idea having
something like dev_dbg_hex_dump or similar?

print_hex_dump_debug has the following limitation: 

1) lacks string format
2) doesn't honor dynamic debug flags (other then 'p')
3) doesn't print device driver name and device name

> > +	rf69_dbg_hex(spi, local_buffer + 1, size, "%s - ", __func__);
>
> Also, you are using local_buffer here, not buffer, why?
> 

That was a mistake, good catch.

> I think the original is just fine, no need to polish something as tiny
> as a hex dump for debugging only.
> 
> thanks,
> 
> greg k-h

thanks for taking the time to review the patch, I won't pursue this
approach anymore.

thanks,

Paulo Almeida

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ