Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1277740ybp; Fri, 4 Oct 2019 12:09:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqyEppHS9ZLj/UgraQc0hGeGMFh88J+nvVkD9HWH9RtdQw1afpWvhuxI9MGNh9V0cqhVHf9k X-Received: by 2002:a17:906:5382:: with SMTP id g2mr13755631ejo.203.1570216159777; Fri, 04 Oct 2019 12:09:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570216159; cv=none; d=google.com; s=arc-20160816; b=EC1hUJ5k3RL5XwteOdAUv7RRg3GcMFI6pGVHx/AznTo/yk5BG7tlamj3/1mgKzbBhV t+iJlHP3GCFGsV/WR1JwMJkXtTE3dCNxvW5pxJzajtWOCrRjpEjcFYoDHAPFTOMQ/lpX EgZNbtMuz+2M7qlESZT9Bu8zHP8BWiEMn2zt03J/oeS7NGOZYRAp+RjpgI8n2uU6TvIs grAzocHSItqcipoGIXsaQUHQnPwJNnsIlrvU78qfVofZM3bXPzMd93jBLXlZG5jfN8im LvFSVusbLY/NMrX5XttFQY2JkjQy6z/eXVJZ5Urak5nn85cpmLJGgzemNQLB08H6XWkQ usbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=jSAtU++PVBYCXKAYrwNYAJeYVpEp+F0NN9PjsM5oeN8=; b=fGMTCO8g7TzoPYI1u/1YUHdFUmH1na2wDFXMsUuEETX24neWONb3D7gj2eaK9styw6 EJNjreSB9SRNQndFvdiOOqZ/75MfydM9eLi7sb3eLUGZATlwX9S54udki0pZFeqYones Q4atn+qaR9hPYLMeYhcJAPXzZ0A7VMITZ8rmH6kkp8a+qSsTSiAnl99jnRBYWrecNS4D 6YGhkJryP7Yk7HTFWzz9jdgRJudk98SHDZLlPXOKNZkf8CZw9+RJHnolW+gG0OHJwEsn 12tzfdhbyhbp+x86rj/S9JRmjGGbMAEGJpyXZ02KwJCGZWDVN46r6pMK9KcooxxF843z wirA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i12si3436604ejj.119.2019.10.04.12.08.55; Fri, 04 Oct 2019 12:09:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387416AbfJDTH1 (ORCPT + 99 others); Fri, 4 Oct 2019 15:07:27 -0400 Received: from mx2.mailbox.org ([80.241.60.215]:29192 "EHLO mx2.mailbox.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730341AbfJDTH1 (ORCPT ); Fri, 4 Oct 2019 15:07:27 -0400 Received: from smtp2.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:105:465:1:1:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id 75A69A015E; Fri, 4 Oct 2019 21:07:25 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.240]) by hefe.heinlein-support.de (hefe.heinlein-support.de [91.198.250.172]) (amavisd-new, port 10030) with ESMTP id 1BbF1m7VL8Dh; Fri, 4 Oct 2019 21:07:21 +0200 (CEST) Date: Sat, 5 Oct 2019 05:07:13 +1000 From: Aleksa Sarai To: Linus Torvalds Cc: Christian Brauner , Linux Kernel Mailing List Subject: Re: [GIT PULL] usercopy structs for v5.4-rc2 Message-ID: <20191004190713.hdfv5h3dppwmz6bs@yavin.dot.cyphar.com> References: <20191004104116.20418-1-christian.brauner@ubuntu.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ybqdhfvvxmbcd65c" Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --ybqdhfvvxmbcd65c Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2019-10-04, Linus Torvalds wrote: > On Fri, Oct 4, 2019 at 3:42 AM Christian Brauner > wrote: > > > > The only separate fix we we had to apply > > was for a warning by clang when building the tests for using the result= of > > an assignment as a condition without parantheses. >=20 > Hmm. That code is ugly, both before and after the fix. >=20 > This just doesn't make sense for so many reasons: >=20 > if ((ret |=3D test(umem_src =3D=3D NULL, "kmalloc failed"))) >=20 > where the insanity comes from >=20 > - why "|=3D" when you know that "ret" was zero before (and it had to > be, for the test to make sense) >=20 > - why do this as a single line anyway? >=20 > - don't do the stupid "double parenthesis" to hide a warning. Make it > use an actual comparison if you add a layer of parentheses. You're quite right -- I was mindlessly copying the "ret |=3D" logic the rest of test_user_copy.c does without thinking about it. I'll include a cleanup for it in the openat2(2) series. --=20 Aleksa Sarai Senior Software Engineer (Containers) SUSE Linux GmbH --ybqdhfvvxmbcd65c Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQSxZm6dtfE8gxLLfYqdlLljIbnQEgUCXZeYXQAKCRCdlLljIbnQ EgXGAPwLt+yoG/AS/EPKRhamvIpGZEPcAdAFQfAtdZ1RgIK4IwEAsk6taEl1FsU8 WixwP71Fw/Vosc97yiFLGAUdqXLmtQo= =o6hD -----END PGP SIGNATURE----- --ybqdhfvvxmbcd65c--