Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4857039rdb; Fri, 15 Sep 2023 14:45:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFdX5hZc1mlC0XTeNDXTcCFpqyYtBOHi61jVP/7KGqZDJC/IXNWEKhF3UrIgwySYa2x1xtH X-Received: by 2002:a05:6871:b29:b0:1d5:5660:3ae0 with SMTP id fq41-20020a0568710b2900b001d556603ae0mr3063171oab.20.1694814318746; Fri, 15 Sep 2023 14:45:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694814318; cv=none; d=google.com; s=arc-20160816; b=BCpr4YciLxQ7zIHLoWZ0+e3qC69Wsh9VxxMGU36fukAWuXotiBC6QABXK+ns4rCLkP lkJX8TaKY4gPkGwOtfXC3kPf9jbcY7LaLFXCdLHBcO1lV3dmO92dlHDjKgSz1bVED4z8 xTbc140G4OY/ZDm16uEkNb3GLfVr/IpGC4Eu1+KgiFRONnzfFYqfy5tl2N/Mvq7KRWL0 bbunFc1mqIXinAEBB5QPhrMS3CWJ9Ng6sdGGQwcQLeHVEOTAtYbwKB4uSoOkUuAWZaYd WpcqyYv+qMS254GSpk1F5L+fDhcEScIITX4u8MAgWHUsbs6EaSyV+N9N+HuTYiQqcwWM aAxQ== 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=g0NJ00rM78J2vxfcdjbFQShehsm3IO0jGkw1pwoiSoc=; fh=4lGQI6056MBa4/oovMyIYaKLn+Wz/24RGvUivMmQP8E=; b=fPsGcUFw/KZ/kn8EYHScVUKNj3Knk9DsagYxEJjCuubnZghS/2sc/jNuZOl8BgguoP LwVUXgiFI/RKk+Oo7pR2Jk29I5drMInLpFTG/ALSzOzbqR50XKu1sdbpDCniw+H8AS1q KSfmGWQWfVZSJjfIL0OqvaiXRil6JZrOvoFOxyb9W8Ay8PRY1FYaE/HSjV8AmPNgamp1 DbPbfXeShHfG777bSBR6xS4kCyFD4E2jIhcxavSXlXoZa6WVBC/9PqITAsfWQnbM/a+V qaxwT9yynn/veXbNf/lphT4IR0LtG7wOMxYNEpy0jiEz7aLlsDA5dwcAjLOXkPMJYvuZ 8s1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=P9BasCgZ; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id y190-20020a638ac7000000b00573f90c0ef5si3882595pgd.126.2023.09.15.14.45.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 14:45:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=P9BasCgZ; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id D0B1A83CC5F0; Fri, 15 Sep 2023 14:45:13 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230270AbjIOVoj (ORCPT + 99 others); Fri, 15 Sep 2023 17:44:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234089AbjIOVoV (ORCPT ); Fri, 15 Sep 2023 17:44:21 -0400 Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F28EAAC for ; Fri, 15 Sep 2023 14:44:15 -0700 (PDT) Received: by mail-pg1-x52a.google.com with SMTP id 41be03b00d2f7-573e67cc6eeso2043958a12.2 for ; Fri, 15 Sep 2023 14:44:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1694814255; x=1695419055; 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=g0NJ00rM78J2vxfcdjbFQShehsm3IO0jGkw1pwoiSoc=; b=P9BasCgZMf3Yj9fCIt0bzvi2Bxqbr/v8EGUAZ5g3kwkNESCOY8HfoD83NLmk2Sd9+y 2jFsaAp3OQ2pKtjaO+iD11SFvb4/Z7NGCdudvsHUZwR2aSZyO5a/cx0VEY2DJl4TXkUM trz7mISC11iIkncSsFILRMXzObj2Tubz6OEDxghV54B7H6zweTDhBbjfPiKPhOGr0Y8c WwHcg58dPaum5Y4RijJa6xdQN7bOvmwWGcVqmaeFXqDZRuv50a0kC2/4FiLTG+d+W2x1 OIaR86CrP4J/keM2k7TIs2sHyszQ+AlZTd4xUasGkEh1az2iOF1GITfNmCAXO2JUXFBI f10w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694814255; x=1695419055; 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=g0NJ00rM78J2vxfcdjbFQShehsm3IO0jGkw1pwoiSoc=; b=w6qIj5dPEZi59/PeW7+Nk5sfwNmbZbhex53z088qk9SVGvDl2i5HdTtLagsOJtsiGi IUDvZ8fn8P0wmDCsTm186f7vovvy2p5k0D6YTt/LHkDpEGr4rQ5os0QY3eU7jpX2+hBF mT+kU2DJElaGLw03OASkqQ1wjcJ3Z6c62ljG4MDRBW2DF6bZtiLD0AxowJNeKWoTPJHy pid3cNMrYr/wITkUNtXz3pya5xW3gvdnuym9HtTomr58Nc+wak81SIUWuG05z8apkAmb d6qhNrYabuoDrXPan+KSgSKrIateEZMIkGK64djxV96il4KLE53z508cIdbUuXhThXwj ZhFQ== X-Gm-Message-State: AOJu0YwnS+NWmW8aZ48ZqFFtSy7m6rPz0NSpK0/YeCHUHRZZ5oauoN/O wA9HlmSd4vdQgsX42/AEQTsGuEUYrFE= X-Received: by 2002:a17:90b:1481:b0:26b:1364:e784 with SMTP id js1-20020a17090b148100b0026b1364e784mr2655447pjb.0.1694814254690; Fri, 15 Sep 2023 14:44:14 -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 p6-20020a17090b010600b002682523653asm3416226pjz.49.2023.09.15.14.44.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 14:44:13 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH] Bluetooth: hci_core: Fix build warnings Date: Fri, 15 Sep 2023 14:44:12 -0700 Message-ID: <20230915214412.3611547-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=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email 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 (groat.vger.email [0.0.0.0]); Fri, 15 Sep 2023 14:45:14 -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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index db4f28d68d71..f4a218e1a52e 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -2617,7 +2617,7 @@ 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%.4u", id % HCI_MAX_ID); hdev->id = id; BT_DBG("%p name %s bus %d", hdev, hdev->name, hdev->bus); -- 2.41.0