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: <1891546521.01736915882616.JavaMail.epsvc@epcpadp2new>
Date: Wed, 15 Jan 2025 09:32:46 +0530
From: "Alim Akhtar" <alim.akhtar@...sung.com>
To: "'Krzysztof Kozlowski'" <krzysztof.kozlowski@...aro.org>, "'Avri
	Altman'" <avri.altman@....com>, "'Bart Van Assche'" <bvanassche@....org>,
	"'James E.J. Bottomley'" <James.Bottomley@...senPartnership.com>, "'Martin
 K. Petersen'" <martin.petersen@...cle.com>, "'Peter Wang'"
	<peter.wang@...iatek.com>, "'Stanley	Jhu'" <chu.stanley@...il.com>,
	"'Matthias Brugger'" <matthias.bgg@...il.com>, "'AngeloGioacchino Del
	Regno'" <angelogioacchino.delregno@...labora.com>,
 <linux-scsi@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
 <linux-mediatek@...ts.infradead.org>, <linux-arm-kernel@...ts.infradead.org>
Cc: <cpgs@...sung.com>
Subject: RE: [PATCH] ufs: Use str_enable_disable-like helpers

Hello Krzysztof,

> -----Original Message-----
> From: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
> Sent: Wednesday, January 15, 2025 1:37 AM
> To: Alim Akhtar <alim.akhtar@...sung.com>; Avri Altman
> <avri.altman@....com>; Bart Van Assche <bvanassche@....org>; James
> E.J. Bottomley <James.Bottomley@...senPartnership.com>; Martin K.
> Petersen <martin.petersen@...cle.com>; Peter Wang
> <peter.wang@...iatek.com>; Stanley Jhu <chu.stanley@...il.com>;
> Matthias Brugger <matthias.bgg@...il.com>; AngeloGioacchino Del Regno
> <angelogioacchino.delregno@...labora.com>; linux-scsi@...r.kernel.org;
> linux-kernel@...r.kernel.org; linux-mediatek@...ts.infradead.org; linux-
> arm-kernel@...ts.infradead.org
> Cc: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
> Subject: [PATCH] ufs: Use str_enable_disable-like helpers
> 
> Replace ternary (condition ? "enable" : "disable") syntax with helpers
from
> string_choices.h because:
> 1. Simple function call with one argument is easier to read.  Ternary
>    operator has three arguments and with wrapping might lead to quite
>    long code.
> 2. Is slightly shorter thus also easier to read.
> 3. It brings uniformity in the text - same string.
> 4. Allows deduping by the linker, which results in a smaller binary
>    file.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
> ---
>  drivers/ufs/core/ufshcd.c       | 11 ++++++-----
>  drivers/ufs/host/ufs-mediatek.c |  7 +++----
>  2 files changed, 9 insertions(+), 9 deletions(-)
> 
Reviewed-by: Alim Akhtar <alim.akhtar@...sung.com>

On a side note, there are other host controller driver (e.g. exynos and
Qcomm) which also uses few conditional operators, But I didn't find a
matching helper in string_choices.h, so may be that can be taken separately
in future.


> diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index
> 27154a5dcb7b..5225d48a47f8 100644
> --- a/drivers/ufs/core/ufshcd.c
> +++ b/drivers/ufs/core/ufshcd.c
[Snip]
> --
> 2.43.0




Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ