lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 9 Mar 2022 21:58:03 -0700
From:   David Ahern <dsahern@...nel.org>
To:     Eli Cohen <elic@...dia.com>, stephen@...workplumber.org,
        netdev@...r.kernel.org, virtualization@...ts.linux-foundation.org,
        jasowang@...hat.com, si-wei.liu@...cle.com
Cc:     mst@...hat.com, lulu@...hat.com, parav@...dia.com
Subject: Re: [PATCH v5 2/4] vdpa: Allow for printing negotiated features of a
 device

On 3/9/22 9:46 AM, Eli Cohen wrote:
> +static void print_features(struct vdpa *vdpa, uint64_t features, bool mgmtdevf,
> +			   uint16_t dev_id)
> +{
> +	const char * const *feature_strs = NULL;
> +	const char *s;
> +	int i;
> +
> +	if (dev_id < ARRAY_SIZE(dev_to_feature_str))
> +		feature_strs = dev_to_feature_str[dev_id];
> +
> +	if (mgmtdevf)
> +		pr_out_array_start(vdpa, "dev_features");
> +	else
> +		pr_out_array_start(vdpa, "negotiated_features");
> +
> +	for (i = 0; i < 64; i++) {

make that 64 a macro so the magic number has a description. e.g.,

#define BITS_PER_U64 (sizeof(u64) * 8)




Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ