Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1400650pxj; Fri, 21 May 2021 13:20:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBxb7LnsDCeo5W+ndaoLQro2p4HoClmkwuLFrQDEFiCCz934bBsmt1Lycg7XAlqHlKFF5Y X-Received: by 2002:a17:906:857:: with SMTP id f23mr11754854ejd.64.1621628409743; Fri, 21 May 2021 13:20:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621628409; cv=none; d=google.com; s=arc-20160816; b=o5l/2H7Blo1D5TpV/qZOFYAyE+8IQvWbnnhaClwqTqkDuYQ6Ne0qPgHIzWZ1qOQSES S8CMWQYAGxN6x2Fef24+sulp8hDa5ixDamRDiWJGDD8nY0UMt4yTlDhFlJ2oW4uLtOrV H3EFoNvAdu7ctlH6MpM8dc2LgKyxNKyUci71U5aHwz/5unoIxnZpoPLXwJPPWUCJBqU1 SBXvkWsg33G2z/CJXkxeSNmDAoK0n0xwbdtmJKr3buh45/IWfIDCgpcJZBEaV0kLSYlo +jX4VDVkyEIGKUShSTjTBLyGaUqzKRqpMXYrxyu2K3NIGoZcCBl74fkfYZu4yytvpLKH QrcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=Xm6m2knyDpL/AilBChBzFOY2/qamtbXCofZcDB02RLQ=; b=N7Udtuh6QdWRjUpISBMoegvqo2v/5Up8JrEBVyHM0VIqIPgeB9p0PAchwWrYPbjkZQ 5kVtZuCZu7mREwvYVIyBtxpCKe7R2uHhNLLp2mw+EN13V8WcJi6/6mO3o1KSiEDwDbgi RCU8h2HC8bxodWkgVZ7UKBGRduEQf+VcScIxl66alLoutjejkYnscD0qA9aIqMS5crM7 zc4qEDmvqBd2YaUrKBiOfjEYqiRLLmh66fLeEOxm2Ti6wfG/4SRnwJW3tsOG9seWUlcW Br7/tP6mGwv2EvVJz66rSohZFhZPMmsvSgNIRb23/MxIQd9juInor6Rgou2TWx0GCzUE LNpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Q22x2wvK; 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 n18si6608967eju.239.2021.05.21.13.19.46; Fri, 21 May 2021 13:20:09 -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=Q22x2wvK; 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 S231162AbhEUPDt (ORCPT + 99 others); Fri, 21 May 2021 11:03:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237189AbhEUPDl (ORCPT ); Fri, 21 May 2021 11:03:41 -0400 Received: from mail-ot1-x333.google.com (mail-ot1-x333.google.com [IPv6:2607:f8b0:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA08CC06138A for ; Fri, 21 May 2021 08:02:16 -0700 (PDT) Received: by mail-ot1-x333.google.com with SMTP id i23-20020a9d68d70000b02902dc19ed4c15so18337895oto.0 for ; Fri, 21 May 2021 08:02:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Xm6m2knyDpL/AilBChBzFOY2/qamtbXCofZcDB02RLQ=; b=Q22x2wvK1MAFQV8Zzl+hmt/CTI4iB5OIFaZsce8GvK9OmOk71oW3p/M7t5Gsns1reo rU1RrseTh2g4HJDdqKKLYSfggRaJflV80K2fwhCwLQULeujBvsLK2FSoURhqxfhtDIE6 B4nCAI5170tL6L0QCC0AfoVQJDtNzUU2oZ6f7oGOYsctL7dC8WuKjhExUjGNFGLxhurb EPGMzKvyOhK3NqteGRQw6J2v5HkdBl7kudaqoD2lBzpEY6YXpx2vCycZSdHDhbRL3iXD Xl5JfQ89f2974pNcqAds5jZ7bvhxfcGjikJH4G+MBy6b9SqmWT+4Ok5XVN6H8HLH/YDW 0g4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=Xm6m2knyDpL/AilBChBzFOY2/qamtbXCofZcDB02RLQ=; b=TJa11ec+DzeDIV215C9ZfTkPieQ0dks7gPXGeCMFqi+aw51p8wN5DQmT9CNfXofuni /G8Sj8cCxqsUvuuuNp7UCpbUJdYysb8wM6d5JnukQUmLrQN4gX0Yy2+yU0ffrVIh9L8+ R9/KjC/mqL4OGVDVoLjEgNXgcyHIvTvrwh/vZ/4AjLHLUaWyYqZpXc8exKmDLofbVj1t Vddn0M1ErY1t6MQ+Lpu617hWKlGe+xA8JYaQhGmsSWWnDXC+e098psECyOGParyclh0y wAJJn3RaPij48goXFa4Urf0mA4kK69M3Dx8hnFGrcPGo9XqmknWiML/D2098kb7SSzha 1YCw== X-Gm-Message-State: AOAM532TF/ALWkjnndSN0i2mO9X7hMfpdYccsMIbtQ1ckcZ9eyQ13Lxf utnpvbA8qgLZra6jK7mqLC4= X-Received: by 2002:a9d:4d84:: with SMTP id u4mr8749017otk.136.1621609335861; Fri, 21 May 2021 08:02:15 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id 88sm1331650otb.7.2021.05.21.08.02.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 May 2021 08:02:14 -0700 (PDT) Sender: Guenter Roeck From: Guenter Roeck To: Felix Kuehling Cc: Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , David Airlie , Daniel Vetter , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Guenter Roeck Subject: [PATCH] drm/amd/amdkfd: Drop unnecessary NULL check after container_of Date: Fri, 21 May 2021 08:02:12 -0700 Message-Id: <20210521150212.2076151-1-linux@roeck-us.net> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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