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: <CACRpkdar39x8nd5cWEDiFDHwLqHghUQZqkR0rEcv2-sZOZZ0KQ@mail.gmail.com>
Date: Thu, 27 Jul 2023 23:16:42 +0200
From: Linus Walleij <linus.walleij@...aro.org>
To: Arkadiusz Kubalewski <arkadiusz.kubalewski@...el.com>
Cc: kuba@...nel.org, jiri@...nulli.us, vadfed@...a.com, 
	jonathan.lemon@...il.com, pabeni@...hat.com, corbet@....net, 
	davem@...emloft.net, edumazet@...gle.com, vadfed@...com, 
	jesse.brandeburg@...el.com, anthony.l.nguyen@...el.com, saeedm@...dia.com, 
	leon@...nel.org, richardcochran@...il.com, sj@...nel.org, javierm@...hat.com, 
	ricardo.canuelo@...labora.com, mst@...hat.com, tzimmermann@...e.de, 
	michal.michalik@...el.com, gregkh@...uxfoundation.org, 
	jacek.lawrynowicz@...ux.intel.com, airlied@...hat.com, ogabbay@...nel.org, 
	arnd@...db.de, nipun.gupta@....com, axboe@...nel.dk, linux@...y.sk, 
	masahiroy@...nel.org, benjamin.tissoires@...hat.com, geert+renesas@...der.be, 
	milena.olech@...el.com, kuniyu@...zon.com, liuhangbin@...il.com, 
	hkallweit1@...il.com, andy.ren@...cruise.com, razor@...ckwall.org, 
	idosch@...dia.com, lucien.xin@...il.com, nicolas.dichtel@...nd.com, 
	phil@....cc, claudiajkang@...il.com, linux-doc@...r.kernel.org, 
	linux-kernel@...r.kernel.org, netdev@...r.kernel.org, 
	intel-wired-lan@...ts.osuosl.org, linux-rdma@...r.kernel.org, 
	linux-arm-kernel@...ts.infradead.org, poros@...hat.com, mschmidt@...hat.com, 
	linux-clk@...r.kernel.org, vadim.fedorenko@...ux.dev
Subject: Re: [RFC PATCH v9 07/10] ice: add admin commands to access cgu configuration

Hi Arkadiusz,

On Fri, Jun 23, 2023 at 2:45 PM Arkadiusz Kubalewski
<arkadiusz.kubalewski@...el.com> wrote:

> +/**
> + * convert_s48_to_s64 - convert 48 bit value to 64 bit value
> + * @signed_48: signed 64 bit variable storing signed 48 bit value
> + *
> + * Convert signed 48 bit value to its 64 bit representation.
> + *
> + * Return: signed 64 bit representation of signed 48 bit value.
> + */
> +static s64 convert_s48_to_s64(s64 signed_48)
> +{
> +       return signed_48 & BIT_ULL(47) ?
> +               GENMASK_ULL(63, 48) | signed_48 : signed_48;
> +}

Can't you just use sign_extend64() from <linux/bitops.h>
passing bit 48 as sign bit istead of inventing this?

Yours,
Linus Walleij

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ