From: Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: gregkh@linuxfoundation.org, realwakka@gmail.com,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: pi433: remove need to recompile code to debug fifo content
Date: Tue, 8 Feb 2022 16:56:58 +1300 [thread overview]
Message-ID: <YgHqCpet2TMQAz9L@mail.google.com> (raw)
In-Reply-To: <20220207100601.GF1951@kadam>
On Mon, Feb 07, 2022 at 01:06:01PM +0300, Dan Carpenter wrote:
> > #2
> > In the past, it's been pointed out to me during code review that I tend
> > to add code comments which could be omitted. In this case, the for-loop
> > seemed a bit odd without explaining why it's in there. Let me know if
> > you think I should keep/remove it.
>
> Remove. Everyone knows what dev_dbg() does and the "read from fifo"
> vs "written from[sic] fifo" is built into the function name.
>
fair enough
> > int rf69_read_fifo(struct spi_device *spi, u8 *buffer, unsigned int size)
> > {
> > -#ifdef DEBUG_FIFO_ACCESS
> > int i;
> > -#endif
> > struct spi_transfer transfer;
> > u8 local_buffer[FIFO_SIZE + 1];
>
> You did not introduce this but we are potentially printing out
> uninitialized data if spi_sync_transfer() fails. Please initialize this
> with:
>
> u8 local_buffer[FIFO_SIZE + 1] = {};
>
> Do that in a separate patch, though.
>
good point, will do. Thanks a lot :)
thanks,
Paulo Almeida
prev parent reply other threads:[~2022-02-08 3:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-07 4:45 [PATCH] staging: pi433: remove need to recompile code to debug fifo content Paulo Miguel Almeida
2022-02-07 10:06 ` Dan Carpenter
2022-02-07 10:15 ` Joe Perches
2022-02-08 3:54 ` Paulo Miguel Almeida
2022-02-08 3:56 ` Paulo Miguel Almeida [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YgHqCpet2TMQAz9L@mail.google.com \
--to=paulo.miguel.almeida.rodenas@gmail.com \
--cc=dan.carpenter@oracle.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=realwakka@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).