Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4555798ybb; Tue, 7 Apr 2020 09:42:51 -0700 (PDT) X-Google-Smtp-Source: APiQypKc06SbMBEUvLef2CWWFsbwiCIh64aJurNeYFi/DpDR8h80R9pabjsqHA+SzANgi2FRfpAY X-Received: by 2002:a4a:1882:: with SMTP id 124mr2638351ooo.60.1586277771544; Tue, 07 Apr 2020 09:42:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586277771; cv=none; d=google.com; s=arc-20160816; b=QadLHKnZ78h1yWbf+bZzK4xvPcG4HBdwb+rPWNr24gk2CNEgG5KQjv8YjgfRFmL5bZ SpOs7N/LxAWrz9a6BSFaPevt6WpMyXWSncOdAiTnZfYmnf+wHApgM20vZzCkRyjImvdU 4vWJBHeMY4lRkKwy8MkUMgFKX98586vY2JAqCXerWa2ed0dPxaOFQVvNTDpUMl1SAMXi BE07j/diqhUe7+xBr8FUtDsSw+9GzJr2p24Ops9cQKjL/x/hsSp1x61CwQzS/ok7gNiq UxnRCViFx71ruJ/G5z9y4PtnU3mwhmYX05lVf+xHx4eh1bRhTotUFvpDW5+CXLTv90uT 9fsg== 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=7hiKdD2CXh3pCaRz4/0Mf/AO2XuDJSsEVnArneEbaZI=; b=tS65/IfqUnifn/ae9Abyr5FkSxbRUKDTyNQ/5zTsygbFfKZrm+c9K0Dzi3qOLB29Ae bNfkXzlLyi4BUyFZx8ry4LGE1zQW4NaLYgX7cWXOFjSehyAiFXqTXKWz4411RLlqW/8d z19iNDU6zrmBAC360ALABoI4l3JZbMvUF4lmGCiSJblisYPCkX71YQzMlxl+Z9K+CZRf fs5CgjllLZ7msBHAcTor+XfWXhgimysgCn9BkJfK1ZZ1HdtQgjWz52T07SVeS1eBG5zY SjpFBtSUOiGT9SAv6mMSSY7heaRwkaHdb4sT+uAiiSew7McVdafXcLKJucbU7i4FCV/6 qrHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="EvZP/6cY"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t25si1366380ott.228.2020.04.07.09.42.36; Tue, 07 Apr 2020 09:42:51 -0700 (PDT) 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; dkim=pass header.i=@chromium.org header.s=google header.b="EvZP/6cY"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726873AbgDGQme (ORCPT + 99 others); Tue, 7 Apr 2020 12:42:34 -0400 Received: from mail-ot1-f65.google.com ([209.85.210.65]:35788 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726910AbgDGQmd (ORCPT ); Tue, 7 Apr 2020 12:42:33 -0400 Received: by mail-ot1-f65.google.com with SMTP id v2so3820315oto.2 for ; Tue, 07 Apr 2020 09:42:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7hiKdD2CXh3pCaRz4/0Mf/AO2XuDJSsEVnArneEbaZI=; b=EvZP/6cY04quyI8OEzNsb9Z+Y2lsABm+s5SScmPPWQU0W+V23AXdR1Hmzf3TAQ6K5d q8Z20W1SJXfjCbtx2bQ5wqxvlytFlPft9W72Lb4kwF7ynUkFyJUHzLJAj2LgPAk8dkcY DQpesP5NYcbk+wfA/yVV+/tPfgSCndZgL1lF8= 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=7hiKdD2CXh3pCaRz4/0Mf/AO2XuDJSsEVnArneEbaZI=; b=Zy6kTXJ+5gZ86HCsPrAaSXeTpmWQgtCkCbc8VPfmGQNBvl/j0vhIUIq7NDtisFo4fx gEtYVqizR25487Zq/ixAT2dRnvfmvuf4oFP+karAS7R/m3cEnoOP9flIPTALbz1vciEO EgbvvcIO688AV1wzHzdVthYcxNtt6jiGFiHAQb8CPdcIwSI4ik38srKvoHY5P3cB6nzg D75h8c4NR4leFqk1Puq/4iy++LrlXEfY9MiqfVqRIyNfq2tCduHdYkDO2vj6xSXBtdHK JIl2BSWsMmy38MGCKfh8kynavpuA0eaBoayCb7Si5E8/Xah0dlozNNeTR30cD9sF3Yx7 UNFQ== X-Gm-Message-State: AGi0PuZP6mMCDDeXAv8LZLFc6nhqTu/GxDECZtmyr3gP06CsGLILAZ+v 6S9+fKDEyjKyq39pzoAXnKcGWu5Xkfe/8E8o3t8RpQ== X-Received: by 2002:a05:6830:2017:: with SMTP id e23mr1480499otp.329.1586277751615; Tue, 07 Apr 2020 09:42:31 -0700 (PDT) MIME-Version: 1.0 References: <20200406184523.GA49680@roeck-us.net> <20200406185438.13576-1-sonnysasaka@chromium.org> In-Reply-To: From: Sonny Sasaka Date: Tue, 7 Apr 2020 09:42:20 -0700 Message-ID: Subject: Re: [PATCH] Bluetooth: Simplify / fix return values from tk_request To: Marcel Holtmann Cc: Bluez mailing list , Guenter Roeck 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 Thanks, Marcel. Thanks, Guenter for finding this out. On Tue, Apr 7, 2020 at 9:35 AM Marcel Holtmann wrote: > > Hi Sonny, > > > Some static checker run by 0day reports a variableScope warning. > > > > net/bluetooth/smp.c:870:6: warning: > > The scope of the variable 'err' can be reduced. [variableScope] > > > > There is no need for two separate variables holding return values. > > Stick with the existing variable. While at it, don't pre-initialize > > 'ret' because it is set in each code path. > > > > tk_request() is supposed to return a negative error code on errors, > > not a bluetooth return code. The calling code converts the return > > value to SMP_UNSPECIFIED if needed. > > > > Fixes: 92516cd97fd4 ("Bluetooth: Always request for user confirmation for Just Works") > > Cc: Sonny Sasaka > > Signed-off-by: Guenter Roeck > > Reviewed-by: Sonny Sasaka > > --- > > net/bluetooth/smp.c | 9 ++++----- > > 1 file changed, 4 insertions(+), 5 deletions(-) > > patch has been applied to bluetooth-next tree. > > Regards > > Marcel >