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: <171321520986.2333277.5902882675169324919@ping.linuxembedded.co.uk>
Date: Mon, 15 Apr 2024 22:06:49 +0100
From: Kieran Bingham <kieran.bingham+renesas@...asonboard.com>
To: Abylay Ospan <aospan@...up.ru>, Alain Volmat <alain.volmat@...s.st.com>, Alexandre Torgue <alexandre.torgue@...s.st.com>, AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>, Benjamin Mugnier <benjamin.mugnier@...s.st.com>, Bjorn Andersson <andersson@...nel.org>, Bryan O'Donoghue <bryan.odonoghue@...aro.org>, Chen-Yu Tsai <wens@...e.org>, Dmitry Osipenko <digetx@...il.com>, Ezequiel Garcia <ezequiel@...guardiasur.com.ar>, Greg Kroah-Hartman <gregkh@...uxfoundation.org>, Hans Verkuil <hverkuil-cisco@...all.nl>, Hans Verkuil <hverkuil@...all.nl>, Hugues Fruchet <hugues.fruchet@...s.st.com>, Jacopo Mondi <jacopo+renesas@...ndi.org>, Jernej Skrabec <jernej.skrabec@...il.com>, Jonathan Hunter <jonathanh@...dia.com>, Konrad Dybcio <konrad.dybcio@...aro.org>, Laurent Pinchart <laurent.pinchart+renesas@...asonboard.com>, Laurent Pinchart <laurent.pinchart@...asonboard.com>, Luca Ceresoli <luca.ceresoli@...tlin.com>, Martin Tuma <martin.tuma@...iteqautomotive.com>, Matthi
 as Brugger <matthias.bgg@...il.com>, Mauro Carvalho Chehab <mchehab@...nel.org>, Maxime Coquelin <mcoquelin.stm32@...il.com>, Niklas Söderlund <niklas.soderlund+renesas@...natech.se>, Paul Kocialkowski <paul.kocialkowski@...tlin.com>, Pavel Machek <pavel@....cz>, Ricardo Ribalda <ribalda@...omium.org>, Sakari Ailus <sakari.ailus@...ux.intel.com>, Samuel Holland <samuel@...lland.org>, Sergey Kozlov <serjk@...up.ru>, Sowjanya Komatineni <skomatineni@...dia.com>, Stanimir Varbanov <stanimir.k.varbanov@...il.com>, Sylvain Petinot <sylvain.petinot@...s.st.com>, Thierry Reding <thierry.reding@...il.com>, Vikash Garodia <quic_vgarodia@...cinc.com>
Cc: linux-media@...r.kernel.org, linux-kernel@...r.kernel.org, linux-stm32@...md-mailman.stormreply.com, linux-arm-kernel@...ts.infradead.org, linux-staging@...ts.linux.dev, linux-sunxi@...ts.linux.dev, linux-tegra@...r.kernel.org, linux-mediatek@...ts.infradead.org, linux-arm-msm@...r.kernel.org, Ricardo Ribalda <ribalda@...omium.org>
Subject: Re: [PATCH 04/35] media: uvcvideo: Use max() macro

Quoting Ricardo Ribalda (2024-04-15 20:34:21)
> It makes the code slightly more clear and makes cocci incredibly happy:
> 
> drivers/media/usb/uvc/uvc_ctrl.c:839:22-23: WARNING opportunity for max()
> 
> Signed-off-by: Ricardo Ribalda <ribalda@...omium.org>
> ---
>  drivers/media/usb/uvc/uvc_ctrl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c
> index a4a987913430..4b685f883e4d 100644
> --- a/drivers/media/usb/uvc/uvc_ctrl.c
> +++ b/drivers/media/usb/uvc/uvc_ctrl.c
> @@ -836,7 +836,7 @@ static s32 uvc_get_le_value(struct uvc_control_mapping *mapping,
>         while (1) {
>                 u8 byte = *data & mask;
>                 value |= offset > 0 ? (byte >> offset) : (byte << (-offset));
> -               bits -= 8 - (offset > 0 ? offset : 0);
> +               bits -= 8 - max(offset, 0);

This looks semantically the same to me so:


Reviewed-by: Kieran Bingham <kieran.bingham@...asonboard.com>

>                 if (bits <= 0)
>                         break;
>  
> 
> -- 
> 2.44.0.683.g7961c838ac-goog
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ