From patchwork Wed Jan 27 18:23:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Brian Gix X-Patchwork-Id: 371676 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8EDAFC433DB for ; Wed, 27 Jan 2021 18:25:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 577E164DA8 for ; Wed, 27 Jan 2021 18:25:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236320AbhA0SYk (ORCPT ); Wed, 27 Jan 2021 13:24:40 -0500 Received: from mga05.intel.com ([192.55.52.43]:57913 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233231AbhA0SYj (ORCPT ); Wed, 27 Jan 2021 13:24:39 -0500 IronPort-SDR: AaMulYzN6tnQ6bBW9hYmmYVTetgQznonOZ6DqRhgjw3fSj70Nsx8nkfo72qUCNdD8tfSFUMc2q HNOtg9bgkdfw== X-IronPort-AV: E=McAfee;i="6000,8403,9877"; a="264939096" X-IronPort-AV: E=Sophos;i="5.79,380,1602572400"; d="scan'208";a="264939096" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jan 2021 10:23:59 -0800 IronPort-SDR: iYyAULX94kuIHsdhEfbl1Bmy+GE/eR95QlaQofnNzl8dN6327G8MDfqiVn94qeXjadXVXiXRk1 AVTelxt4gZ4w== X-IronPort-AV: E=Sophos;i="5.79,380,1602572400"; d="scan'208";a="430191947" Received: from bgi1-mobl2.amr.corp.intel.com ([10.212.3.187]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jan 2021 10:23:58 -0800 From: Brian Gix To: linux-bluetooth@vger.kernel.org Cc: luiz.dentz@gmail.com, brian.gix@intel.com Subject: [PATCH BlueZ v2 1/2] advertising: Make data size explicit for formats Date: Wed, 27 Jan 2021 10:23:27 -0800 Message-Id: <20210127182328.1542194-2-brian.gix@intel.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20210127182328.1542194-1-brian.gix@intel.com> References: <20210127182328.1542194-1-brian.gix@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org On some 32 bit systems sizeof does not return (unsigned long) Fixes the error: In file included from src/advertising.c:30: src/advertising.c: In function ‘read_controller_cap_complete’: src/log.h:60:20: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘unsigned int’ [-Werror=format=] 60 | btd_error(0xffff, "%s:%s() " fmt, __FILE__, __func__, ## arg) | ^~~~~~~~~~ src/advertising.c:1757:3: note: in expansion of macro ‘error’ 1757 | error("Controller capabilities malformed, size %lu != %u", | ^~~~~ src/advertising.c:1757:52: note: format string is defined here 1757 | error("Controller capabilities malformed, size %lu != %u", | ~~^ | | | long unsigned int | %u --- src/advertising.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/advertising.c b/src/advertising.c index 4f5123fa1..36e737987 100644 --- a/src/advertising.c +++ b/src/advertising.c @@ -1755,7 +1755,7 @@ static void read_controller_cap_complete(uint8_t status, uint16_t length, if (sizeof(rp->cap_len) + rp->cap_len != length) { error("Controller capabilities malformed, size %lu != %u", - sizeof(rp->cap_len) + rp->cap_len, length); + (long) sizeof(rp->cap_len) + rp->cap_len, length); return; } From patchwork Wed Jan 27 18:23:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Brian Gix X-Patchwork-Id: 372723 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09D8CC433E0 for ; Wed, 27 Jan 2021 18:25:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B479D64DA5 for ; Wed, 27 Jan 2021 18:25:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343859AbhA0SZU (ORCPT ); Wed, 27 Jan 2021 13:25:20 -0500 Received: from mga07.intel.com ([134.134.136.100]:21028 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343828AbhA0SZK (ORCPT ); Wed, 27 Jan 2021 13:25:10 -0500 IronPort-SDR: 4noFpp+ANDEQPIqwQDgeDaZuG2WesRpkxmtegtFcPg5n4BhCS2/hxd7Jd3Pc16DS64LJ47+ni1 lGv8qFoN8Jjw== X-IronPort-AV: E=McAfee;i="6000,8403,9877"; a="244190116" X-IronPort-AV: E=Sophos;i="5.79,380,1602572400"; d="scan'208";a="244190116" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jan 2021 10:24:16 -0800 IronPort-SDR: MrVNzXg9+xzFi+zGnDbf93AJkci45BrncU3jIb+OJb0TdmyFf0pvHNqDjdjin4Tj85T+ZqlFj6 /m9idgaYZfmg== X-IronPort-AV: E=Sophos;i="5.79,380,1602572400"; d="scan'208";a="430192018" Received: from bgi1-mobl2.amr.corp.intel.com ([10.212.3.187]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jan 2021 10:24:15 -0800 From: Brian Gix To: linux-bluetooth@vger.kernel.org Cc: luiz.dentz@gmail.com, brian.gix@intel.com Subject: [PATCH BlueZ v2 2/2] tools/mgmt-tester: Make data size explicit for log Date: Wed, 27 Jan 2021 10:23:28 -0800 Message-Id: <20210127182328.1542194-3-brian.gix@intel.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20210127182328.1542194-1-brian.gix@intel.com> References: <20210127182328.1542194-1-brian.gix@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org On 32 bit systems, sizeof macro doesn't always return (unsigned long) Fix following error: tools/mgmt-tester.c: In function ‘read_50_controller_cap_complete’: tools/mgmt-tester.c:9124:58: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘unsigned int’ [-Werror=format=] 9124 | tester_warn("Controller capabilities malformed, size %lu != %u", | ~~^ | | | long unsigned int | %u 9125 | sizeof(rp->cap_len) + rp->cap_len, length); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | unsigned int --- tools/mgmt-tester.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/mgmt-tester.c b/tools/mgmt-tester.c index fe73a6d89..6bc40181e 100644 --- a/tools/mgmt-tester.c +++ b/tools/mgmt-tester.c @@ -9122,7 +9122,7 @@ static void read_50_controller_cap_complete(uint8_t status, uint16_t length, if (sizeof(rp->cap_len) + rp->cap_len != length) { tester_warn("Controller capabilities malformed, size %lu != %u", - sizeof(rp->cap_len) + rp->cap_len, length); + (long) sizeof(rp->cap_len) + rp->cap_len, length); tester_test_failed(); }