summaryrefslogtreecommitdiffstats
path: root/drivers/nfc
diff options
context:
space:
mode:
authorMao Wenan <maowenan@huawei.com>2019-12-09 14:08:45 +0100
committerDavid S. Miller <davem@davemloft.net>2019-12-09 23:27:26 +0100
commit718eae277e62a26e5862eb72a830b5e0fe37b04a (patch)
tree4de9e0afed2d139bec3f80425c1f8aa057227433 /drivers/nfc
parentMerge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/... (diff)
downloadlinux-718eae277e62a26e5862eb72a830b5e0fe37b04a.tar.xz
linux-718eae277e62a26e5862eb72a830b5e0fe37b04a.zip
NFC: port100: Convert cpu_to_le16(le16_to_cpu(E1) + E2) to use le16_add_cpu().
Convert cpu_to_le16(le16_to_cpu(frame->datalen) + len) to use le16_add_cpu(), which is more concise and does the same thing. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Mao Wenan <maowenan@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/nfc')
-rw-r--r--drivers/nfc/port100.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nfc/port100.c b/drivers/nfc/port100.c
index 604dba4f18af..8e4d355dc3ae 100644
--- a/drivers/nfc/port100.c
+++ b/drivers/nfc/port100.c
@@ -565,7 +565,7 @@ static void port100_tx_update_payload_len(void *_frame, int len)
{
struct port100_frame *frame = _frame;
- frame->datalen = cpu_to_le16(le16_to_cpu(frame->datalen) + len);
+ le16_add_cpu(&frame->datalen, len);
}
static bool port100_rx_frame_is_valid(void *_frame)