Subject: Re: [PATCH iwl-next v2 01/13] ice: add parser create and destroy skeleton

From: Simon Horman <[email-masked]>
Date: Fri, 31 May 2024 14:11:39 +0100

On Mon, May 27, 2024 at 12:57:58PM -0600, Ahmed Zaki wrote:
> From: Junfeng Guo <[email-masked]>
> 
> Add new parser module which can parse a packet in binary and generate
> information like ptype, protocol/offset pairs and flags which can be later
> used to feed the FXP profile creation directly.
> 
> Add skeleton of the create and destroy APIs:
> ice_parser_create()
> ice_parser_destroy()
> 
> Reviewed-by: Marcin Szycik <[email-masked]>
> Reviewed-by: Wojciech Drewek <[email-masked]>
> Signed-off-by: Qi Zhang <[email-masked]>
> Signed-off-by: Junfeng Guo <[email-masked]>
> Co-developed-by: Ahmed Zaki <[email-masked]>
> Signed-off-by: Ahmed Zaki <[email-masked]>

...

> diff --git a/drivers/net/ethernet/intel/ice/ice_parser.c b/drivers/net/ethernet/intel/ice/ice_parser.c
> new file mode 100644
> index 000000000000..b7865b6a0a9b
> --- /dev/null
> +++ b/drivers/net/ethernet/intel/ice/ice_parser.c
> @@ -0,0 +1,31 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/* Copyright (C) 2024 Intel Corporation */
> +
> +#include "ice_common.h"
> +
> +/**
> + * ice_parser_create - create a parser instance
> + * @hw: pointer to the hardware structure
> + *
> + * Return a pointer to the allocated parser instance

Hi Ahmed,

A minor nit from my side.

I think that in order to keep ./scripts/kernel-doc -none -Wall happy
this should be:

 * Return: pointer to the allocated parser instance

And perhaps it would be best to mention the error case too

 * Return: pointer to the allocated parser instance, or an error pointer

> + */
> +struct ice_parser *ice_parser_create(struct ice_hw *hw)
> +{
> +	struct ice_parser *p;
> +
> +	p = kzalloc(sizeof(*p), GFP_KERNEL);
> +	if (!p)
> +		return ERR_PTR(-ENOMEM);
> +
> +	p->hw = hw;
> +	return p;
> +}

...