Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp942770pxj; Fri, 21 May 2021 02:49:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUzy/HXorjl2a7kbYojd+OSY358O7I6+bWxLQPJnQd5ZL0MAIfKov0RZFIzLFK9ZN+T6pa X-Received: by 2002:a17:906:d1ce:: with SMTP id bs14mr9558004ejb.183.1621590577509; Fri, 21 May 2021 02:49:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621590577; cv=none; d=google.com; s=arc-20160816; b=yrF6a2ow7mTDfSGB81LR+s5SBRWe88Ioww3ihaYoT2XQ74otYO0cSbSe1miTWcsGLo UXAgRo2LS3yNOjfWxu6dNjgNbOMRhpMqxNoLA27uxwG5Ae3wM4qo64REjTHyVmPfVjEc 1sOBMnulxBHLLqAYtX6ZLYOPAPsfjhx9VgCLpuleUurU6fwohd2Qb8Z/+6h4vPCyGDxK jrTLVvLaGCX6IokybVNwYh4Mje/2z8oIQ1TRxWnkyFZrfvj9qozSitOEvUlAg6hdmW8c rcmyyeDx+7uS2GdGHmY9nRD+jz3FJ0ov33fdXBqKHkL4g9XXlgBBhB1ggSOelbqjLkQU T6og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=EyQD20AiPfWFpkCpG++MBQbegOGacKT6LFXQwZKaPyk=; b=jh2HS45mXRV+TvuTdwvDoxLlyBwOwsH7YlERuBvJLLIZbalxsHcWoUPEdCf7d32LY+ x6xryvaeFS8BIlGyLgtTztPdavEjEmcmRPwab6LfwKbZ/mT5PJDWO3Phhlad5H/qlStP PUa9Y8Uoq3gX+J+h5CwiC2oLdOfl9v+kNzgmxawgln4aKhckb9UlU4JZUOhTlrF3TBbw BoWFALiT/3D89GUbUon+h31e/ptK2uHIJxMu9xk41ymsQ/LPATs3LjKZGTA4YrVc+TyV 1iJ7PfqhBlQpSLj4XW0LVXEIRf8KgaQByVFNTrXpHRWyK/lHiSkfIkC32FJ3V5gtj6wW abbQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m22si4914937ejc.115.2021.05.21.02.49.11; Fri, 21 May 2021 02:49:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237308AbhEUGEf (ORCPT + 99 others); Fri, 21 May 2021 02:04:35 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:3643 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231476AbhEUGEW (ORCPT ); Fri, 21 May 2021 02:04:22 -0400 Received: from dggems701-chm.china.huawei.com (unknown [172.30.72.59]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4FmbYy1vBGzmXqW; Fri, 21 May 2021 14:00:38 +0800 (CST) Received: from dggpeml500012.china.huawei.com (7.185.36.15) by dggems701-chm.china.huawei.com (10.3.19.178) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 21 May 2021 14:02:53 +0800 Received: from huawei.com (10.67.165.24) by dggpeml500012.china.huawei.com (7.185.36.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 21 May 2021 14:02:52 +0800 From: Kai Ye To: , , , , , , CC: , Subject: [PATCH v2 12/12] net/Bluetooth/smp - use the correct print format Date: Fri, 21 May 2021 13:59:48 +0800 Message-ID: <1621576788-48092-13-git-send-email-yekai13@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1621576788-48092-1-git-send-email-yekai13@huawei.com> References: <1621576788-48092-1-git-send-email-yekai13@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpeml500012.china.huawei.com (7.185.36.15) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org According to Documentation/core-api/printk-formats.rst, Use the correct print format. Printing an unsigned int value should use %u instead of %d. Otherwise printk() might end up displaying negative numbers. Signed-off-by: Kai Ye --- net/bluetooth/smp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c index 2def906..56c59f8 100644 --- a/net/bluetooth/smp.c +++ b/net/bluetooth/smp.c @@ -859,7 +859,7 @@ static int tk_request(struct l2cap_conn *conn, u8 remote_oob, u8 auth, memset(smp->tk, 0, sizeof(smp->tk)); clear_bit(SMP_FLAG_TK_VALID, &smp->flags); - bt_dev_dbg(hcon->hdev, "auth:%d lcl:%d rem:%d", auth, local_io, + bt_dev_dbg(hcon->hdev, "auth:%u lcl:%u rem:%u", auth, local_io, remote_io); /* If neither side wants MITM, either "just" confirm an incoming @@ -925,7 +925,7 @@ static int tk_request(struct l2cap_conn *conn, u8 remote_oob, u8 auth, get_random_bytes(&passkey, sizeof(passkey)); passkey %= 1000000; put_unaligned_le32(passkey, smp->tk); - bt_dev_dbg(hcon->hdev, "PassKey: %d", passkey); + bt_dev_dbg(hcon->hdev, "PassKey: %u", passkey); set_bit(SMP_FLAG_TK_VALID, &smp->flags); } @@ -1654,7 +1654,7 @@ int smp_user_confirm_reply(struct hci_conn *hcon, u16 mgmt_op, __le32 passkey) case MGMT_OP_USER_PASSKEY_REPLY: value = le32_to_cpu(passkey); memset(smp->tk, 0, sizeof(smp->tk)); - bt_dev_dbg(conn->hcon->hdev, "PassKey: %d", value); + bt_dev_dbg(conn->hcon->hdev, "PassKey: %u", value); put_unaligned_le32(value, smp->tk); fallthrough; case MGMT_OP_USER_CONFIRM_REPLY: -- 2.8.1