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: <87edjr8sw8.wl-tiwai@suse.de>
Date:   Fri, 25 Aug 2023 09:48:07 +0200
From:   Takashi Iwai <tiwai@...e.de>
To:     Sui Jingfeng <sui.jingfeng@...ux.dev>
Cc:     Bjorn Helgaas <bhelgaas@...gle.com>, amd-gfx@...ts.freedesktop.org,
        dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
        nouveau@...ts.freedesktop.org, linux-pci@...r.kernel.org,
        alsa-devel@...a-project.org,
        Sui Jingfeng <suijingfeng@...ngson.cn>,
        Jaroslav Kysela <perex@...ex.cz>,
        Takashi Iwai <tiwai@...e.com>,
        Fred Oh <fred.oh@...ux.intel.com>,
        Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>,
        Kai Vehmanen <kai.vehmanen@...ux.intel.com>
Subject: Re: [PATCH 2/5] ALSA: hda/intel: Use pci_get_base_class() to reduce duplicated code

On Fri, 25 Aug 2023 08:27:11 +0200,
Sui Jingfeng wrote:
> 
> From: Sui Jingfeng <suijingfeng@...ngson.cn>
> 
> Should be no functional change
> 
> Cc: Jaroslav Kysela <perex@...ex.cz>
> Cc: Takashi Iwai <tiwai@...e.com>
> Cc: Fred Oh <fred.oh@...ux.intel.com>
> Cc: Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
> Cc: Kai Vehmanen <kai.vehmanen@...ux.intel.com>
> Cc: Bjorn Helgaas <bhelgaas@...gle.com>
> Signed-off-by: Sui Jingfeng <suijingfeng@...ngson.cn>
> ---
>  sound/pci/hda/hda_intel.c | 16 +++++-----------
>  1 file changed, 5 insertions(+), 11 deletions(-)
> 
> diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
> index a21b61ad08d1..811a149584f2 100644
> --- a/sound/pci/hda/hda_intel.c
> +++ b/sound/pci/hda/hda_intel.c
> @@ -1429,17 +1429,11 @@ static bool atpx_present(void)
>  	acpi_handle dhandle, atpx_handle;
>  	acpi_status status;
>  
> -	while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, pdev)) != NULL) {
> -		dhandle = ACPI_HANDLE(&pdev->dev);
> -		if (dhandle) {
> -			status = acpi_get_handle(dhandle, "ATPX", &atpx_handle);
> -			if (ACPI_SUCCESS(status)) {
> -				pci_dev_put(pdev);
> -				return true;
> -			}
> -		}
> -	}
> -	while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_OTHER << 8, pdev)) != NULL) {
> +	while ((pdev = pci_get_base_class(PCI_BASE_CLASS_DISPLAY, pdev))) {
> +		if ((pdev->class != PCI_CLASS_DISPLAY_VGA << 8) &&
> +		    (pdev->class != PCI_CLASS_DISPLAY_OTHER << 8))
> +			continue;
> +
>  		dhandle = ACPI_HANDLE(&pdev->dev);
>  		if (dhandle) {
>  			status = acpi_get_handle(dhandle, "ATPX", &atpx_handle);

Reviewed-by: Takashi Iwai <tiwai@...e.de>


thanks,

Takashi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ