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]
Date:   Tue, 22 May 2018 07:31:23 +0900
From:   Takashi Sakamoto <o-takashi@...amocchi.jp>
To:     Yisheng Xie <xieyisheng1@...wei.com>, linux-kernel@...r.kernel.org
Cc:     alsa-devel@...a-project.org, Clemens Ladisch <clemens@...isch.de>,
        Takashi Iwai <tiwai@...e.com>
Subject: Re: [PATCH 28/33] ALSA: dice use match_string() helper

Hi,

On May 21 2018 20:58, Yisheng Xie wrote:
> match_string() returns the index of an array for a matching string,
> which can be used intead of open coded variant.
> 
> Cc: Clemens Ladisch <clemens@...isch.de>
> Cc: Jaroslav Kysela <perex@...ex.cz>
> Cc: Takashi Iwai <tiwai@...e.com>
> Cc: Takashi Sakamoto <o-takashi@...amocchi.jp>
> Cc: alsa-devel@...a-project.org
> Signed-off-by: Yisheng Xie <xieyisheng1@...wei.com>
> ---
>   sound/firewire/dice/dice.c | 8 +-------
>   1 file changed, 1 insertion(+), 7 deletions(-)

I'm welcome to this change, while in the latest subsystem tree for v4.18
the 'force_to_pcm_support()' local function was removed by my patch[1].
Your patch can be abandon.

> diff --git a/sound/firewire/dice/dice.c b/sound/firewire/dice/dice.c
> index 96bb01b..0639074 100644
> --- a/sound/firewire/dice/dice.c
> +++ b/sound/firewire/dice/dice.c
> @@ -35,19 +35,13 @@ static bool force_two_pcm_support(struct fw_unit *unit)
>   		"SAFFIRE_PRO_40_1",
>   	};
>   	char model[32];
> -	unsigned int i;
>   	int err;
>   
>   	err = fw_csr_string(unit->directory, CSR_MODEL, model, sizeof(model));
>   	if (err < 0)
>   		return false;
>   
> -	for (i = 0; i < ARRAY_SIZE(models); i++) {
> -		if (strcmp(models[i], model) == 0)
> -			break;
> -	}
> -
> -	return i < ARRAY_SIZE(models);
> +	return match_string(models, ARRAY_SIZE(models), model) >= 0;
>   }
>   
>   static int check_dice_category(struct fw_unit *unit)

[1] ALSA: dice: remove local frag of force_two_pcms
https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git/commit/?h=for-next&id=9c367c01d3d5


Thanks

Takashi Sakamoto

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ