Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp542702imn; Wed, 3 Aug 2022 14:56:41 -0700 (PDT) X-Google-Smtp-Source: AA6agR69iFrgyhwn1z4IA6574oGOAJ+KZyA818AiCKaDTi6FVNbjt8qJjgGDFKr0t5cJS3bLdDB0 X-Received: by 2002:a05:6a00:22cd:b0:52d:971c:3ca4 with SMTP id f13-20020a056a0022cd00b0052d971c3ca4mr14566799pfj.58.1659563801501; Wed, 03 Aug 2022 14:56:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659563801; cv=none; d=google.com; s=arc-20160816; b=bCbCe1xOi20YtC+8iaRlGm/nnyfBg69rbyhQkPQkMD8/dbJIMjQULaDUSSyJntlE0b TJHqd9pwXOmcUf65mWJPpEzWj/6F6ulqbGgFh2uzmg1kZnMUB6O3IVa/P5YTLqTvDL2u nnENKPRaCafMe/Nlh+cRWTrrqZArE3CLmZSYLcW8yQUw2o/TNyIgciMkUpNxeKkm9bPU 0V/HUJk7R0OPhNal1AmQ75STk+BdOFMfbh/+bSi29OZPPyLSGRyrXX+b54TtSyMpda7D fnV5cJ/HgoBS1hgFVMz5i0y31J/tL3E6yzBzZmpxsxdQFR/glKAOTFLUhUKnmYI756IO YNTw== 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=pknXhGgsHb4suINCmJgPUcDHGxsQV4Z8idpu3OxHY2w=; b=O+T+kSma5HCKhpmaSE392AEsR6FHLVEN+nC0b2e1Xb/cYwWpEvNT7aY7p2Ojy3YTDh bXf/YuZ57JWKFKOaV8hq3EQxQvrTJqJCi98vKeq+tA/8xyrOWNFpvdkAAyffxBfxRwx8 XIguaSUfb1HKsBdRhvu5BAp4peyCiRiAiCjCbqgQMVENLMmXZ7llruhbIByrYQPi3Qcc RsyqkEtXq6hmyYRwwIyxWhdQY1dPtdn5H/JcAkOegndaD8SAMzWC9zxi78yXuuZhRvNe WCTN66jP2HdyR4vtI7JjmAra52YXYQyehsuhUBDcBAHuNZaLeUDe1XE23qa5pocQWuQW 6YCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=SCcVQ6vn; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pi13-20020a17090b1e4d00b001f558ba0d51si1332779pjb.190.2022.08.03.14.56.11; Wed, 03 Aug 2022 14:56:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=SCcVQ6vn; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238079AbiHCVzc (ORCPT + 99 others); Wed, 3 Aug 2022 17:55:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230499AbiHCVzb (ORCPT ); Wed, 3 Aug 2022 17:55:31 -0400 Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B85AD6353 for ; Wed, 3 Aug 2022 14:55:30 -0700 (PDT) Received: by mail-pf1-x42d.google.com with SMTP id h28so11310738pfq.11 for ; Wed, 03 Aug 2022 14:55:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=pknXhGgsHb4suINCmJgPUcDHGxsQV4Z8idpu3OxHY2w=; b=SCcVQ6vnX6UC9XY5L4RMFU3NQLSNJHu2mchnhozrS7rA5N/sENP2aFSO4w3pXFzKEx de04RzR9p63+SaKXqxMRvyBnKmWoriOy5IK8i7qrH+SqVCHvPIQRDqrGXkzVgDiHuDKg 6rfyFUM5IBCfE8le+poEGTrLIrNjgeLP59FRwouWwetf+6hnxTAN0DHQfEHV2MZKjuXk RI5zschlckqRkqBd5iOspcIz3yHZM1cG+f1+579vcWdfSA5tCNXgqc+2aB7pxQue+T9G 584H4pqfkKLS7xFtkh5MCKCBvBVA/CXEDRtSe8oYKU+E6DF0R9ROz9H9PshD1KsIntJV nZcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=pknXhGgsHb4suINCmJgPUcDHGxsQV4Z8idpu3OxHY2w=; b=IXeRzn7nDXV1eKNqUIB/zMSbivzGG1IKz5ABqRRZqxrFr9pDunQsp47ThLMqXhHbt8 71JRzfH0XPqDe46jnmc2189ptHLJRxbBU4714SkhyTYzLYrmmVRPPNKhAoYUbQKaLpwX +ELzJwLpT/ZxK+On2yj7vGhHaGTCt2yEdFRSZT+EvQq/eyp58bujb1w0P3FxGpTVcgJK sWD+WcHMt1jBb8tnhQmqqeq4hsT5AGlMsiAeviQw0LQKrWDArQOVTEYsB4LnhuP8/gFI LlcjE1j5ulV+CJByrng7VY85AY4ruFdiscbvKi/twwIYABRThJNJ/z9FSwjg+JcXOr8o fFYA== X-Gm-Message-State: AJIora87j8YI0mbvbNq5OPA16dMF6dmD5pzLwk4P9yXDqqOcDDCOjSO/ +9+JqHpEuVH37jNtzuKk8c8SqVegspaBVg== X-Received: by 2002:a63:2a89:0:b0:412:6e07:78fd with SMTP id q131-20020a632a89000000b004126e0778fdmr22166413pgq.161.1659563729721; Wed, 03 Aug 2022 14:55:29 -0700 (PDT) Received: from lvondent-mobl4.. (c-71-56-157-77.hsd1.or.comcast.net. [71.56.157.77]) by smtp.gmail.com with ESMTPSA id l11-20020a170903244b00b0016bedcced2fsm2494052pls.35.2022.08.03.14.55.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Aug 2022 14:55:28 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH 1/2] Bluetooth: hci_event: Fix build warning with C=1 Date: Wed, 3 Aug 2022 14:55:26 -0700 Message-Id: <20220803215527.3070932-1-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.37.1 MIME-Version: 1.0 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 From: Luiz Augusto von Dentz This fixes the following warning when build with make C=1: net/bluetooth/hci_event.c:337:15: warning: restricted __le16 degrades to integer Fixes: a93661203641e ("Bluetooth: Process result of HCI Delete Stored Link Key command") Signed-off-by: Luiz Augusto von Dentz --- net/bluetooth/hci_event.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 9ab359b15f57..395c6479456f 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -328,14 +328,17 @@ static u8 hci_cc_delete_stored_link_key(struct hci_dev *hdev, void *data, struct sk_buff *skb) { struct hci_rp_delete_stored_link_key *rp = data; + u16 num_keys; bt_dev_dbg(hdev, "status 0x%2.2x", rp->status); if (rp->status) return rp->status; - if (rp->num_keys <= hdev->stored_num_keys) - hdev->stored_num_keys -= le16_to_cpu(rp->num_keys); + num_keys = le16_to_cpu(rp->num_keys); + + if (num_keys <= hdev->stored_num_keys) + hdev->stored_num_keys -= num_keys; else hdev->stored_num_keys = 0; -- 2.37.1