Thread (1 message) 1 message, 1 author, 2015-01-26

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

From: Samuel Ortiz <hidden>
Date: 2015-01-26 01:11:00

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-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help