Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1423968pxj; Fri, 21 May 2021 14:02:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/GgwefDHZEYownh3tizcfvHk24i/DaFMYz00kPKml4ylPMIhc0jveIa9tRt9CPMx2KCnf X-Received: by 2002:a05:6638:10f:: with SMTP id x15mr7156970jao.119.1621630935791; Fri, 21 May 2021 14:02:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621630935; cv=none; d=google.com; s=arc-20160816; b=NgTrVCv07Ertcbo2VhnV8RbRo8aP7xARWJxDWSD+gK9G+8FlQMW2vNi0SLKerP1bcu bf5YRcqlhk3Lkhfcm/RTxLa0UpfsSwp8PdfwxD8DQSz+WOd2yKKY1NcA5VgWMNBMci6K YlvVbrEVy7zXMdF9I6X0RP1V00GnMsiXmAcngEK6/+Lxu0TdXhs+/LaomUUrgyEO2PKr LsI6ii56yqe9bpiVTHLqO/BHQx+Fz3roySEicXDbuZI5rQ/aPTZnTmsAqyodptOaB4Iy CzSjztkzq534+h55biQ7a4alUYr6ril8srzjbWoUBKv3YRV1atu51bO+baGKLElEHBSS yscA== 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=RKJQFlbNOnxfAGQolBfqaP4S93vmXU/qq5oY6hR9n1Q=; b=y9cocH7/AoCWN6jesLasgUUJw4WzbFU0arBgw1wMS5O7UBYekWk0FT3IhXZ/XwSuR7 MhDDCrGChd5OsNAMGmi8+u8+zeirzhcuLpzYy4PvI8R0inuhb74Bfwhp8n86hQToJ9zC eSl5ZU/kAn/6Uk/uYHYNBdrBgd7hl+mKS7Hs+KR9PJ6eJ3/3KNOyVMIvbYnO5OCIQX6l iDXOp3cahy4kQIlxtpoM+/PmTCxca3czTVZQznGuyWTthlTeUW18JILGUqDRaJ2eDkZv Jtn3eAOXSOnNSRso+ZR58eTMK4jllsvUHqDLVFRplRvi54qimYTtAhVCIpZSGBNuTr66 9ZQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RjfImzc3; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x23si5729929jab.92.2021.05.21.14.02.02; Fri, 21 May 2021 14:02:15 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RjfImzc3; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229597AbhEUVCF (ORCPT + 99 others); Fri, 21 May 2021 17:02:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229979AbhEUVCA (ORCPT ); Fri, 21 May 2021 17:02:00 -0400 Received: from mail-oi1-x22c.google.com (mail-oi1-x22c.google.com [IPv6:2607:f8b0:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46CF2C0613ED for ; Fri, 21 May 2021 14:00:36 -0700 (PDT) Received: by mail-oi1-x22c.google.com with SMTP id h9so20929030oih.4 for ; Fri, 21 May 2021 14:00:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=RKJQFlbNOnxfAGQolBfqaP4S93vmXU/qq5oY6hR9n1Q=; b=RjfImzc3yEqSNWVSTW+M+5GM8IRvR8LGvYvFTIDYohws6M4npb6g0yObp24DV8bAsx 6IZ7BCPUPy/6p8wVkXGMWQH6Y4Y0s+g8ygnucYQ5zuX1+ar8nWKxVsWFEC2ooPQqQly6 nYX20pdXcizipg+pGJv84uAjE4k5e/Dsizk9Jr81Cz8dpMBZbtDNJF0UrAhvF9LpW+cG BXXFlYcz5k2ghZYde2AdUMJbG7QuRuM7Ym16jGaD6IqSDR8ZWQT3/vMgkDSGpeuDR8wp zj03M1p+Zjuz95c4YT+Y6XrxmG3BN45Givi17zY+fRitQ4q9ptlyAD+V7PWhQ/HBDmEl 1QFQ== 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=RKJQFlbNOnxfAGQolBfqaP4S93vmXU/qq5oY6hR9n1Q=; b=LEQzX+NlyO8Rb93Od6/ugKOHaXQQrrhakTSlfXBpTUGUA/lF3CeZlnh4TXdt6aXcbT taQyHOuk3uI0Kafl1Y6vBCUGNbgoVJuV8z/EVgp9wxuLtAVQMZaA92q+3W3cPq+H5M7k rhA7Khk0mgNTscAJpRvgoKatEz9l0xrcYqb6Y4T9wzLtWeEe7p3fqB+PDZMqUlO3aCwC 7m/sOVyYGksTJ/UDCr9VsElUvZVErobEg/BOWU+86phQKfVhyXM8IQ7wZv6Rl9KVrq0t OpM/Kg+Dj1t2YK6qr8DlTlfRhskBssluTngz6WDAzEBnX2ruwNoHAKsYdEKAwtiAoUb1 VXNQ== X-Gm-Message-State: AOAM533KfFToPUH6AUdF5RhrTlTaq4UvqkZK+0iVz7mdYH/3lakoRn2G tQh3tE8tAYUMTeF6LaYxIq79YPTWn2wB9oRTqtQ= X-Received: by 2002:a05:6808:1592:: with SMTP id t18mr3525887oiw.123.1621630835378; Fri, 21 May 2021 14:00:35 -0700 (PDT) MIME-Version: 1.0 References: <20210521150212.2076151-1-linux@roeck-us.net> In-Reply-To: <20210521150212.2076151-1-linux@roeck-us.net> From: Alex Deucher Date: Fri, 21 May 2021 17:00:24 -0400 Message-ID: Subject: Re: [PATCH] drm/amd/amdkfd: Drop unnecessary NULL check after container_of To: Guenter Roeck Cc: Felix Kuehling , David Airlie , LKML , Maling list - DRI developers , amd-gfx list , Alex Deucher , =?UTF-8?Q?Christian_K=C3=B6nig?= Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Applied. Thanks! Alex On Fri, May 21, 2021 at 11:02 AM Guenter Roeck wrote: > > The first parameter passed to container_of() is the pointer to the work > structure passed to the worker and never NULL. The NULL check on the > result of container_of() is therefore unnecessary and misleading. > Remove it. > > This change was made automatically with the following Coccinelle script. > > @@ > type t; > identifier v; > statement s; > @@ > > <+... > ( > t v = container_of(...); > | > v = container_of(...); > ) > ... > when != v > - if (\( !v \| v == NULL \) ) s > ...+> > > Signed-off-by: Guenter Roeck > --- > drivers/gpu/drm/amd/amdkfd/kfd_process.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process.c b/drivers/gpu/drm/amd/amdkfd/kfd_process.c > index 5b6c5669c03d..2f8d352e0069 100644 > --- a/drivers/gpu/drm/amd/amdkfd/kfd_process.c > +++ b/drivers/gpu/drm/amd/amdkfd/kfd_process.c > @@ -110,8 +110,6 @@ static void kfd_sdma_activity_worker(struct work_struct *work) > > workarea = container_of(work, struct kfd_sdma_activity_handler_workarea, > sdma_activity_work); > - if (!workarea) > - return; > > pdd = workarea->pdd; > if (!pdd) > -- > 2.25.1 >