Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp5775827pxv; Wed, 28 Jul 2021 20:40:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxnH4rwPUlJNukky+45g4DaO30Z4ctxzt0Bc+Xtg80d0IuSu9q/qinY/KziMg4wmCoZN4v7 X-Received: by 2002:a05:6402:34e:: with SMTP id r14mr3627122edw.6.1627530005977; Wed, 28 Jul 2021 20:40:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627530005; cv=none; d=google.com; s=arc-20160816; b=JiBVMUxIxdcWurBIAhkC5ZeMREnD9huAm3SWkGQjZKcofGS1cGA6noV9uf+K0Bu3kF eH5nlmMSJhKIqmC0ZkXp16JgUAfsDngWvrXJgzFkrHTXUznNO5Y+j2MuDMx44hU3/I09 k3woPiNsXeQ8rziR1aTbaWh1lISsOgNCoPnTchHILYnGD2ZvvbBC9kIhjA86zudDyIY8 hm7RQjPbCq+cKTm1e5OIgit8kXAdpm13H9AbYE3l3PNkPhpb9IEXe6WiDWDwa5E+49ix mLhh4I85j4amTWufuiHetxnuy1lbmXANbucC4o7nCjRP57BsBkzjs5SFP8gGjCJU8Dgs Ey7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:mime-version:message-id:date :dkim-signature; bh=7ixzuuNDgee9bW2cjdqHBGkL1CtEaTFP5FgsMVEumf4=; b=rKiIE8eIv84L4V8WSlKf03vj3pSyxWu3UeoLfm3eGDhEZSY0qxIvM8Q/l6Y7tFEhbS 9V1zOJFUpTUq6SIIr9fRURlgzhe4RnhN48ttVeMPcNTKm+EsdlVr/baa80pSFeKgeR0v PCXlB+JZ8K2tKUnKfWuNsNKB3GIRqLhUF8/HlOsrmF2I6LmLsrc0D+bs+m/fjoLi8F8c Lbrren/G5MIyYXZy7Wk5gb4A1iTTV6cd23E5d1VE8K9ErTXchqkI8ym6OzdegxuoUdXH LC48vsM9FpnxtQTlJZcceNqyIaIiuz25HLFDvmOLhj8h+cTlXuF2TKkS7UXQ5yggZP9F QCOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=aEspkNGq; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lh3si1623679ejb.149.2021.07.28.20.39.26; Wed, 28 Jul 2021 20:40:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=aEspkNGq; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233588AbhG2DgL (ORCPT + 99 others); Wed, 28 Jul 2021 23:36:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233485AbhG2DgJ (ORCPT ); Wed, 28 Jul 2021 23:36:09 -0400 Received: from mail-qt1-x849.google.com (mail-qt1-x849.google.com [IPv6:2607:f8b0:4864:20::849]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48066C061757 for ; Wed, 28 Jul 2021 20:36:07 -0700 (PDT) Received: by mail-qt1-x849.google.com with SMTP id f9-20020a05622a1a09b02902615523e725so2102866qtb.21 for ; Wed, 28 Jul 2021 20:36:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=7ixzuuNDgee9bW2cjdqHBGkL1CtEaTFP5FgsMVEumf4=; b=aEspkNGqzizfEYcNrjbxGX0q2ARs+gOXklKjvwLsWIO6thb6R5gwsqGaNBAfQOkJt0 s/HHOwuv4fOjDNAkp9LKnhv7oJES+xJl9vrhSfK3oXOcSUbfmpRZ9XlGcF8hTKMxOq/u Y8ftMjle/PWJNKJduJ38/5i0sH+Z3VHIFf/6i4v3+t3Ooc/j1NMx9/Ha9HFHMKTfZSFX MVKgmmE6MrkHIytuiAyGJv2WvFM56KnjTbUYzyTghMnI5AJdyXbLOVQYy//Gmx5Hwt+/ 0t44voPApUws+ufrRm59MENFhcDLlRiZu+Ia0sgsug44I/OhBE2ljjobbHtz1fqfRVD4 5qJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=7ixzuuNDgee9bW2cjdqHBGkL1CtEaTFP5FgsMVEumf4=; b=hPm+wIGlq1EPjKdPFMJut3LcpBMGhD3X8jKBHOcsp4vILqZF4+QcOb5MuUGOBSupBd QWuXFcJMG4HmWQ6ub2sqY6YrmjCSaMc4GBH4YVWtShrPoxPzQJey51RccUb0ToLSaOxW N2bksUXUKG7DMjM402J25hGeqjcSQ2l2rkBiYZtTXlX9+NxhNPy5PRN0bHA23Z23w4Ud 9zygjagTOsKjznHVePs2JqjJ6CuqhuhVHjeRu3nlCDVUTWmpXFr4KB5Ywu2dYsxlje6+ T78ttA6EPGVmF/0XRVyfkOaPOVczbQ/VF+Zp3P9lwNWzFltv5Nbk6pFjZxylCBp4USZ6 c+Bw== X-Gm-Message-State: AOAM532LUIfpqpv8nzH6twYtzZcch2MMeLfBEc0QPTaVMDTq388XX9H1 fxIEPnQvIH9j4XkqlPGqdplmvK32WoI3aTJu4z8jJO95DydBhR5y/CkR/AEuUuRLUyzhdQugmrC m+2OIabyBMHnXVcaOmWFF6lFA/L3+tuvupaowSD0x/8lwAX9TRiT/Yl0Bv4vkiZQ54AtoTCQRt6 waXQAAK1cPtTw= X-Received: from howardchung-p920.tpe.corp.google.com ([2401:fa00:1:10:ff72:1420:4502:fdaf]) (user=howardchung job=sendgmr) by 2002:a05:6214:262f:: with SMTP id gv15mr3334999qvb.36.1627529766330; Wed, 28 Jul 2021 20:36:06 -0700 (PDT) Date: Thu, 29 Jul 2021 11:36:00 +0800 Message-Id: <20210729113552.Bluez.v3.1.I20397b8350f98567b8d52b895442c768250a6ab3@changeid> Mime-Version: 1.0 X-Mailer: git-send-email 2.32.0.554.ge1b32706d8-goog Subject: [Bluez PATCH v3] gatt-db: remove redundant check in foreach range From: Howard Chung To: linux-bluetooth@vger.kernel.org Cc: Yun-Hao Chung , Archie Pusaka Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Yun-Hao Chung svc_start < foreach_data->end has already been checked in a few lines before. Reviewed-by: Archie Pusaka --- Changes in v3: - resore check svc_start < foreach_data->start and update commit message Changes in v2: - remove the entire check src/shared/gatt-db.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shared/gatt-db.c b/src/shared/gatt-db.c index 8bff4d37aaa2..3a02289ce435 100644 --- a/src/shared/gatt-db.c +++ b/src/shared/gatt-db.c @@ -1348,9 +1348,9 @@ static void foreach_in_range(void *data, void *user_data) return; if (!foreach_data->attr) { - if (svc_start < foreach_data->start || - svc_start > foreach_data->end) + if (svc_start < foreach_data->start) return; + return foreach_service_in_range(data, user_data); } -- 2.32.0.554.ge1b32706d8-goog