Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4947393rdb; Fri, 15 Sep 2023 18:39:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFSWgIvWeZI9wRkRnYQBOP2Q0HmL9K8gv921vn2cMgGpwXwu1VUeEuK4e+dBm55bD771LD/ X-Received: by 2002:aca:90b:0:b0:3a7:5453:a622 with SMTP id 11-20020aca090b000000b003a75453a622mr3469179oij.17.1694828379427; Fri, 15 Sep 2023 18:39:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694828379; cv=none; d=google.com; s=arc-20160816; b=Ly0h1RooCpIN6m22pifeWVUh67PNz/TyEvRwYB5zHwzXL35DSlWsoB1rMB2rzzn4nF YeeK9OcwqusXHpo31Nby4VkDzhAP3xo6RhP4tlG12wSxA9TgrOPWJ/k/SaBsxderdCsl sIchEU21290CXqaZseGD3QIDwSDAjojj4agA7DbJB8r8Wmkncm5rKBWKZsEZusNLuY6k 3NaIeixTDexMQ9PS8ZvbmRaVRyhBf6yEgIVqXczPkBaenTXx4eyngMbkz45cG51b76/2 VwtxmD3fLw0EuzCp76cjWeEggqac4tz7UgyBTPG3QLV219dHZnqAxQ9WgQvwHcsiHuBP ulcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:to:from:dkim-signature; bh=oWovvwV6RqYuE0gLiBxHUd3cEuUE/+wFd/+K5yBGVao=; fh=4lGQI6056MBa4/oovMyIYaKLn+Wz/24RGvUivMmQP8E=; b=fHLtRq/xWV1PxkxoQHklALgkTHdNTxhd4eU9Qos229oyNNgNtQR/GBAnJaHZeGkFHj ejuBaJsGh1TsU6AwGYvWTo9cepKxwz2rTzgvIeUEfMSoyCBlkMRqWpLS4a4It499kVU9 jQ25E/QvbBBfaldJKwYhvU3I3KoWhIaQZL1HRCX0YbH7JpDo6/h8S0d5TBxp9knKIYbc xRYhpExA85JlWD2jvreHaIFtGrLHHjTrVCRI2NuwRqGFxYSHRlTQbOOAHGSV5OU3/9F2 wEkjJSDDySHsBKgppep3EAIk9Nksh0AzPwpu1bkHX+iIlNuE6SfWiLyO+7i2TO/2N1KV zlrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=gTvqjIHg; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id o66-20020a634145000000b00577796b5206si4054300pga.898.2023.09.15.18.39.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 18:39:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=gTvqjIHg; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id CE4BC85652A5; Fri, 15 Sep 2023 16:22:42 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237488AbjIOXWM (ORCPT + 99 others); Fri, 15 Sep 2023 19:22:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237950AbjIOXVr (ORCPT ); Fri, 15 Sep 2023 19:21:47 -0400 Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 211961FE0 for ; Fri, 15 Sep 2023 16:21:43 -0700 (PDT) Received: by mail-pg1-x531.google.com with SMTP id 41be03b00d2f7-517ab9a4a13so2126075a12.1 for ; Fri, 15 Sep 2023 16:21:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1694820102; x=1695424902; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=oWovvwV6RqYuE0gLiBxHUd3cEuUE/+wFd/+K5yBGVao=; b=gTvqjIHgkjohzDZGoa/WpK4BSGSmNzERuKsyrB+CU5P5NP0g2AutqKrAlnen6VlrsF Dd1r2CYgOeDd5B00m9TFjhzzFsQBo2PBpSS6UYd/b7H9qPubDPpQqlrdlpqRDaNHUltc yExN4YOnbzzW67nlrqs1k03k0cbqQFr5MQQN7oAwfkZdPyGnkbb6xqUeWCfN0gq4i8hd bKlB7QGdSV/75ri5RCDyGXsQ1NpWyyS4Nm52hHSJMNcBpXxaUaMIgtJUyWxA6auppuDO biS8QpwYrCLrlO/413048ZXjImHgQSw7w353LvoijI5ikgMDrhMfbngI6+lXT2fJKGqi nOWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694820102; x=1695424902; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=oWovvwV6RqYuE0gLiBxHUd3cEuUE/+wFd/+K5yBGVao=; b=ZepjeFHurn9zNdLu77igjZCB9Di0UbohGipH+blg7BhvN+Mf3y+akb4T4QWE5YFeq6 cQ+tseJOY/0X+v2ZAh3ReQv6ufdLA8oTOldRmayyaBwhqdW0osNenS6GmVAprO4c9xgk mFPy/bfO9epMVjvTTh3xl7C+P1/826NNX5g7kfDDvVV35ovJvE03I9DgBXPX32zATmlJ iTluDZoL/icm2u+ChF0cOHE5nZH2VUBH2275Ke3YDZ/ge0nX6+nKCd4ANwx6LjlyJ3y/ Kp2l4pmJvIsnkXOhZJEg8HAryOVNVc82Aa5PM2gezDFPGYX1i2d8fMr9c3FgQ91VPdlu +evQ== X-Gm-Message-State: AOJu0Yxir7oDHi5SPAppBsRiyLNC4x9cpTy7PaFun1Gkd08RwLFYTw/9 hnBSs8Cmasc5W0couThqwGELEZcYNa4= X-Received: by 2002:a05:6a20:914d:b0:159:ee33:12f with SMTP id x13-20020a056a20914d00b00159ee33012fmr3743406pzc.56.1694820101877; Fri, 15 Sep 2023 16:21:41 -0700 (PDT) Received: from lvondent-mobl4.. (c-98-232-221-87.hsd1.or.comcast.net. [98.232.221.87]) by smtp.gmail.com with ESMTPSA id p24-20020aa78618000000b0068746ab9aebsm3583212pfn.14.2023.09.15.16.21.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 16:21:40 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH v2 1/2] Bluetooth: hci_core: Fix build warnings Date: Fri, 15 Sep 2023 16:21:38 -0700 Message-ID: <20230915232139.3661778-1-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Fri, 15 Sep 2023 16:22:43 -0700 (PDT) From: Luiz Augusto von Dentz This fixes the following warnings: net/bluetooth/hci_core.c: In function ‘hci_register_dev’: net/bluetooth/hci_core.c:2620:54: warning: ‘%d’ directive output may be truncated writing between 1 and 10 bytes into a region of size 5 [-Wformat-truncation=] 2620 | snprintf(hdev->name, sizeof(hdev->name), "hci%d", id); | ^~ net/bluetooth/hci_core.c:2620:50: note: directive argument in the range [0, 2147483647] 2620 | snprintf(hdev->name, sizeof(hdev->name), "hci%d", id); | ^~~~~~~ net/bluetooth/hci_core.c:2620:9: note: ‘snprintf’ output between 5 and 14 bytes into a destination of size 8 2620 | snprintf(hdev->name, sizeof(hdev->name), "hci%d", id); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Luiz Augusto von Dentz --- net/bluetooth/hci_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index db4f28d68d71..5a7fb496297b 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -2617,7 +2617,8 @@ int hci_register_dev(struct hci_dev *hdev) if (id < 0) return id; - snprintf(hdev->name, sizeof(hdev->name), "hci%d", id); + snprintf(hdev->name, sizeof(hdev->name), "hci%u", + id ? id % HCI_MAX_ID : id); hdev->id = id; BT_DBG("%p name %s bus %d", hdev, hdev->name, hdev->bus); -- 2.41.0