Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4876247pxv; Tue, 27 Jul 2021 19:55:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwoHs/9X+qM/whEgc/U5pjn+mjTcXedNrhDFPnXIkyPpghe8jNJdTBnjkrfTNueKBQFxSJ4 X-Received: by 2002:a05:6638:1907:: with SMTP id p7mr24414889jal.93.1627440920016; Tue, 27 Jul 2021 19:55:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627440920; cv=none; d=google.com; s=arc-20160816; b=a+MEb7bnmtCYUcbDpy6dzDDi/a7JJguuC5l5liWqIl2MmWmzyVgJxSEZearVMbUC6f NosHsLwGSxhrZp0jiY7a3768aLO4MMDbavROJFqYQlGv8vNG4OeXUj5CsuRKtx5ZKpfL jzXhvsYmC9C22j/0v10erfTJWEIN1tvVqDcTvfk7n9vCUyWNZCyBZMz5jf3yb/CtDF+e kf4TZHgRlxm0Sqy5Ia81+YGbCWKRemaJXceCvMoNlj3ewLZRywZ4fItfVSc73n/oy27V 2nA6UOyN1ijbza9zj5vFo6BYfaUCeehWJw/1m0zXj5a8yJP+HyKKehxgCiu1zsPfes/e pwbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=9qYDMs2XTON7ybP+Shj+uBDG328o8Zqfjwf23OOzdTY=; b=lcj3/CfJk4Sn1AcKklJfpYcYvHX7m7Xj8HF9ug6+yYV7JRMoZVY/lnEt0UMOH3gxAT BaQJVoBssOn7RPxDnyyCO7LDO8sXtjmWghZQ90C73fBk78ZMwAet6e/G5YR0z0Bm14ZC 3qJMULQcv2XF+h1xp+KQdtp+InxeSxqFm4LfYICShlKEMDap6JZ8FCESpqTRof4R+RAR pVhOdv6HWHm7ALEdvs4uN3BDP41SnMRdE0lxsjf2Q7tebmP7jGZ+WvDWYKCSHdyDwC9u 4pAJQubqiPSoUxV0lY4g3MQm1EiiLkgDik4wFW82UaC5qRrJlWrKjJ+UrWHEzdG1qO7S q0Kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=YSVHuDLc; 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 d18si5034147ilo.140.2021.07.27.19.54.46; Tue, 27 Jul 2021 19:55:20 -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=YSVHuDLc; 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 S233484AbhG1Cve (ORCPT + 99 others); Tue, 27 Jul 2021 22:51:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233223AbhG1Cvd (ORCPT ); Tue, 27 Jul 2021 22:51:33 -0400 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 898B8C061757 for ; Tue, 27 Jul 2021 19:51:32 -0700 (PDT) Received: by mail-ej1-x62a.google.com with SMTP id gn26so2138341ejc.3 for ; Tue, 27 Jul 2021 19:51:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9qYDMs2XTON7ybP+Shj+uBDG328o8Zqfjwf23OOzdTY=; b=YSVHuDLc0WZaVrJhoF3EPZU+1q9OplniUvW3dhy3MEwv15E0Hwv0IR3Zjqul1pJHly ezlFzuYrtCVZ+NNqWKo7TnpbYj1eS3Vob1GBM/zHX5lYOBnQSD8EXY5hftKdM1y+/PDt P1fe201a5IzZbshVOJcRJqlk0m080RItEDsh/8vdPQA4oPxQ8SJVNGYcCgO8Nn2lAcf7 yItaVP4me4a9Zg5qXHvJz4OrC8HJt7vnqKz3iWowRLA0uUkFKO29RaavlY5dU/uYRM45 masF3rK6ow5Vh/Sp3EKlHKWJJdSil3GQ2PMxPhugu4fmdDVmaCfmC58RWAUi/ld+SKUK +2KQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9qYDMs2XTON7ybP+Shj+uBDG328o8Zqfjwf23OOzdTY=; b=mos/aLMKt/Ju8dd0WibSglZuLEt6U67HXIslRbeoskT8cuput4Ytd9vSWnL3rqKCLB qHQn4124vHoE5GC5kR0hk36rQInu126kLB/VzkVYqrkyeQ187/TJOgTUI3Jz4Zv7+t1s 43xeBTSvCLwZ+feP3Cds00fWZ0mJ2sDh05J9UTjtmWlk7EnF5xkWRnVtquSgG1LAwe23 n2aWKXINyPe8/Z/MoXsOC9FEyoDxWOqkX/SHPJaCa1fBMHtJoo0WrkEVoCJ4FqCIsyD+ Oamizvl1QnxxKd3gXqCvCzyY+csAa3WdKbv4WwiKV2+UZSh6xW2WOVM+BzeN1OulUeYS ZgKQ== X-Gm-Message-State: AOAM5335shRboRzgIUd+iR0LrgOmLDQLM4b2UpbX7B29KZWr6xApUHhp s143t7KjE299XmSYs4i1l181LgWUfhaaxcy1Z5Bt0g== X-Received: by 2002:a17:906:8a98:: with SMTP id mu24mr13389735ejc.404.1627440690910; Tue, 27 Jul 2021 19:51:30 -0700 (PDT) MIME-Version: 1.0 References: <20210727195057.Bluez.v1.1.I20397b8350f98567b8d52b895442c768250a6ab3@changeid> In-Reply-To: From: Yun-hao Chung Date: Wed, 28 Jul 2021 10:51:20 +0800 Message-ID: Subject: Re: [Bluez PATCH v1] gatt-db: fix service in range check To: Luiz Augusto von Dentz Cc: "linux-bluetooth@vger.kernel.org" , Yun-Hao Chung , Archie Pusaka Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org > > > if (svc_start < foreach_data->start || > > > svc_start > foreach_data->end) > > > return; After discussing with Archie, if we understand you correctly, we think this early return can be removed. Let's say the searched range is 5-9 and the service is 1-14, then we should consider the service is in range. If we want to keep the early return, svc_start > foreach_data->end is already checked a few lines before, so this check is redundant.