From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 76B74C4707E for ; Fri, 21 May 2021 21:00:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4FB41613E6 for ; Fri, 21 May 2021 21:00:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229959AbhEUVCG (ORCPT ); Fri, 21 May 2021 17:02:06 -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-Google-Smtp-Source: ABdhPJxuNzb1jvwtxFKbIpIcb34axGi0g9DbxLQSom5QwpOqZt6As4f1VD4LfCN8dJD2J8t9FfrXA30UJziLGvl2PFE= 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 > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65F73C04FF3 for ; Fri, 21 May 2021 21:00:56 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2E26A613EC for ; Fri, 21 May 2021 21:00:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2E26A613EC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 65A9D6F919; Fri, 21 May 2021 21:00:54 +0000 (UTC) Received: from mail-oi1-x235.google.com (mail-oi1-x235.google.com [IPv6:2607:f8b0:4864:20::235]) by gabe.freedesktop.org (Postfix) with ESMTPS id 582486F919; Fri, 21 May 2021 21:00:36 +0000 (UTC) Received: by mail-oi1-x235.google.com with SMTP id s19so20878577oic.7; 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=safdaPNed+TR1dpsl7n/lFyXqv629foQSoR4Mdcq1pq7y08e2xfy/iDHgJcPDlVzAA lJFCyGQH3CHK80Zu3+TiMe3YbZnQoGEGYiYKiry85lWjX0BQxX6CustKw2n8BoicOlBr I6IIpo2NcXgtoVNtyacqZOgUTZfbjkN3YRUxRRCRubZXaEVwigxExILH4B+2YpzAd09O DRK8tDKQL96AkcG5Eo3EawM6Bqq9x4R0bKCE/ZSsYXRNdgo2/xLgdtuwbaBKbV/gO8n3 G2wlxXmxuI8FRQK0jl7wZLf1VNCuOvglWADe0zqrlj/ugiqHiJYlASXWIiXAK0r+yT6n DJmA== X-Gm-Message-State: AOAM533c4AGVKYo6BciWnKJcMXR0YQXK6f/dAPVPKB3s1+ycgNRpQkaW CabTGbS86J9BnKyA+eQOwbmzwY1T7a8l0nq7ytg= X-Google-Smtp-Source: ABdhPJxuNzb1jvwtxFKbIpIcb34axGi0g9DbxLQSom5QwpOqZt6As4f1VD4LfCN8dJD2J8t9FfrXA30UJziLGvl2PFE= 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 Content-Type: text/plain; charset="UTF-8" X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , Felix Kuehling , LKML , amd-gfx list , Maling list - DRI developers , Alex Deucher , =?UTF-8?Q?Christian_K=C3=B6nig?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 347ACC04FF3 for ; Fri, 21 May 2021 21:01:01 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 03BAA613EC for ; Fri, 21 May 2021 21:01:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 03BAA613EC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=amd-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AE9B46F91A; Fri, 21 May 2021 21:00:55 +0000 (UTC) Received: from mail-oi1-x235.google.com (mail-oi1-x235.google.com [IPv6:2607:f8b0:4864:20::235]) by gabe.freedesktop.org (Postfix) with ESMTPS id 582486F919; Fri, 21 May 2021 21:00:36 +0000 (UTC) Received: by mail-oi1-x235.google.com with SMTP id s19so20878577oic.7; 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=safdaPNed+TR1dpsl7n/lFyXqv629foQSoR4Mdcq1pq7y08e2xfy/iDHgJcPDlVzAA lJFCyGQH3CHK80Zu3+TiMe3YbZnQoGEGYiYKiry85lWjX0BQxX6CustKw2n8BoicOlBr I6IIpo2NcXgtoVNtyacqZOgUTZfbjkN3YRUxRRCRubZXaEVwigxExILH4B+2YpzAd09O DRK8tDKQL96AkcG5Eo3EawM6Bqq9x4R0bKCE/ZSsYXRNdgo2/xLgdtuwbaBKbV/gO8n3 G2wlxXmxuI8FRQK0jl7wZLf1VNCuOvglWADe0zqrlj/ugiqHiJYlASXWIiXAK0r+yT6n DJmA== X-Gm-Message-State: AOAM533c4AGVKYo6BciWnKJcMXR0YQXK6f/dAPVPKB3s1+ycgNRpQkaW CabTGbS86J9BnKyA+eQOwbmzwY1T7a8l0nq7ytg= X-Google-Smtp-Source: ABdhPJxuNzb1jvwtxFKbIpIcb34axGi0g9DbxLQSom5QwpOqZt6As4f1VD4LfCN8dJD2J8t9FfrXA30UJziLGvl2PFE= 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 X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , Felix Kuehling , LKML , amd-gfx list , Maling list - DRI developers , Alex Deucher , =?UTF-8?Q?Christian_K=C3=B6nig?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" 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 > _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx