From: Philipp Hortmann <philipp.g.hortmann@gmail.com>
To: "Dominik Karol Piątkowski"
<dominik.karol.piatkowski@protonmail.com>,
gregkh@linuxfoundation.org, tdavies@darkphysics.net,
dan.carpenter@linaro.org
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 3/6] staging: rtl8192e: rtllib_rx.c: Fix alignment to open parentheses
Date: Sat, 21 Sep 2024 15:51:41 +0200 [thread overview]
Message-ID: <3fc0202a-d0b7-479f-8528-fed30e0e458c@gmail.com> (raw)
In-Reply-To: <20240920193356.32156-4-dominik.karol.piatkowski@protonmail.com>
On 9/20/24 21:36, Dominik Karol Piątkowski wrote:
> This patch aligns the code to open parentheses to improve readability.
>
> Signed-off-by: Dominik Karol Piątkowski <dominik.karol.piatkowski@protonmail.com>
> ---
> drivers/staging/rtl8192e/rtllib_rx.c | 91 +++++++++++++---------------
> 1 file changed, 42 insertions(+), 49 deletions(-)
>
> diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c
> index 8fe224a83dd6..e58be8e07917 100644
> --- a/drivers/staging/rtl8192e/rtllib_rx.c
> +++ b/drivers/staging/rtl8192e/rtllib_rx.c
> @@ -409,12 +409,10 @@ static bool add_reorder_entry(struct rx_ts_record *ts,
>
> while (list->next != &ts->rx_pending_pkt_list) {
> if (SN_LESS(reorder_entry->seq_num, ((struct rx_reorder_entry *)
> - list_entry(list->next, struct rx_reorder_entry,
> - list))->seq_num))
> + list_entry(list->next, struct rx_reorder_entry, list))->seq_num))
> list = list->next;
> - else if (SN_EQUAL(reorder_entry->seq_num,
> - ((struct rx_reorder_entry *)list_entry(list->next,
> - struct rx_reorder_entry, list))->seq_num))
> + else if (SN_EQUAL(reorder_entry->seq_num, ((struct rx_reorder_entry *)
> + list_entry(list->next, struct rx_reorder_entry, list))->seq_num))
> return false;
Hi Domenik,
I hope to not stress you beyond limits.
Thanks for deviding the patch. I can apply it now to my repo.
First two patches are looking good.
I prefer to have a comma at the end of the line. This line does not
increase readablility to me.
((struct rx_reorder_entry *)
list_entry(list->next, struct rx_reorder_entry, list))->seq_num))
Sometimes it is better to change less.
The change does not perfectly fit to the description: There you say
...aligns the code to open parentheses... but you do not need to remove
line breaks or shorten code to achieve this.
Smaller patches lead to an earlier acceptance. This typically leads to
more confidence at the beginning for newbies. There is no question about
that you know what you are doing. But there are some corners where the
kernel is special.
Find more below.
> ...
> @@ -876,9 +874,9 @@ static int rtllib_rx_check_duplicate(struct rtllib_device *ieee,
> frag = WLAN_GET_SEQ_FRAG(sc);
>
> if (!ieee->ht_info->cur_rx_reorder_enable ||
> - !ieee->current_network.qos_data.active ||
> - !is_data_frame(skb->data) ||
> - is_legacy_data_frame(skb->data)) {
> + !ieee->current_network.qos_data.active ||
> + !is_data_frame(skb->data) ||
> + is_legacy_data_frame(skb->data)) {
> if (!ieee80211_is_beacon(hdr->frame_control)) {
> if (is_duplicate_packet(ieee, hdr))
> return -1;
> @@ -887,7 +885,7 @@ static int rtllib_rx_check_duplicate(struct rtllib_device *ieee,
> struct rx_ts_record *ts = NULL;
>
> if (rtllib_get_ts(ieee, (struct ts_common_info **)&ts, hdr->addr2,
> - (u8)frame_qos_tid((u8 *)(skb->data)), RX_DIR, true)) {
> + (u8)frame_qos_tid((u8 *)(skb->data)), RX_DIR, true)) {
I am understanding the logic behind this but I cannot really say that
this increases the readability. It increases the readability of the if
condition but I am losing readability of the overall code and it
increases the issue with the too long lines.
I have not looked into the remaining patches.
I need some support from another reviewer.
Your patches are working fine on hardware.
Bye Philipp
> if ((fc & (1 << 11)) && (frag == ts->rx_last_frag_num) &&
> (WLAN_GET_SEQ_SEQ(sc) == ts->rx_last_seq_num))
> return -1;
next prev parent reply other threads:[~2024-09-21 13:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-20 19:36 [PATCH v2 0/6] staging: rtl8192e: Fix alignment to open parentheses Dominik Karol Piątkowski
2024-09-20 19:36 ` [PATCH v2 1/6] staging: rtl8192e: r8190P_rtl8256.c: " Dominik Karol Piątkowski
2024-09-20 19:36 ` [PATCH v2 2/6] staging: rtl8192e: rtl_ps.c: " Dominik Karol Piątkowski
2024-09-20 19:36 ` [PATCH v2 3/6] staging: rtl8192e: rtllib_rx.c: " Dominik Karol Piątkowski
2024-09-21 13:51 ` Philipp Hortmann [this message]
2024-09-21 14:59 ` Dominik Karol Piątkowski
2024-09-20 19:36 ` [PATCH v2 4/6] staging: rtl8192e: rtllib_softmac.c: " Dominik Karol Piątkowski
2024-09-20 19:36 ` [PATCH v2 5/6] staging: rtl8192e: rtllib_softmac_wx.c: " Dominik Karol Piątkowski
2024-09-20 19:36 ` [PATCH v2 6/6] staging: rtl8192e: rtllib_wx.c: " Dominik Karol Piątkowski
2024-10-09 9:53 ` [PATCH v2 0/6] staging: rtl8192e: " Greg KH
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=3fc0202a-d0b7-479f-8528-fed30e0e458c@gmail.com \
--to=philipp.g.hortmann@gmail.com \
--cc=dan.carpenter@linaro.org \
--cc=dominik.karol.piatkowski@protonmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=tdavies@darkphysics.net \
/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