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: <CAAFQd5Aw70jUdaNXwZzkf22u5-2bmmCNBO9FkpQLNPo_9nwSzQ@mail.gmail.com>
Date:   Fri, 18 May 2018 23:16:56 +0900
From:   Tomasz Figa <tfiga@...omium.org>
To:     Stanimir Varbanov <stanimir.varbanov@...aro.org>
Cc:     Mauro Carvalho Chehab <mchehab@...nel.org>,
        Hans Verkuil <hverkuil@...all.nl>,
        Linux Media Mailing List <linux-media@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        linux-arm-msm <linux-arm-msm@...r.kernel.org>,
        vgarodia@...eaurora.org
Subject: Re: [PATCH v2 04/29] venus: hfi_cmds: add set_properties for 4xx version

On Tue, May 15, 2018 at 5:13 PM Stanimir Varbanov <
stanimir.varbanov@...aro.org> wrote:

> Adds set_properties method to handle newer 4xx properties and
> fall-back to 3xx for the rest.

> Signed-off-by: Stanimir Varbanov <stanimir.varbanov@...aro.org>
> ---
>   drivers/media/platform/qcom/venus/hfi_cmds.c | 64
+++++++++++++++++++++++++++-
>   1 file changed, 63 insertions(+), 1 deletion(-)

> diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.c
b/drivers/media/platform/qcom/venus/hfi_cmds.c
> index 1cfeb7743041..6bd287154796 100644
> --- a/drivers/media/platform/qcom/venus/hfi_cmds.c
> +++ b/drivers/media/platform/qcom/venus/hfi_cmds.c

[snip]

> +       case HFI_PROPERTY_CONFIG_VENC_MAX_BITRATE:
> +               /* not implemented on Venus 4xx */

Shouldn't return -EINVAL here, similar to what
pkt_session_set_property_1x() does for unknown property?

> +               break;
> +       default:
> +               ret = pkt_session_set_property_3xx(pkt, cookie, ptype,
pdata);
> +               break;

nit: How about simply return pkt_session_set_property_3xx(pkt, cookie,
ptype, pdata); and removing the |ret| variable completely, since the return
below the switch can just return 0 all the time?

> +       }
> +
> +       return ret;
> +}
> +
>   int pkt_session_get_property(struct hfi_session_get_property_pkt *pkt,
>                               void *cookie, u32 ptype)
>   {
> @@ -1181,7 +1240,10 @@ int pkt_session_set_property(struct
hfi_session_set_property_pkt *pkt,
>          if (hfi_ver == HFI_VERSION_1XX)
>                  return pkt_session_set_property_1x(pkt, cookie, ptype,
pdata);

> -       return pkt_session_set_property_3xx(pkt, cookie, ptype, pdata);
> +       if (hfi_ver == HFI_VERSION_3XX)
> +               return pkt_session_set_property_3xx(pkt, cookie, ptype,
pdata);
> +
> +       return pkt_session_set_property_4xx(pkt, cookie, ptype, pdata);

nit: Since we're adding third variant, I'd consider using function pointers
here, but no strong opinion.

Best regards,
Tomasz

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ