lkml.org 
[lkml]   [2023]   [Jul]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [RFC PATCH v9 07/10] ice: add admin commands to access cgu configuration
Date
>From: Linus Walleij <linus.walleij@linaro.org>
>Sent: Thursday, July 27, 2023 11:17 PM
>
>Hi Arkadiusz,
>
>On Fri, Jun 23, 2023 at 2:45 PM Arkadiusz Kubalewski
><arkadiusz.kubalewski@intel.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?
>

Hi Linus,

First of all, sorry for late answer.
Well, Yes it seems I can :)
Thank you for pointing this out!
Arkadiusz

>Yours,
>Linus Walleij
\
 
 \ /
  Last update: 2023-07-28 11:56    [W:0.087 / U:1.600 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site