mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'Phillip Potter' <phil@philpotter.co.uk>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>
Cc: "dan.carpenter@oracle.com" <dan.carpenter@oracle.com>,
	"Larry.Finger@lwfinger.net" <Larry.Finger@lwfinger.net>,
	"straube.linux@gmail.com" <straube.linux@gmail.com>,
	"martin@kaiser.cx" <martin@kaiser.cx>,
	"linux-staging@lists.linux.dev" <linux-staging@lists.linux.dev>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"paskripkin@gmail.com" <paskripkin@gmail.com>
Subject: RE: [PATCH v2 15/15] staging: r8188eu: correct long line warnings near prior DBG_88E calls
Date: Wed, 16 Feb 2022 10:01:18 +0000	[thread overview]
Message-ID: <84f4a761263444c2940165dc403afb33@AcuMS.aculab.com> (raw)
In-Reply-To: <20220216010709.791-16-phil@philpotter.co.uk>

From: Phillip Potter
> Sent: 16 February 2022 01:07
> 
> Where it is possible (without out-of-patch-series-scope large scale
> refactoring), correct code to remove checkpatch warnings about lines
> that are too long, also correcting operator spacing where appropriate
> for these lines as well. These warnings occur mostly due to so many
> DBG_88E removals and parentheses tweaks etc. being adjacent to such
> long lines, which are therefore included in the resultant diff.
...

Somewhere my copy of this seems to have got its tabs deleted.
I blame outlook :-)

> diff --git a/drivers/staging/r8188eu/core/rtw_br_ext.c b/drivers/staging/r8188eu/core/rtw_br_ext.c
> index ddc3a2c8aaca..d68611ef22f8 100644
> --- a/drivers/staging/r8188eu/core/rtw_br_ext.c
> +++ b/drivers/staging/r8188eu/core/rtw_br_ext.c
> @@ -382,7 +382,7 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
>  if (protocol == ETH_P_IP) {
>  struct iphdr *iph = (struct iphdr *)(skb->data + ETH_HLEN);
> 
> -if (((unsigned char *)(iph) + (iph->ihl<<2)) >= (skb->data + ETH_HLEN + skb->len))
> +if (((unsigned char *)(iph) + (iph->ihl << 2)) >= (skb->data + ETH_HLEN + skb->len))

You can delete at least three sets of () from that line.

>  return -1;
> 
>  switch (method) {
> @@ -451,7 +451,11 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
>  pOldTag = (struct pppoe_tag *)__nat25_find_pppoe_tag(ph, ntohs(PTT_RELAY_SID));
>  if (pOldTag) { /*  if SID existed, copy old value and delete it */
>  old_tag_len = ntohs(pOldTag->tag_len);
> -if (old_tag_len+TAG_HDR_LEN+MAGIC_CODE_LEN+RTL_RELAY_TAG_LEN > sizeof(tag_buf))
> +if (old_tag_len +
> +    TAG_HDR_LEN +
> +    MAGIC_CODE_LEN +
> +    RTL_RELAY_TAG_LEN >
> +    sizeof(tag_buf))
>  return -1;

That change really doesn't help readability at all.
There isn't much point shortening it that much like that, especially
since the here is a line that is nearly as long just above.

The real fix is to reduce the number of levels of indentation
to something sane.
I suspect that use of continue, break and return will help.

The other line length changes have much the same problem
but not as sever.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)


  reply	other threads:[~2022-02-16 10:01 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-16  1:06 [PATCH v2 00/15] staging: r8188eu: Cleanup and removal of DBG_88E macro Phillip Potter
2022-02-16  1:06 ` [PATCH v2 01/15] staging: r8188eu: remove previously converted DBG_88E_LEVEL calls Phillip Potter
2022-02-16  1:06 ` [PATCH v2 02/15] staging: r8188eu: remove smaller sets of converted DBG_88E calls Phillip Potter
2022-02-16  9:42   ` Pavel Skripkin
2022-02-17 14:29     ` Dan Carpenter
2022-02-17 14:36     ` Dan Carpenter
2022-02-16  1:06 ` [PATCH v2 03/15] staging: r8188eu: remove converted DBG_88E calls from core/rtw_mlme_ext.c Phillip Potter
2022-02-16  9:50   ` Pavel Skripkin
2022-02-16  1:06 ` [PATCH v2 04/15] staging: r8188eu: remove DBG_88E calls from core subdir Phillip Potter
2022-02-16  1:06 ` [PATCH v2 05/15] staging: r8188eu: remove DBG_88E calls from hal subdir Phillip Potter
2022-02-16 21:35   ` kernel test robot
2022-02-16  1:07 ` [PATCH v2 06/15] staging: r8188eu: remove DBG_88E calls from os_dep/ioctl_linux.c Phillip Potter
2022-02-16  1:07 ` [PATCH v2 07/15] staging: r8188eu: remove remaining DBG_88E calls from os_dep subdir Phillip Potter
2022-02-16  1:07 ` [PATCH v2 08/15] staging: r8188eu: remove remaining DBG_88E call from include/usb_ops.h Phillip Potter
2022-02-16  1:07 ` [PATCH v2 09/15] staging: r8188eu: remove all aliased DBG_88E calls Phillip Potter
2022-02-16  1:07 ` [PATCH v2 10/15] staging: r8188eu: remove DBG_88E macro definition Phillip Potter
2022-02-16  1:07 ` [PATCH v2 11/15] staging: r8188eu: remove rtw_debug module parameter Phillip Potter
2022-02-16  1:07 ` [PATCH v2 12/15] staging: r8188eu: fix lines modified by DBG_88E cleanup Phillip Potter
2022-02-16  1:07 ` [PATCH v2 13/15] staging: r8188eu: remove rtw_sctx_chk_waring_status function Phillip Potter
2022-02-16  1:07 ` [PATCH v2 14/15] staging: r8188eu: remove padapter param from aes_decipher function Phillip Potter
2022-02-16  1:07 ` [PATCH v2 15/15] staging: r8188eu: correct long line warnings near prior DBG_88E calls Phillip Potter
2022-02-16 10:01   ` David Laight [this message]
2022-02-16 23:45     ` Phillip Potter

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=84f4a761263444c2940165dc403afb33@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=dan.carpenter@oracle.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=martin@kaiser.cx \
    --cc=paskripkin@gmail.com \
    --cc=phil@philpotter.co.uk \
    --cc=straube.linux@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

all inboxes | Powered by JetHome®