Skip to content

Commit 0be1a06

Browse files
jhnikulaalexandrebelloni
authored andcommitted
i3c: mipi-i3c-hci: Do not overallocate transfers in hci_cmd_v1_daa()
Function hci_cmd_v1_daa() uses only single transfer at a time so no need to allocate two transfers and access can be simplified. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Link: https://lore.kernel.org/r/20231109133708.653950-3-jarkko.nikula@linux.intel.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
1 parent 9e0e9e8 commit 0be1a06

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/i3c/master/mipi-i3c-hci/cmd_v1.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ static int hci_cmd_v1_daa(struct i3c_hci *hci)
298298
unsigned int dcr, bcr;
299299
DECLARE_COMPLETION_ONSTACK(done);
300300

301-
xfer = hci_alloc_xfer(2);
301+
xfer = hci_alloc_xfer(1);
302302
if (!xfer)
303303
return -ENOMEM;
304304

@@ -339,12 +339,12 @@ static int hci_cmd_v1_daa(struct i3c_hci *hci)
339339
ret = -ETIME;
340340
break;
341341
}
342-
if (RESP_STATUS(xfer[0].response) == RESP_ERR_NACK &&
342+
if (RESP_STATUS(xfer->response) == RESP_ERR_NACK &&
343343
RESP_DATA_LENGTH(xfer->response) == 1) {
344344
ret = 0; /* no more devices to be assigned */
345345
break;
346346
}
347-
if (RESP_STATUS(xfer[0].response) != RESP_SUCCESS) {
347+
if (RESP_STATUS(xfer->response) != RESP_SUCCESS) {
348348
ret = -EIO;
349349
break;
350350
}

0 commit comments

Comments
 (0)