Re: [PATCH bpf-next 4/5] libbpf: streamline error reporting for high-level APIs

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

 



On Fri, May 21, 2021 at 04:42:58PM -0700, Andrii Nakryiko wrote:
>  
> +/* this goes away in libbpf 1.0 */
> +enum libbpf_strict_mode libbpf_mode = LIBBPF_STRICT_NONE;
> +
> +int libbpf_set_strict_mode(enum libbpf_strict_mode mode)
> +{
> +	/* __LIBBPF_STRICT_LAST is the last power-of-2 value used + 1, so to
> +	 * get all possible values we compensate last +1, and then (2*x - 1)
> +	 * to get the bit mask
> +	 */
> +	if (mode != LIBBPF_STRICT_ALL
> +	    && mode & ~((__LIBBPF_STRICT_LAST - 1) * 2 - 1))
> +		return libbpf_err(-EINVAL);
> +
> +	libbpf_mode = mode;
> +	return 0;
> +}

This hunk should be in patch 1, right?
Otherwise bisection will be broken.



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux