Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp693450rwd; Thu, 25 May 2023 02:31:13 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5/b9a+H1Ojnn7s2AHuUkBWh6VNrPjrU8OL2a8HF2Ar+V/EA6q+FltAuIzu4tDTSZVt5UUY X-Received: by 2002:a05:6a00:a17:b0:648:1311:fbc4 with SMTP id p23-20020a056a000a1700b006481311fbc4mr8194412pfh.33.1685007072822; Thu, 25 May 2023 02:31:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685007072; cv=none; d=google.com; s=arc-20160816; b=XO0I0J42zt3yqIOo8SrPHI2CtVQe79+wBc9H9UcyOOZlU/kp6rS6j1aker6X2BGFDh KTG410bHfZPr/QVQOzgy2noN+VNUC8hPUWrfqf1OCmQeu9UvucphgqKL/DgW92YJLHBl eBbUm9Yl1oDbZjLfjUUwHCj9hRZClS/oyLR4HvQ4/bFiJBNIbNRQPPUvs2LJKFp6tLta DoT4eluiXAhvKDtCpaKHSMWeJ6hghl5z9WEq+4XRl3K2V3PvCh6wc1TL85nSSCuvEgdw 5FslSoH9n4TvG41+SflfDFSwR0LCQm1fRYBk5c1AGFWoU9tLzQCqb7LUCbewwtnbP9dE 618g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=r6Xjs7JNhv6fDRsOU5aojTEF0agT6Mpp2dZLZN2fQTI=; b=Ee42ajClPUP5j1run0omouFPA2p6K8CLeDHmQ7DkFBDOT1o2wsi2CmnX3eFVucZ64F iFGIg/4eEJa5wmx1yS3Oa69NRg5a4QXMWWdpE/EsCXM+yFt+PAuS8Wpa4jy4sEkg2fsE U88s6t5IABrVq32CuFFyLbXyGq7RFChNXJPxr0wuXFwC3r41A1uuZqEt7o+y9YTP/NSd dwtRNZNzHb+ft6EgqPgHwtxYLKNPKg937zu22XAjxHvKEiiSh597Sl3+QJf6r+2PXCiQ dc/KOmZyApCKngi0re25XFOWzKls9UYg3pPZMalFEv9X0ZGrQRYojAkRAit/OjeZJKmR ALmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UoDXvJhd; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x24-20020a63db58000000b0053007fe33aesi745436pgi.409.2023.05.25.02.30.48; Thu, 25 May 2023 02:31:12 -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=@linaro.org header.s=google header.b=UoDXvJhd; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237059AbjEYJ0W (ORCPT + 99 others); Thu, 25 May 2023 05:26:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233700AbjEYJ0V (ORCPT ); Thu, 25 May 2023 05:26:21 -0400 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DB1B191 for ; Thu, 25 May 2023 02:26:20 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-307d20548adso1240343f8f.0 for ; Thu, 25 May 2023 02:26:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685006779; x=1687598779; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=r6Xjs7JNhv6fDRsOU5aojTEF0agT6Mpp2dZLZN2fQTI=; b=UoDXvJhdhLzxEu2Z7q5txkPXNa5koxE0XfcBaKANhlH1elw/1VCRgRtwz75USFvffH kv8uxh5UmCX9jP0SOBQvnrJmjqm/jnZOb3pAlPvZYqaSWh6TmEj49GSwAnztLvVPNzIj zA9oJZ54ikvou6m95ZOl0zbzqYPUZoQXjCxI0lDXu7wj+7KDtNT8Orp1eB9NFV+vSV+d h1iapNCf5FuJucy6dVDs9rWIDqu18kNKbEV3qoZedtNnuL2hdTY5QfuLlGeuhf6JCMId V1Yj4uAbFme2N+HXIEP+qypEtqcSvbWK7kGOolUQrVWjkHcG8ilbyr9sska7oYQ59CrS PKOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685006779; x=1687598779; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=r6Xjs7JNhv6fDRsOU5aojTEF0agT6Mpp2dZLZN2fQTI=; b=WKK5F3C9MocVokpIp1h8IZLtD/T8W1zZQ1xdGkmgzzqc3JEa4ZksoJLsHXa4wNh3d8 wwZT2fSUNynOeo+AqnV7zE5qzmXF2el0BOLiO32EGMFEaNC7b+DckCEfElSydsu9Pjp0 xrnNDyxTKGdk4nWfN6sJ0GJBFV43RcMFEmMrInIaNm2+CFVHXgJQRxIyRVF14D77wwA2 4HC1w++ckq0StQrg9nhfL02iNc+bYS0MYkuIpqDSyJ+2UDMyhzYHkDW232OinCZ/fRVI EgZQ5yNT51ULjJ1lvYVZgys2jH81aUtXfxbGRomsbt5Irx0Jsvz93OEakQOty0/2rlLe tfjg== X-Gm-Message-State: AC+VfDz5Xdz3sRJUwwQJAhUyINHSgFOqwGDjG36mv1H2kJxWp8uKPu5l cYuK1MvjMU7cZgFZG5v8BUYb+/O1mCakquuNH9A= X-Received: by 2002:a5d:5966:0:b0:309:3a83:cf3a with SMTP id e38-20020a5d5966000000b003093a83cf3amr2067166wri.0.1685006778927; Thu, 25 May 2023 02:26:18 -0700 (PDT) Received: from localhost ([102.36.222.112]) by smtp.gmail.com with ESMTPSA id b5-20020a5d45c5000000b002fda1b12a0bsm1186613wrs.2.2023.05.25.02.26.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 May 2023 02:26:17 -0700 (PDT) Date: Thu, 25 May 2023 07:40:27 +0300 From: Dan Carpenter To: Luiz Augusto von Dentz Cc: luiz.von.dentz@intel.com, linux-bluetooth@vger.kernel.org Subject: Re: [bug report] Bluetooth: Add initial implementation of BIS connections Message-ID: <2426ffbe-0030-44b6-ac06-e4b3b3db93a9@kili.mountain> References: <744fd69a-c5a3-4e0f-8c47-33096a1cd374@kili.mountain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_00,DATE_IN_PAST_03_06, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no 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 On Wed, May 24, 2023 at 12:11:08PM -0700, Luiz Augusto von Dentz wrote: > > > net/bluetooth/hci_conn.c:943 hci_le_remove_cig() > > > warn: passing zero to 'ERR_PTR' > > > > > > net/bluetooth/hci_conn.c > > > 939 static int hci_le_remove_cig(struct hci_dev *hdev, u8 handle) > > > ^^^^^^^^^^ > > > > > > 940 { > > > 941 bt_dev_dbg(hdev, "handle 0x%2.2x", handle); > > > 942 > > > --> 943 return hci_cmd_sync_queue(hdev, remove_cig_sync, ERR_PTR(handle), NULL); > > > ^^^^^^ > > > handle is a u8. It can hold error codes. > > > > s/can/cannot/. > > This is not used as an error though, it is more like INT_PTR, that > said I'm fine changing it if that is triggering static analyzer > errors. Yes, please. There is quite a bit of static analysis to ensure that ERR_PTR() values are actually errors. For example, people pass the results from copy_to_user(), or the return from true/false functions or they accidentally return a positive ERR_PTR(EINVAL); All those lead to a crash in the caller. I'm sort of surprised we don't already have an INT_PTR() macro... regards, dan carpenter