Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp8532090pxu; Sun, 27 Dec 2020 09:44:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJy5SrTMpibx5LUyeFi0oKjgmqe7XzhVtVnAjhiUOT8n0x5TsDaURZgLz/iTUqjcnjfbl8yR X-Received: by 2002:a17:906:d209:: with SMTP id w9mr431718ejz.211.1609091097646; Sun, 27 Dec 2020 09:44:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609091097; cv=none; d=google.com; s=arc-20160816; b=Qex5w0L7JoS9NxxnB0Z+UCu/k0dksN8lMk/zlojpK7fNhey9QAYVIU5RJjaI/PcTDc KpsFEueH03Wqyg4VQh/3U+CJgFGkrp+adTG/hXAEmL5L2OR5AF7dRDgGlOmIwFs7qIPC hh/AasEqE/OHJvasb4Gco1h2c3K3A3anaYjY4c4YOtfW6ssb8gzzTALjhyYlReaKzLGA RyICSm8KCeJbLvR+b1YkCGsqoH0Of/8QMVCINZT7/sKGsGWFWib+WstuivNyLcGDxStk 5G4b63te/9/C4N+BNR6aQQUWYDsqQTvmOZyA9MgZjlmB1pDwz+A5kBNezzTV+XCS3iNb Zz4g== 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=p9PMQ/TAeRGjobkyaAFCUk6MKMTfvyJDIgZG9GbnId0=; b=PMa0ph7C+TGmpbH2RrCwpCJ8dzOd468r40+YP+2Clf4Jrm66LWkq+YUQhHg/p+w35M RwAUP1QUR5ekPhuylazyKe22LXAe8NSKJZU9Hr6YHHGA6kkiaDPtd31JmA3/wWiAXcog y3sNTNRz6TO87zpfek2bLpy+ynxLueCcRrGIin3MVVfiFqq9UTkl82GKgrMml4Iz9O0f OYKvYDWfmPLdQCgSG/s12MVFQMMVaxKNhrlbaz/5VzGwpQ8Wh4oJ81sYfbxjzIScaSsW IVwG19Q8v0jsuFe0TfD7k0nXGldJUT/NoUwDgSQ09VjtC3y3xjKGBz9ZZ//c3kNx8uuE uZKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=gOMY+9UC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d7si18950765edx.507.2020.12.27.09.44.35; Sun, 27 Dec 2020 09:44:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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=@linux-foundation.org header.s=google header.b=gOMY+9UC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726499AbgL0RnG (ORCPT + 99 others); Sun, 27 Dec 2020 12:43:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726230AbgL0RnF (ORCPT ); Sun, 27 Dec 2020 12:43:05 -0500 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14CB2C061794 for ; Sun, 27 Dec 2020 09:42:25 -0800 (PST) Received: by mail-lf1-x133.google.com with SMTP id o19so19429728lfo.1 for ; Sun, 27 Dec 2020 09:42:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=p9PMQ/TAeRGjobkyaAFCUk6MKMTfvyJDIgZG9GbnId0=; b=gOMY+9UCPB4zZdpNxZuOhbzFUQzGl7lDS9CszpT+SwhotLpEvlsNbHQXlu8d/gErJR nc8Gc7OyxMPE+7aPZEI5iV7aVfkk4oqC2irAkQyHF7mozUzqIRKCWb748i4R0jGsh1NC MlzaZIk+zpGh7WYrtSu4BnfX/iYb1ooa+Q7+0= 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=p9PMQ/TAeRGjobkyaAFCUk6MKMTfvyJDIgZG9GbnId0=; b=Y5pvBFi6gCRKFh4+ZNYeoFI1SErWn+F+bYizg2HIzOdcoxTeelHSR7jByrTad8lG5W nvNDQbe9ywDzdr3PolfQ7YmNXit5gnAJZxkRdgb+jONLrbArXomoOtf3VZj1nKGG9nw+ XYitJQ3IFFPUL3FVIwBnre0MFxz+MTcXgzqvVIzF+e7R3m8nPWEbfbRJf6rC+O+zUC/4 BtWeCTObdQgQFDPPcegqbUXeG3QkISZ0c/I//3B7i6KgIYqzpblo49zgORn1ce2Y3hEs 0PmSU+36/SE6wRp5Lkn7umQiCcGDn4FYhUGGXFnbeqkWMHn/muZGtIMV8A8vYMOl0ZHc D+MQ== X-Gm-Message-State: AOAM530YrC6o+S2h8pNV5qzIT+GtiH4eSIsr7M8RoY7FxuUVOUh38WJU PDOK3qtsElkOwcRUz2+95IjUACsXWZi/ZA== X-Received: by 2002:a2e:6c0f:: with SMTP id h15mr21481493ljc.305.1609090943285; Sun, 27 Dec 2020 09:42:23 -0800 (PST) Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com. [209.85.167.50]) by smtp.gmail.com with ESMTPSA id f25sm5085155lfk.291.2020.12.27.09.42.22 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 27 Dec 2020 09:42:22 -0800 (PST) Received: by mail-lf1-f50.google.com with SMTP id m12so19354105lfo.7 for ; Sun, 27 Dec 2020 09:42:22 -0800 (PST) X-Received: by 2002:a19:7d85:: with SMTP id y127mr18449847lfc.253.1609090942043; Sun, 27 Dec 2020 09:42:22 -0800 (PST) MIME-Version: 1.0 References: <20201227141638.GA11393@athena.kudzu.us> In-Reply-To: From: Linus Torvalds Date: Sun, 27 Dec 2020 09:42:06 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [GIT PULL] NTB bug fixes for v5.11 To: Jon Mason , Dan Carpenter Cc: Linux Kernel Mailing List , linux-ntb@googlegroups.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Dec 27, 2020 at 9:38 AM Linus Torvalds wrote: > > The thing is, "PTR_ERR()" works just fine on a IS_ERR_OR_NULL pointer. > It doesn't work on a _regular_ non-NULL and non-ERR pointer, and will > return random garbage for those. But if you've tested for > IS_ERR_OR_NULL(), then a regular PTR_ERR() is already fine. Side note: no, standard C does not guarantee that a NULL pointer would cast to the integer 0 (despite a cast of the constant 0 turning into NULL), but the kernel very much does. And our ERR_PTR() games in particular already violate all the standard C rules, and we very much depend on the pointer bit patterns to begin with. Linus