From patchwork Tue Jan 8 21:41:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 10752891 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 80DE191E for ; Tue, 8 Jan 2019 21:42:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 641F128E52 for ; Tue, 8 Jan 2019 21:42:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 583AF28E8F; Tue, 8 Jan 2019 21:42:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EC9D128E06 for ; Tue, 8 Jan 2019 21:42:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730212AbfAHVmC (ORCPT ); Tue, 8 Jan 2019 16:42:02 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:34119 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730180AbfAHVmC (ORCPT ); Tue, 8 Jan 2019 16:42:02 -0500 Received: by mail-pg1-f193.google.com with SMTP id j10so2321308pga.1 for ; Tue, 08 Jan 2019 13:42:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=Cw0/EpUkh9KIoCMrbNUz1HGkKPdSPNaGkVe871n5XU8=; b=U7iXYpNRREIOeW2oMzWP/kHPPqpauR1697z+P23GO8OuazXmxtXT+FxACGGmT8RS1v qq/4uxyhsInTB+btOSN1CjaFQFHJqkp25IGrOkeD2P9knjoZE3F+asO9crDQhl6mBFQj 1vMXkXVpN2H4BXc5n8K3Ujn1aMDe3jfx9J4fc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=Cw0/EpUkh9KIoCMrbNUz1HGkKPdSPNaGkVe871n5XU8=; b=ju/Wq9/4aEdxKntdZmk5w/tyNM0P5l/GHSI1kL5+6Qfbj4myyBERSz8On1Nq89VXxr 9hAdm8n12EMNIVElPan2AMHXBdpTgRCPQkjont9/RlplRm42wvLNGj6RrxImBT9OlmCM VjiUko8/vz5MkC0QIOO64Y+vil8hVX99rIYrbWNIHwNYuT+gAswGO8aEH9fw4RANO9zs Nfql///+BhqDLePmTvQCg3fs6Sw74cTDbB1F3eKJkft6eB8xAIhLOp3b8sQyUk8eXeNN rh1QWJoDIiuBSZo4My0a7np1OP4BwStw8SbFxK6WKJdL26TPw1NxLOCLMagkphDdW7wj GbYA== X-Gm-Message-State: AJcUukfiRtuDbbCOxMinAZkqfZ+n6kRZohWPnWdmpe4FSzpWzZinvJLs KiR8hUvCmOlAVbVOU5/qc2Rnjg== X-Google-Smtp-Source: ALg8bN4YvvVcTD7TFj49sk/jzPzNo/ABtxkSzfr5SUgPIKvI3MHCdbt4PU/bBJ3xtZoFCTuVBPvtpg== X-Received: by 2002:a62:c683:: with SMTP id x3mr3337449pfk.10.1546983721478; Tue, 08 Jan 2019 13:42:01 -0800 (PST) Received: from www.outflux.net (173-164-112-133-Oregon.hfc.comcastbusiness.net. [173.164.112.133]) by smtp.gmail.com with ESMTPSA id k15sm115945904pfb.147.2019.01.08.13.42.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 08 Jan 2019 13:42:00 -0800 (PST) Date: Tue, 8 Jan 2019 13:41:59 -0800 From: Kees Cook To: Shuah Khan Cc: Dan Carpenter , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Dave Watson Subject: [PATCH] selftests/tls: Add {} to avoid static checker warning Message-ID: <20190108214159.GA33292@beast> MIME-Version: 1.0 Content-Disposition: inline Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This silences a static checker warning due to the unusual macro construction of EXPECT_*() by adding explicit {}s around the enclosing while loop. Reported-by: Dan Carpenter Fixes: 7f657d5bf507 ("selftests: tls: add selftests for TLS sockets") Signed-off-by: Kees Cook --- I think this will fix it? --- tools/testing/selftests/net/tls.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/tls.c b/tools/testing/selftests/net/tls.c index fac68d710f35..e1472b8b53f3 100644 --- a/tools/testing/selftests/net/tls.c +++ b/tools/testing/selftests/net/tls.c @@ -202,8 +202,9 @@ TEST_F(tls, sendmsg_large) EXPECT_EQ(sendmsg(self->cfd, &msg, 0), send_len); } - while (recvs++ < sends) + while (recvs++ < sends) { EXPECT_NE(recv(self->fd, mem, send_len, 0), -1); + } free(mem); }