Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4269331pxv; Tue, 27 Jul 2021 03:11:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy9XNlahrI4Y0t6bxxnLCB/2w+4JBakIH5PM0GcfOMSdqbs9mo/YV2Q0UI5UKAJEUCMCyZA X-Received: by 2002:a17:906:1299:: with SMTP id k25mr21230317ejb.139.1627380697550; Tue, 27 Jul 2021 03:11:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627380697; cv=none; d=google.com; s=arc-20160816; b=Y422JteKyYlJvTJeE/BPZ+a0XgVB786XZ6bVyz7gzcQbLl2VeGevpASOFd3tUDtK9i Qfh3ZuRzW/f7IBf6KGwsxEoTiigRyi5uFCqydMT7sQSoWphXaExAjdqMxjkohbt1XbXq VbJc05wiPA3LNviVxi0z19Wv92lw2Bfr8ZAbqWVfU/WJ7qAb+SDCBwQehPH0ezeB356j cVKnqdukQ+MlMr2ZmFjOmHfgc26Qa1za95/CZt5DphHMllD1/qHZpv59q2nPzIflHwGd 6FQp7AdQZpaVtuu6XWj71y4XfUUTlqloD65wrO4dVZsSUoWMlzwMDXl84Gb1BIyA1iqN IoJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=/tEURk6nW7v964anxg8zEY/p89cnWYw1h+iWuoDBfmA=; b=Reaf1ExfSitgXDHWDc6VD0erDVls9ehIRSgWRuN9Uvkbjwqw2j4RNWJfUfsw0vLbJW jSE5SdXDW/AeHW4kmJy5I9onKkkLMkQyyab6iaZ2Fzt5AbB+vsSsgZXDy75TvDD0Lv+g XsOkY12iwqzQ7mBbXFo5ETc6uFrTY1P5z32Nff17/QVgAHvDBHuCrC6+z5t+3aM/LNiq 3AI48QyKr0ek12EdyleNt1PtWjn8iosyAa85hz43mf8CXZzuUammrwZpU2dHqCGe0ADI Xf0mRKc+W6R/lLnrw+t3lYtU3R6EDeQVrrTrS7maEaQHomRArAkL+9mSvpcIo2TErwZC np2A== ARC-Authentication-Results: i=1; mx.google.com; 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 lk10si2296909ejb.499.2021.07.27.03.11.14; Tue, 27 Jul 2021 03:11:37 -0700 (PDT) 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; 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 S236169AbhG0KHn convert rfc822-to-8bit (ORCPT + 99 others); Tue, 27 Jul 2021 06:07:43 -0400 Received: from mail-vk1-f170.google.com ([209.85.221.170]:43951 "EHLO mail-vk1-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236046AbhG0KHm (ORCPT ); Tue, 27 Jul 2021 06:07:42 -0400 Received: by mail-vk1-f170.google.com with SMTP id f4so2647705vkb.10 for ; Tue, 27 Jul 2021 03:07:41 -0700 (PDT) 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:content-transfer-encoding; bh=FCUItsUrNsIOTE4P27lKrABY3CasfpkaGPUBOlpzuIA=; b=l5cbLd0rlEV7fZYYmBg0uGIZpN3otccZX7MlUkd0ToiAwyDqmBzd2FxbNP4NYbuRdz 2gz3BLIMIAHnXLq1cdMGfvoSwNRH3goDqob5RGVu+1Tg1YQePb6ufIlVamBOH6ToqTU6 cY6cXgx9qatgH0E89b8jCzp27jRqIBBN04BSfPBWpVwpjLReT5hqlAcGXb8ADFqAdcbs BFJes9JTX2d9UV+AlyeuWfoEXqq2/FveB0mVIWgU7SYgnPTBqJe6/1SZJ8+6UoY27JTC WY54hpgD6IhJCdDdyylJKAjP47+iDI0ILoeYEy71HfJ/xHh0g8HXz5O4qvv6M/Dir0M/ CSmg== X-Gm-Message-State: AOAM531W/Oc88GMfuEn839+Lu5W4SM38ay/jobTUNCZqBbZ/MqGcbx/Q uSPD5ruaNDF6TD/IwrixMutSwCiKmRowMdT3MoznlCE5xXM= X-Received: by 2002:ac5:c956:: with SMTP id s22mr13658214vkm.2.1627380461341; Tue, 27 Jul 2021 03:07:41 -0700 (PDT) MIME-Version: 1.0 References: <20210727080840.3550927-1-u.kleine-koenig@pengutronix.de> <20210727080840.3550927-2-u.kleine-koenig@pengutronix.de> In-Reply-To: From: Geert Uytterhoeven Date: Tue, 27 Jul 2021 12:07:30 +0200 Message-ID: Subject: Re: [PATCH 1/5] nubus: Simplify check in remove callback To: Finn Thain Cc: =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= , Greg Kroah-Hartman , Linux Kernel Mailing List , Sascha Hauer , linux-m68k Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Finn, On Tue, Jul 27, 2021 at 11:50 AM Finn Thain wrote: > On Tue, 27 Jul 2021, Uwe Kleine-König wrote: > > Apart from that, the compiler might already assume dev->driver being > > non-NULL after to_nubus_driver(dev->driver) was called. > > I don't understand how a compiler can make that assumption. But then, I > don't know why compilers do a lot of the things they do... It is one of those recent optimizations people have been complaining about. Once you have dereferenced a pointer, compilers may remove all further NULL-checks, assuming they can't happen, as the code would have crashed anyway before due to the dereference. Good luck running on bare metal with RAM at zero ;-) Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds