Re: [PATCH 6/6] staging: ks7010: Factor out repeated request initialization code.

From: Greg KH
Date: Thu Mar 22 2018 - 13:20:55 EST


On Mon, Mar 19, 2018 at 10:58:15PM -0700, Quytelda Kahja wrote:
> The code to initialize various different types of request structs
> is repeated multiple times. Factor this code out into a macro
> called INIT_REQUEST.
>
> Signed-off-by: Quytelda Kahja <quytelda@xxxxxxxxxxx>
> ---
> drivers/staging/ks7010/ks_hostif.c | 55 +++++++++++---------------------------
> 1 file changed, 16 insertions(+), 39 deletions(-)
>
> diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c
> index 6fc2c3647908..3e5016aad029 100644
> --- a/drivers/staging/ks7010/ks_hostif.c
> +++ b/drivers/staging/ks7010/ks_hostif.c
> @@ -40,6 +40,17 @@ static inline unsigned int cnt_smeqbody(struct ks_wlan_private *priv)
>
> #define KS_WLAN_MEM_FLAG (GFP_ATOMIC)
>
> +#define INIT_REQUEST(pp, priv)

Ick, please make it a function if you really want to do something like
this.

thanks,

greg k-h