Re: [PATCH v1 06/34] NFC: hci: Add pipes table to reference them with a tuple {gate, host}

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Hi Christophe,

On Mon, Dec 08, 2014 at 10:08:11PM +0100, Christophe Ricard wrote:
>  struct nfc_hci_gate {
>  	u8 gate;
>  	u8 pipe;
> -};
> +} __packed;
Why does this one need to be packed ?


> +struct nfc_hci_pipe {
> +	u8 gate;
> +	u8 dest_host;
> +} __packed;
Ditto.

> +void nfc_hci_reset_pipes_per_host(struct nfc_hci_dev *hdev, u8 host)
> +{
> +	int i = 0;
> +
> +	for (i = 0; i < NFC_HCI_MAX_PIPES; i++) {
> +		if (hdev->pipes[i].dest_host == host) {
> +			hdev->pipes[i].gate = NFC_HCI_INVALID_GATE;
> +			hdev->pipes[i].dest_host = NFC_HCI_INVALID_HOST;
> +		}
Nitpick:

if (hdev->pipes[i].dest_host != host)
	continue;

hdev->pipes[i].gate = NFC_HCI_INVALID_GATE;
hdev->pipes[i].dest_host = NFC_HCI_INVALID_HOST;

is usually preferred.

Cheers,
Samuel.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux