All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: Jacob Bai <jacob.bai.au@gmail.com>
Cc: gregkh@linuxfoundation.org, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 1/2] staging: rtl8192e: rename tables in r8192e_hwimg.c
Date: Thu, 10 Nov 2022 14:24:03 +0300	[thread overview]
Message-ID: <Y2zfU+Cw0/odYATm@kadam> (raw)
In-Reply-To: <01eb4d9cb22be5f76aa39eedd406577cdfd9f486.1668075486.git.jacob.bai.au@gmail.com>

Look at how these defines are used.  Take RTL8192E_PHY_REG_ARRAY_LEN
as an example.

On Thu, Nov 10, 2022 at 09:35:10PM +1100, Jacob Bai wrote:
> +u32 RTL8192E_PHY_REG_ARRAY[RTL8192E_PHY_REG_ARRAY_LEN] = {0x0,};
> +#define RTL8192E_PHY_REG_ARRAY_LEN 1
> +extern u32 RTL8192E_PHY_REG_ARRAY[RTL8192E_PHY_REG_ARRAY_LEN];
> +#define PHY_REGArrayLength			RTL8192E_PHY_REG_ARRAY_LEN

It's only used to create the PHY_REGArrayLength define.  Layers upon
layers of indirection.  Get rid of the RTL8192E_PHY_REG_ARRAY_LEN
completely just do:

#define PHY_REGArrayLength 1

Except get rid of that as well and use ARRAY_SIZE().

What I'm saying is don't send a v6 of this patch.  Just step back and
try to figure out how to get rid of all this code instead of renaming
the variable.s

regars,
dan carpenter


  reply	other threads:[~2022-11-10 11:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-10 10:35 [PATCH v5 0/2] staging: rtl8192e: trivial code cleanup patches Jacob Bai
2022-11-10 10:35 ` [PATCH v5 1/2] staging: rtl8192e: rename tables in r8192e_hwimg.c Jacob Bai
2022-11-10 11:24   ` Dan Carpenter [this message]
2022-11-10 10:35 ` [PATCH v5 2/2] staging: rtl8192e: replace macro defines with variables Jacob Bai
2022-11-10 11:01   ` Dan Carpenter
2022-11-10 11:07   ` Dan Carpenter
2022-11-10 19:09   ` kernel test robot

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=Y2zfU+Cw0/odYATm@kadam \
    --to=error27@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jacob.bai.au@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.