Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5993061ybl; Tue, 10 Dec 2019 15:06:51 -0800 (PST) X-Google-Smtp-Source: APXvYqzQmVSmcWKEDrm3YnPt7eWIyi79embeWAQlYWWWjKWtbprebiYJfxafPjHTEpcPbIME2aoZ X-Received: by 2002:a9d:6c85:: with SMTP id c5mr203300otr.164.1576019211003; Tue, 10 Dec 2019 15:06:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576019210; cv=none; d=google.com; s=arc-20160816; b=K929lMzPC9Jv9ygFJl6FTQQNeHmeA4i4XVCLBMK1cpsgWhLc+XKMv68TrlIcaQ3bcz 7GSSQwN3GF3mJgrtPAeJX2aaqZRJQLqlbMwxDOHjH1mQZppA0i8sgCxoAA5+hJi9KBbj i/Pp54r3C52FwL4Ke+PH7ACEgvX5pZY6esTyqj8fVRrQNcJND31Zjd+MR7uEkuemDZob +Gm/QwAw5L1cVWyZGsX7VnyYmp4EutWoxc1jY449icW8uzKEpWRZxoRxFPXGUk+4kTa4 M06UkFplA/PGJ9D9F+f9sx6takHi0Meab00QaOFkw4ltLs9bvj1UIgmYlS0fYdw6WJ9U atrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=yxc3zUZusutqVpchqtQh+N32h9j03N6eVrKkWnZnClw=; b=ZWqnIcg4QF6KY2rK3k5BzzZPbCJ1ZcZRF6Gobn4/WopwcyXJ15bJBi3ERm7PasUxQk b1n4Z96GSyPOuDQ4n+7rITM7dM7SBz7CyBnSZElwbm4TkHKt4ewQyXzkuRfHbr/Sfmfv gNuRGg6xG6XqYAQcI6y8e7UyawPY4+bJezs/8ePlOdSIZyb+6CKPtlm4pamJSCtqFtiq JP5nag84ih/0l3zgxzTSXR5+QSDpmelLWlWGPnA9FXroCaiXFaS4HefC0bHRsPWbfCk4 VtSTnXS+hRSkGaKtWYxgHBZgl+Swfd/rp8jbvde+iVRTN/w1bjqvtebGTXafs121lMlS zUzw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m35si2952992otm.17.2019.12.10.15.06.15; Tue, 10 Dec 2019 15:06:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726714AbfLJXGD (ORCPT + 99 others); Tue, 10 Dec 2019 18:06:03 -0500 Received: from mga07.intel.com ([134.134.136.100]:13898 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726631AbfLJXGD (ORCPT ); Tue, 10 Dec 2019 18:06:03 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Dec 2019 15:06:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,301,1571727600"; d="scan'208";a="264677968" Received: from ingas-nuc1.sea.intel.com ([10.254.187.166]) by FMSMGA003.fm.intel.com with ESMTP; 10 Dec 2019 15:06:01 -0800 From: Inga Stotland To: linux-bluetooth@vger.kernel.org Cc: brian.gix@intel.com, Inga Stotland Subject: [PATCH BlueZ] mesh: Remove redundant code in mesh IO mgmt Date: Tue, 10 Dec 2019 15:06:00 -0800 Message-Id: <20191210230600.23035-1-inga.stotland@intel.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org This removes unnecessary housekeeping for hci controllers --- mesh/mesh-mgmt.c | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/mesh/mesh-mgmt.c b/mesh/mesh-mgmt.c index 27272d4d2..2cf2ebac2 100644 --- a/mesh/mesh-mgmt.c +++ b/mesh/mesh-mgmt.c @@ -42,14 +42,8 @@ struct read_info_req { }; static struct mgmt *mgmt_mesh; -static struct l_queue *controllers; static struct l_queue *read_info_regs; -static bool simple_match(const void *a, const void *b) -{ - return a == b; -} - static void process_read_info_req(void *data, void *user_data) { struct read_info_reg *reg = data; @@ -101,23 +95,14 @@ static void read_info_cb(uint8_t status, uint16_t length, static void index_added(uint16_t index, uint16_t length, const void *param, void *user_data) { - if (l_queue_find(controllers, simple_match, L_UINT_TO_PTR(index))) - return; - - l_queue_push_tail(controllers, L_UINT_TO_PTR(index)); - - if (mgmt_send(mgmt_mesh, MGMT_OP_READ_INFO, index, 0, NULL, - read_info_cb, L_UINT_TO_PTR(index), NULL) != 0) - return; - - l_queue_remove(controllers, L_UINT_TO_PTR(index)); + mgmt_send(mgmt_mesh, MGMT_OP_READ_INFO, index, 0, NULL, + read_info_cb, L_UINT_TO_PTR(index), NULL); } static void index_removed(uint16_t index, uint16_t length, const void *param, void *user_data) { l_warn("Hci dev %4.4x removed", index); - l_queue_remove(controllers, L_UINT_TO_PTR(index)); } static void read_index_list_cb(uint8_t status, uint16_t length, @@ -157,9 +142,6 @@ static void read_index_list_cb(uint8_t status, uint16_t length, static bool mesh_mgmt_init(void) { - if (!controllers) - controllers = l_queue_new(); - if (!read_info_regs) read_info_regs = l_queue_new(); -- 2.21.0