From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
To: David Miller <davem@davemloft.net>
Cc: linux-usb@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: usb: hso: use swap macro in hso_kick_transmit
Date: Thu, 12 Jul 2018 14:27:13 -0500 [thread overview]
Message-ID: <1a4c8d58-f65d-1e26-c291-9b4de5345955@embeddedor.com> (raw)
In-Reply-To: <20180711.225821.1348569242901912298.davem@davemloft.net>
Hi David,
On 07/12/2018 12:58 AM, David Miller wrote:
> From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
> Date: Mon, 9 Jul 2018 10:40:48 -0500
>
>> @@ -1748,14 +1747,11 @@ static void hso_kick_transmit(struct hso_serial *serial)
>> goto out;
>>
>> /* Switch pointers around to avoid memcpy */
>> - temp = serial->tx_buffer;
>> - serial->tx_buffer = serial->tx_data;
>> - serial->tx_data = temp;
>> + swap(serial->tx_buffer, serial->tx_data);
>> serial->tx_data_count = serial->tx_buffer_count;
>> serial->tx_buffer_count = 0;
>>
>> - /* If temp is set, it means we switched buffers */
>> - if (temp && serial->write_data) {
>> + if (serial->write_data) {
>
> I think temp can be NULL here, you have to retain this check.
>
I see. Well, in that case I will check serial->tx_data instead.
Thanks for the feedback.
--
Gustavo
prev parent reply other threads:[~2018-07-12 19:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-09 15:40 Gustavo A. R. Silva
2018-07-12 5:58 ` David Miller
2018-07-12 19:27 ` Gustavo A. R. Silva [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=1a4c8d58-f65d-1e26-c291-9b4de5345955@embeddedor.com \
--to=gustavo@embeddedor.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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
all inboxes | Powered by JetHome®