Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4904352pxv; Tue, 27 Jul 2021 20:56:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9OUuRVRHXnR1ARykwz+iwZ1uShkH0ddxwR3Y4P+0WjU7vRYiFl10ZKvRuTNKPu5Wa2VgG X-Received: by 2002:a05:6402:60b:: with SMTP id n11mr1957419edv.235.1627444599410; Tue, 27 Jul 2021 20:56:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627444599; cv=none; d=google.com; s=arc-20160816; b=oOfPyzGQotHjc9tpevoS6NYAPHiL83LN5ypvyU0MX53Wfp4WuuStOf4ttqvdtYMbTY VN2C7JEmbN5AICfN24DpcqSNTPQld3R2kUz2vvKpHFC03IMB4bvu1YrDtltzq2YJwP1D IzZvwGnQoXk1ra/t2eqjzy4CKXGKgc1oI6tvREUb1qRo8fIJJNagUSGfQRZ1YhHd7Ou/ hm6Hbv6wTEX8qfMkE6IRRNqQzelvQVQU/UUlXZew8azsBqPC5s9W1CJknieCU1NngqQd 4vzTCvaRC7z59/7lxWdhrQAyRKIsP5l0cXUVDCTVAH1diwMty2Ih+kOdoSbHgMlqu9Hx CUqQ== 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=7yLswpzYHDCXz+EWPkvScaUE1+rNjEhECzCfivl2Ptw=; b=tH2ZnCtviBlhvFCZAc2aldWSBmYSauCiPXGIbKWB74rLN+aEW5DcVPdAgCLm/qgKMW TlL6akLji78/YEU2yEyLZmfS+XQMOL/GHPdarZLBBMRXuZt/9gtEIv6jpdFBnVRhN3vV WQeVdtmPj0o2Ooqeu6Cb8X+1iO7lnxfafibY25kxw054m+EiMzusJQS5w2dTJ3ekbWbP nzO525ujDAgWegRWEnGiBkDwKy1fHXmkUmPqG5tZnCNHEFjelALU03bEgJPRJTdhg0Zl 0QYlgAnA5PLquFyhQcw/XM1RrdorUMwxaZoZF8Bd3LVy1hWoIJ5QXfJAfvSxULLW6fhq PrTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jZzzMbaG; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ks1si4595631ejb.49.2021.07.27.20.55.54; Tue, 27 Jul 2021 20:56:39 -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=@gmail.com header.s=20161025 header.b=jZzzMbaG; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233567AbhG1DyD (ORCPT + 99 others); Tue, 27 Jul 2021 23:54:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233437AbhG1DyC (ORCPT ); Tue, 27 Jul 2021 23:54:02 -0400 Received: from mail-yb1-xb2a.google.com (mail-yb1-xb2a.google.com [IPv6:2607:f8b0:4864:20::b2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5B7DC061757 for ; Tue, 27 Jul 2021 20:54:00 -0700 (PDT) Received: by mail-yb1-xb2a.google.com with SMTP id d73so1624488ybc.10 for ; Tue, 27 Jul 2021 20:54:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7yLswpzYHDCXz+EWPkvScaUE1+rNjEhECzCfivl2Ptw=; b=jZzzMbaGj5YInVGOZapxXeJbad7wPnUbNBkqCLSySoD+ZCcAILsFniM77vTa+5i7hH mgKzwfMAgsL8Mr4W733q9uPr/2NrIldKZMW9dNEqrvbe44/GxbWO8auURfhn6MBftPzD 0ZHM6DT8psSry7n9198DLKnqoxcy3xBVkGF3b7AigugMB+IwASrv3saKZSb81thvIXFV 1hAZfGxh+ZetxdA9LlIiLrgEGK7DukSo4lwXB4KHY5j6W1Drh5/S5PYeLFu9C5DYN/vP xI3ObB5DfhZ1833jemNHMmslks0VwLcNuB3A4uMukGR3F5MHGbnIooShM+HJAmcTJ2R+ 9uJQ== 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=7yLswpzYHDCXz+EWPkvScaUE1+rNjEhECzCfivl2Ptw=; b=qgknxtnf1Wa5+rjByJWMz+it8XqXLznIkJ0WbgvcNTBcsbOa7oouwgXf7Nw12rO6eQ owIwZPPzPEiwVSktnRHA4ZD8SMgCLPO8w9HxeS4xOOeJCeg1FFLyg4jC3rUdhb+cOmrn xvaXd8iD980a9SxDVBQX6vkASA7qgDKlcB6wkcW6xAmZREtt1x8LHInldvRVtYaWzu3P qey4rKh0qJsV9EozFWch8LwHIxDQUex6cBRzV3W8zRutTVDUOdIMFu2mW5XUUXG9Yr80 3zHHROFh8lD7Ih59aPm6dX+cVrlctrD3/NFNZ+KTqUQINBOYz7ZWwxBCsADelycEtbGQ KHQQ== X-Gm-Message-State: AOAM531KUxbegiXGi1iXmT6klePgtgJHJIYV38IN1Dcbzcb1uRWATDuJ 8LZsajrhThF65S26HAsK9WPUZ+FmRIKnYKCro+I= X-Received: by 2002:a25:be02:: with SMTP id h2mr36492093ybk.91.1627444439837; Tue, 27 Jul 2021 20:53:59 -0700 (PDT) MIME-Version: 1.0 References: <20210727195057.Bluez.v1.1.I20397b8350f98567b8d52b895442c768250a6ab3@changeid> In-Reply-To: From: Luiz Augusto von Dentz Date: Tue, 27 Jul 2021 20:53:49 -0700 Message-ID: Subject: Re: [Bluez PATCH v1] gatt-db: fix service in range check To: Yun-hao Chung 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 Hi Howard, On Tue, Jul 27, 2021 at 7:51 PM Yun-hao Chung wrote: > > > > > 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. Yep, that seems we have already had the same check so Im fine dropping the check. -- Luiz Augusto von Dentz