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]
Message-ID: <ccf245b17d7140099ad89628635a04ef@AcuMS.aculab.com>
Date:   Thu, 11 May 2023 09:58:34 +0000
From:   David Laight <David.Laight@...LAB.COM>
To:     'Binbin Wu' <binbin.wu@...ux.intel.com>,
        Chao Gao <chao.gao@...el.com>
CC:     "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "seanjc@...gle.com" <seanjc@...gle.com>,
        "pbonzini@...hat.com" <pbonzini@...hat.com>,
        "kai.huang@...el.com" <kai.huang@...el.com>,
        "robert.hu@...ux.intel.com" <robert.hu@...ux.intel.com>
Subject: RE: [PATCH v8 1/6] KVM: x86: Consolidate flags for __linearize()

From: Binbin Wu
> Sent: 11 May 2023 02:26
...
> >> 	unsigned max_size;
> >> -	return __linearize(ctxt, addr, &max_size, size, write, false,
> >> +	u32 flags = 0;
> >> +
> >> +	if (write)
> >> +		flags |= X86EMUL_F_WRITE;
> > this can be more dense:
> >
> > 	u32 flags = write ? X86EMUL_F_WRITE : 0;
> Thanks, will update it.

You can also dispense with the extra local variable and
put the ?: into the parameter list.

Even more so with the other calls sites.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ