Re: [RFC PATCH v8 15/21] riscv: Add vector extension XOR implementation

From: Christoph Hellwig
Date: Thu Sep 09 2021 - 02:13:12 EST


On Thu, Sep 09, 2021 at 01:45:27AM +0800, Greentime Hu wrote:
> +extern void xor_regs_2_(unsigned long bytes, unsigned long *p1,
> + unsigned long *p2);
> +extern void xor_regs_3_(unsigned long bytes, unsigned long *p1,
> + unsigned long *p2, unsigned long *p3);
> +extern void xor_regs_4_(unsigned long bytes, unsigned long *p1,
> + unsigned long *p2, unsigned long *p3,
> + unsigned long *p4);
> +extern void xor_regs_5_(unsigned long bytes, unsigned long *p1,
> + unsigned long *p2, unsigned long *p3, unsigned long *p4,
> + unsigned long *p5);

There is no need for externs on function declarations ever.

> +static void xor_rvv_2(unsigned long bytes, unsigned long *p1, unsigned long *p2)
> +{
> + kernel_rvv_begin();
> + xor_regs_2_(bytes, p1, p2);
> + kernel_rvv_end();
> +}

This looks strange. Why these wrappers?