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] [day] [month] [year] [list]
Date:	Fri, 1 Aug 2014 05:33:52 -0700
From:	Christoph Hellwig <hch@...radead.org>
To:	Ching Huang <ching2048@...ca.com.tw>
Cc:	hch@...radead.org, jbottomley@...allels.com,
	dan.carpenter@...cle.com, thenzl@...hat.com, agordeev@...hat.com,
	linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1.3 6/18] arcmsr: precise checking adapter ID

> -static void arcmsr_define_adapter_type(struct AdapterControlBlock *acb)
> +static bool arcmsr_define_adapter_type(struct AdapterControlBlock *acb)
>  {
>  	struct pci_dev *pdev = acb->pdev;
>  	u16 dev_id;
> +
>  	pci_read_config_word(pdev, PCI_DEVICE_ID, &dev_id);
>  	acb->dev_id = dev_id;

This is already available through pdev->device.


>  		acb->adapter_type = ACB_ADAPTER_TYPE_C;

Just store the adapter type in the pci_device_id private data field,
that way you enumerate the type in the same place the ids are added
and you'll never miss adding them to a switch value.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ