Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1034714ybt; Wed, 17 Jun 2020 21:44:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwApveq2d5EfLf72BH9SRlJWd/w55P612dWGVNfZbaoLpZnSt1/GjLx7CXKnOBlf4zd4U01 X-Received: by 2002:a17:906:4548:: with SMTP id s8mr2135035ejq.519.1592455489850; Wed, 17 Jun 2020 21:44:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592455489; cv=none; d=google.com; s=arc-20160816; b=C6Rn4CMHy7RTz5r01lcoTJ38TtjlImQynXBktzn8VsIFyqhiyri9i9pTAVB0Qhacci xy1elpJ8cHsYVyGPHGAIEsHt1e5k7IV+Dm2gb8W5Aj3WK7fBL9/EQen5WhZYOP1azHUi aHJ7lXNDcfWUrxrC7cA8xItA2T0xJOMYa1+gDSqyNuynGyUaK4Fny7O2OQic8ikQB/2c hYpnDX/0kLgEcL2WSqkX02KaoRLPSTmYdufwoFmIbBT8uk0GBtUirH/WZt9AMjBJ3l5r LQ4cJBCGQwM9GQwdE71zv57Sfs5IOeQ7eR0W9pzNnBLi/0ErEQw1OJNt4JoYnaaKFAVU pubw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=U8r1OH+uUbWSBJiX7OSVuf0HNyzobipC/Wk5oB6lFas=; b=B9h8jqi6rNYViwhcXbQei0JWMgPmektug1SyJkgdsNNJC6ivQImpParYX2n+O8EIOh ZLNG5BSHCjcRe/L5hEfnNEHDk9Re4Ukc2t3CA7B5O6DEMKHjAo1Aha+026ci/F4Q5i/L sZUP2yfUSFrFA5jBKiMe17raJUhpH/zUvhV9LG8yI9S6qk1/oqAyva6EaifglRdd/5xt lQ6bYEMTI75C7x0rGx2KcTZ8tPtwyAs7xN+T85X7RL9S9geW8g5AuElo64v49J0Hi565 SsAXHUMZLIeAb7vD/0aIM7XJTRfyOLAUSZsqr5ARfJUD8kTnI307ZC2x3Q1dxQMwOslu y9vQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=U64yTdFc; 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 cz28si1215346edb.384.2020.06.17.21.44.26; Wed, 17 Jun 2020 21:44:49 -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=U64yTdFc; 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 S1725912AbgFREi3 (ORCPT + 99 others); Thu, 18 Jun 2020 00:38:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725889AbgFREi3 (ORCPT ); Thu, 18 Jun 2020 00:38:29 -0400 Received: from mail-oi1-x243.google.com (mail-oi1-x243.google.com [IPv6:2607:f8b0:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D19F4C06174E for ; Wed, 17 Jun 2020 21:38:28 -0700 (PDT) Received: by mail-oi1-x243.google.com with SMTP id a21so3906668oic.8 for ; Wed, 17 Jun 2020 21:38:28 -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=U8r1OH+uUbWSBJiX7OSVuf0HNyzobipC/Wk5oB6lFas=; b=U64yTdFcERlATolea51eJ0+cUXCRdO4HCnNu/s2HIiJhvNshQmjDMyyf0ss5RotDj0 JjGFm2wcFpLXUcsz+iZkL01Ob0m+nU0/s8eqWYHvLeAB9dIq1IeF0NjStcUmiutB+rXN 8MtWqFMCNt3skICXQp9YM99H4jlUKfS6JGxN/xGl96Pj0IMomU7qhDSlF60s2OlMq32y 0iOWUQpqxdoTIvs0sjRoFEPAEsoEMw+4LI9dOwF21fcHqhQtW+jArBD5+zAPnWUPcOLM 8R8ijkOT7aVVec786eHJ80UxB6Xe5i8VKrxYyIEEL4kzXIreaU2cJSS/si/fxqmuJNm0 j0BA== 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=U8r1OH+uUbWSBJiX7OSVuf0HNyzobipC/Wk5oB6lFas=; b=kuEnoNDHd3Kl/i2cB5op/M2yLhKrRC1lG8r+8Ky+RAKDJH5Rg6zl67jpKNq1g0jKbh JKP8WMp3kLn99slifW3IGCELHBcrPXYVo/k8hSPNiN2AQOXXViFLSzF7ZaGthTRR5Z2z AlyikXatdfICQq4iHXuEdO2kHESRvYQ0ZhDY/MEXVj1lmFTy+lSPJi+YBQY52IFcyq/n OVn3rF33JPP/kKqT6MKRYPlENx36p2+QIr3P6ZjBC5UkRjkAnNqknx6HTmc8DUzj4Tkl CRGCK70AnVfhuPmUGBxCCsIicguncNGw3oLgeeEnxa4G3kyq09l7PZCm75uIV8rt8k6g D5ow== X-Gm-Message-State: AOAM532WCxCA03VVqS0CFRbtkUWcEqyJoe5f2jzhQW9svs6lOhuQjp4u 6TWipw9GeUZEPnQo16LCbbKNSK7ge9dEAmDGC9d9+g== X-Received: by 2002:aca:568c:: with SMTP id k134mr1500323oib.48.1592455107771; Wed, 17 Jun 2020 21:38:27 -0700 (PDT) MIME-Version: 1.0 References: <20200618014812.234606-1-alainm@chromium.org> In-Reply-To: <20200618014812.234606-1-alainm@chromium.org> From: Luiz Augusto von Dentz Date: Wed, 17 Jun 2020 21:38:16 -0700 Message-ID: Subject: Re: [BlueZ PATCH] main: fixing logical error when loading controller params To: Alain Michaud Cc: "linux-bluetooth@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Alain, On Wed, Jun 17, 2020 at 6:51 PM Alain Michaud wrote: > > Fixing logical error when loading configuration parameters from the > config file. Without this patch, the maximum allowable value is always > used. > > --- > > src/main.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/src/main.c b/src/main.c > index e51f614b3..75ea27f40 100644 > --- a/src/main.c > +++ b/src/main.c > @@ -421,12 +421,13 @@ static void parse_controller_config(GKeyFile *config) > int val = g_key_file_get_integer(config, "Controller", > params[i].val_name, &err); > if (err) { > + warn("%s", err->message); > g_clear_error(&err); > } else { > - DBG("%s=%d", params[i].val_name, val); > + info("%s=%d", params[i].val_name, val); > > - val = MIN(val, params[i].min); > - val = MAX(val, params[i].max); > + val = MAX(val, params[i].min); > + val = MIN(val, params[i].max); > *params[i].val = val; > ++main_opts.default_params.num_entries; > } > -- > 2.27.0.111.gc72c7da667-goog Applied, thanks. -- Luiz Augusto von Dentz