Re: [PATCH] s390/zcrypt: remove set_fs() invocation in zcrypt device driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Sep 10, 2020 at 12:28:38PM +0200, Harald Freudenberger wrote:
> +static inline unsigned long z_copy_from_user(bool userspace,
> +					     void *to, const void __user *from, unsigned long n)

Can you avoid the pointless long lines in the function declaration?

> +{
> +	if (likely(userspace))
> +		return copy_from_user(to, from, n);
> +	memcpy(to, (void __force *) from, n);
> +	return 0;
> +}
> +
> +static inline unsigned long z_copy_to_user(bool userspace,
> +					   void __user *to, const void *from, unsigned long n)
> +{
> +	if (likely(userspace))
> +		return copy_to_user(to, from, n);
> +	memcpy((void __force *) to, from, n);
> +	return 0;

Otherwise this doesn't look great, but also not horrible and gets rid
of the set_fs while reducing the lines of code, so:

Reviewed-by: Christoph Hellwig <hch@xxxxxx>



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux