[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YsgjOPUDDtD48tMO@kroah.com>
Date: Fri, 8 Jul 2022 14:29:44 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Philipp Hortmann <philipp.g.hortmann@...il.com>
Cc: Forest Bond <forest@...ttletooquiet.net>,
Joe Perches <joe@...ches.com>, linux-staging@...ts.linux.dev,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] staging: vt6655: Use loop in
vt6655_mac_write_bssid_addr
On Wed, Jul 06, 2022 at 09:19:01PM +0200, Philipp Hortmann wrote:
> Use loop in vt6655_mac_write_bssid_addr to avoid multiple
> similar statements.
>
> Signed-off-by: Philipp Hortmann <philipp.g.hortmann@...il.com>
> ---
> Code for testing:
> for (int i = 0; i < 6; i++){
> iowrite8(mac_addr[i], iobase + MAC_REG_BSSID0 + i);
> printk("i = %i\n", i);
> }
>
> Log:
> [ 2592.189081] i = 0
> [ 2592.189083] i = 1
> [ 2592.189083] i = 2
> [ 2592.189084] i = 3
> [ 2592.189084] i = 4
> [ 2592.189085] i = 5
> ---
> drivers/staging/vt6655/device_main.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c
> index 298963cbca1d..099f0b95417a 100644
> --- a/drivers/staging/vt6655/device_main.c
> +++ b/drivers/staging/vt6655/device_main.c
> @@ -192,12 +192,8 @@ device_set_options(struct vnt_private *priv)
> static void vt6655_mac_write_bssid_addr(void __iomem *iobase, const u8 *mac_addr)
> {
> iowrite8(1, iobase + MAC_REG_PAGE1SEL);
> - iowrite8(mac_addr[0], iobase + MAC_REG_BSSID0);
> - iowrite8(mac_addr[1], iobase + MAC_REG_BSSID0 + 1);
> - iowrite8(mac_addr[2], iobase + MAC_REG_BSSID0 + 2);
> - iowrite8(mac_addr[3], iobase + MAC_REG_BSSID0 + 3);
> - iowrite8(mac_addr[4], iobase + MAC_REG_BSSID0 + 4);
> - iowrite8(mac_addr[5], iobase + MAC_REG_BSSID0 + 5);
> + for (int i = 0; i < 6; i++)
Taking advantage of the new compiler level I see, nice :)
Powered by blists - more mailing lists