linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Cc: Forest Bond <forest@alittletooquiet.net>,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] staging: vt6655: Convert macro vt6655_mac_clear_stck_ds to function
Date: Wed, 27 Jul 2022 08:47:24 +0200	[thread overview]
Message-ID: <YuDffHQmd3HOgX6K@kroah.com> (raw)
In-Reply-To: <11d4aaf99e1d508c3019327937c7a160050847c1.1658333350.git.philipp.g.hortmann@gmail.com>

On Wed, Jul 20, 2022 at 06:24:43PM +0200, Philipp Hortmann wrote:
> Convert once used macro to static function.
> Multiline macros are not liked by kernel community.
> 
> Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
> ---
>  drivers/staging/vt6655/mac.c | 11 +++++++++++
>  drivers/staging/vt6655/mac.h |  8 --------
>  2 files changed, 11 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/staging/vt6655/mac.c b/drivers/staging/vt6655/mac.c
> index d7ee42df7062..3e9494c653dc 100644
> --- a/drivers/staging/vt6655/mac.c
> +++ b/drivers/staging/vt6655/mac.c
> @@ -38,6 +38,8 @@
>  
>  #include "mac.h"
>  
> +static void vt6655_mac_clear_stck_ds(void __iomem *iobase);
> +
>  void vt6655_mac_reg_bits_on(void __iomem *iobase, const u8 reg_offset, const u8 bit_mask)
>  {
>  	unsigned char reg_value;
> @@ -70,6 +72,15 @@ void vt6655_mac_word_reg_bits_off(void __iomem *iobase, const u8 reg_offset, con
>  	iowrite16(reg_value & ~(bit_mask), iobase + reg_offset);
>  }
>  
> +static void vt6655_mac_clear_stck_ds(void __iomem *iobase)
> +{
> +	unsigned char reg_value;
> +
> +	reg_value = ioread8(iobase + MAC_REG_STICKHW);
> +	reg_value = reg_value & 0xFC;
> +	iowrite8(reg_value, iobase + MAC_REG_STICKHW);
> +}
> +

Why not move this function up above, to before you call it, and then you
do not need the function declaration in this file?

thanks,

greg k-h

      reply	other threads:[~2022-07-27  6:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-20 16:24 [PATCH 0/3] staging: vt6655: Convert multiline macro to static function Philipp Hortmann
2022-07-20 16:24 ` [PATCH 1/3] staging: vt6655: Rename byOrgValue to reg_value in a macro Philipp Hortmann
2022-07-27  6:47   ` Greg Kroah-Hartman
2022-07-27 15:54     ` Philipp Hortmann
2022-07-27 16:06       ` Greg Kroah-Hartman
2022-07-20 16:24 ` [PATCH 2/3] staging: vt6655: Rename MACvClearStckDS Philipp Hortmann
2022-07-27  6:48   ` Greg Kroah-Hartman
2022-07-20 16:24 ` [PATCH 3/3] staging: vt6655: Convert macro vt6655_mac_clear_stck_ds to function Philipp Hortmann
2022-07-27  6:47   ` Greg Kroah-Hartman [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=YuDffHQmd3HOgX6K@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=forest@alittletooquiet.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=philipp.g.hortmann@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;
as well as URLs for NNTP newsgroup(s).