[PATCH v1 2/6] staging: qlge: coredump via devlink health reporter

Dan Carpenter dan.carpenter at oracle.com
Thu Oct 8 13:39:40 UTC 2020


On Thu, Oct 08, 2020 at 07:58:04PM +0800, Coiby Xu wrote:
> -static int
> -qlge_reporter_coredump(struct devlink_health_reporter *reporter,
> -			struct devlink_fmsg *fmsg, void *priv_ctx,
> -			struct netlink_ext_ack *extack)
> +static int fill_seg_(struct devlink_fmsg *fmsg,
> +		    struct mpi_coredump_segment_header *seg_header,
> +		    u32 *reg_data)
>  {
> -	return 0;
> +	int i;
> +	int header_size = sizeof(struct mpi_coredump_segment_header);

Please use the sizeof() directly in the code.  Don't introduce
indirection if you can help it.

> +	int regs_num = (seg_header->seg_size - header_size) / sizeof(u32);
> +	int err;
> +

regards,
dan carpenter


More information about the devel mailing list