Received: by 2002:a05:7412:8d09:b0:fa:4c10:6cad with SMTP id bj9csp468977rdb; Tue, 16 Jan 2024 06:11:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IHVMXnwAQfZjFCHVTfZuHZz+kwLYTPor7sacIKXTK5LQI9hYAlysf1lgpb0lz2cIQKvTm5d X-Received: by 2002:a19:6545:0:b0:50e:69d6:c7b with SMTP id c5-20020a196545000000b0050e69d60c7bmr3336940lfj.120.1705414275602; Tue, 16 Jan 2024 06:11:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705414275; cv=none; d=google.com; s=arc-20160816; b=mF34Nc2LidgAYEHCvxr2dzGwvkj1PWlkBWpYjWJzZC2RIJYSnF0wgiZhLoGZkOgGo5 ousGPFdWFWqKTOUcqTbfN8/1aKyiZVshKGwCGKUSy0EFZXiyoTEcf9JfjOltG8EDM6w0 XUk1nBNbDHYueXuaEv050561pFIRTJZ96dsaQLH/7cnzbhET1E59AOuPZ+ZMJYTZtdK/ W2TUDU2vtAJUUV6ZxnqnoNHd322ZyV+RK/Q+9aPMDDb6yq8rUwhhwdECL7QXDvP9dZXq 4whhigtK7qKuxJ987hAh97w6CFWkmZV+ZNZM3Ct7H23+FjWbA+5JDDAz17MAqO7zkWAw QNWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:date:from:dkim-signature; bh=GJ4ijNO+jXqr98Hd2Ksh3gZBlQYIValzh/mwuyni0ok=; fh=wm3knQjNzlzhSYO3l6/R1dJNTO7aXLaAzT309a/t7Bw=; b=qfuPPTwGaVrwlP1BRWYSoYp8SOFZyfZ8MfX0o3Aq/oOtdxDEIvEqPby1UzLkQEhvvW +pVBvTuvVhGdmmMyVCjMfPGZ/Q9eP5YPKOkeHMShyz8ezdqE4CBwzlfwwBQ8GO1/t+E7 zB+OnjxJsnYt1prLZHhH7a8UJragEhHUPn8VTruVpk1Pon1iLt4dpe8hx/wZIESL0Y0g QiVXHvUPNeGoatTH5ktHiEjg2bXFGUVHIGAKqwHDFsoWUFZHEywS4rLiK3LFS7e5u05+ RhEVErwNvCobDSGJJt07gDCrahd18P3wCvFH9BMQ1O90F7pNYbWe5SmIhDv4Oc23ylZJ NxCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=L2KhSXDa; spf=pass (google.com: domain of linux-bluetooth+bounces-1109-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-1109-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id l21-20020a170906079500b00a27a70807adsi4847590ejc.560.2024.01.16.06.11.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jan 2024 06:11:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-1109-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=L2KhSXDa; spf=pass (google.com: domain of linux-bluetooth+bounces-1109-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-1109-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id ECC241F2500B for ; Tue, 16 Jan 2024 14:01:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2486F1BF5C; Tue, 16 Jan 2024 14:00:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="L2KhSXDa" X-Original-To: linux-bluetooth@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1EA751BDEB for ; Tue, 16 Jan 2024 14:00:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id 91FC5C433B1; Tue, 16 Jan 2024 14:00:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705413639; bh=LVMnZlTkxWcpStNU6Xl+mRoEwUNK0FYdkJjY5mOEHKs=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=L2KhSXDaJfU2l1mGGA1YLAtfnYF6yleEgClpuZZLc/zRFm6185Z2mp32AXbIedfff pfox8XwugeTiLClbjTAnEEBX/BuMNukCxSFFcevt2irTlgleNnwHhONXr88aHdMnH9 pLTPpT9onoP4qwjWJBXe6Vv3tozkVV0S9SHWX5U+dQ1PL6+TuBEYCAjMMRaP+uffeb tVO3FFWkmz71cCJaL5W3hhMUV1YxdBAlt+I3DuPw/A0yPgYgWAjRuQInEhEWZ1ld2c 4qdE5hEqpRLDWUIZYSbF6vjDq7Ba8jpjgdYk3+jH1MGhbxpxvlp4THk+8gRQxH106h t7njYG3l++xKw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80BF5C47077; Tue, 16 Jan 2024 14:00:39 +0000 (UTC) From: Emil Velikov via B4 Relay Date: Tue, 16 Jan 2024 14:00:30 +0000 Subject: [PATCH BlueZ 05/20] monitor: const annotate intel_version_tlv_desc::type_str and API Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240116-const-v1-5-17c87978f40b@gmail.com> References: <20240116-const-v1-0-17c87978f40b@gmail.com> In-Reply-To: <20240116-const-v1-0-17c87978f40b@gmail.com> To: linux-bluetooth@vger.kernel.org Cc: Emil Velikov X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1705413636; l=3446; i=emil.l.velikov@gmail.com; s=20230301; h=from:subject:message-id; bh=wahNKDM8iDeiZs6EV1R7VsClaT+QYMSeKeI21SRP6Aw=; b=Gdy8Fb4gEVdZRo4gvD5rfT/5wHjL+tFQXVs8a5soi0m05zIDj/c71TZAkIjwMmFZzSZ4VmXld Llp1vuZnqopC+ulU8e/VkD5vQ8moTkPyDVbGG+TXmDB+C6J9ZRrucwB X-Developer-Key: i=emil.l.velikov@gmail.com; a=ed25519; pk=qeUTVTNyI3rcR2CfNNWsloTihgzmtbZo98GdxwZKCkY= X-Endpoint-Received: by B4 Relay for emil.l.velikov@gmail.com/20230301 with auth_id=35 X-Original-From: Emil Velikov Reply-To: From: Emil Velikov --- monitor/intel.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/monitor/intel.c b/monitor/intel.c index 1b2414290..0de864d8a 100644 --- a/monitor/intel.c +++ b/monitor/intel.c @@ -171,25 +171,25 @@ struct intel_version_tlv { }; static void print_version_tlv_u32(const struct intel_version_tlv *tlv, - char *type_str) + const char *type_str) { print_field("%s(%u): 0x%8.8x", type_str, tlv->type, get_le32(tlv->val)); } static void print_version_tlv_u16(const struct intel_version_tlv *tlv, - char *type_str) + const char *type_str) { print_field("%s(%u): 0x%4.4x", type_str, tlv->type, get_le16(tlv->val)); } static void print_version_tlv_u8(const struct intel_version_tlv *tlv, - char *type_str) + const char *type_str) { print_field("%s(%u): 0x%2.2x", type_str, tlv->type, get_u8(tlv->val)); } static void print_version_tlv_enabled(const struct intel_version_tlv *tlv, - char *type_str) + const char *type_str) { print_field("%s(%u): %s(%u)", type_str, tlv->type, tlv->val[0] ? "Enabled" : "Disabled", @@ -197,7 +197,7 @@ static void print_version_tlv_enabled(const struct intel_version_tlv *tlv, } static void print_version_tlv_img_type(const struct intel_version_tlv *tlv, - char *type_str) + const char *type_str) { const char *str; @@ -217,34 +217,34 @@ static void print_version_tlv_img_type(const struct intel_version_tlv *tlv, } static void print_version_tlv_timestamp(const struct intel_version_tlv *tlv, - char *type_str) + const char *type_str) { print_field("%s(%u): %u-%u", type_str, tlv->type, tlv->val[1], tlv->val[0]); } static void print_version_tlv_min_fw(const struct intel_version_tlv *tlv, - char *type_str) + const char *type_str) { print_field("%s(%u): %u-%u.%u", type_str, tlv->type, tlv->val[0], tlv->val[1], 2000 + tlv->val[2]); } static void print_version_tlv_otp_bdaddr(const struct intel_version_tlv *tlv, - char *type_str) + const char *type_str) { packet_print_addr(type_str, tlv->val, 0x00); } static void print_version_tlv_unknown(const struct intel_version_tlv *tlv, - char *type_str) + const char *type_str) { print_field("%s(%u): ", type_str, tlv->type); packet_hexdump(tlv->val, tlv->len); } static void print_version_tlv_mfg(const struct intel_version_tlv *tlv, - char *type_str) + const char *type_str) { uint16_t mfg_id = get_le16(tlv->val); @@ -254,8 +254,8 @@ static void print_version_tlv_mfg(const struct intel_version_tlv *tlv, static const struct intel_version_tlv_desc { uint8_t type; - char *type_str; - void (*func)(const struct intel_version_tlv *tlv, char *type_str); + const char *type_str; + void (*func)(const struct intel_version_tlv *tlv, const char *type_str); } intel_version_tlv_table[] = { { 16, "CNVi TOP", print_version_tlv_u32 }, { 17, "CNVr TOP", print_version_tlv_u32 }, @@ -365,7 +365,7 @@ static void read_version_rsp(uint16_t index, const void *data, uint8_t size) static void read_version_cmd(uint16_t index, const void *data, uint8_t size) { - char *str; + const char *str; uint8_t type; /* This is the legacy read version command format and no further action -- 2.43.0