Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp361062lqr; Wed, 5 Jun 2024 08:10:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXBk++e/pmIGr+QgNCA4nv1bFzZui2ERasnEMVuLwYomjHSfoYjOR4OsMbyfmlUY9Q2+GqaOb8svtqapn+MpJOKNfCuCqytzMWrsSEb+Q== X-Google-Smtp-Source: AGHT+IGIFj8bO6H6jJPjOmYP7SORuhzs57039xUrawVzuvO70A3T3DgAlrldVnnWyGCK3pbotOeH X-Received: by 2002:a17:903:22c7:b0:1f2:fdb5:aac8 with SMTP id d9443c01a7336-1f6a586b5edmr37050825ad.0.1717600233594; Wed, 05 Jun 2024 08:10:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717600233; cv=pass; d=google.com; s=arc-20160816; b=sfg1vHOCWGhqfcAytZZWdZHBiBFDYAnhWT+r+43B59SkhIDcbxpk0Njf5JN6+tiR1W g9N2El1ka3PS+Ji5dGG+yAb/OqMs2rzyxixCDniEjIdF9dKM7Zl5e9A5X4tYCtOgc0Rs cfD1hxEnCFaQijmWVHeS/InRn5djaOkW6ipGFmatDz4UUcg4VpNdYsa/H0Ru372IEE05 w6we1sd3s5g12ERATYOLum51403aZKkGJ/4J54WeocBqxYjJwZes0CkGTyr/wclaGw3L Bqd03OpBaPKUgspdZKeJaSynAWgPe0R5Jcq+NlnAXRJ8CkUm7NRtrJuCLUW9RSsIMtwY CHpw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=si8jm3GzWRqXx1IokxC0CnOeeKfkWKdxlqw96jlz8gE=; fh=kKw2fnoceP7uoAfZJBFbIOkCfUWV9+1T0A4txglXP9w=; b=wmR+9CAwfyc0uDmYsXGrXoBjhN+heVt3HeXxlMbFno6qUHE6ibz5F37NHdP3M6UmRD U8VYPhvDqgNClvjxDpdowd4S/rC1WNcyobTvJ0ZgrmowHNmx2AxMHqK6xrxePuoDVuVh LPDrigtjK8MQ8RgevLJvB77bsRG2HfVLqW7qOVywkGQ8sRrpcN78KLaJ8UJmpr5P/+UE xhKi/E/vOnkYI2QDSIx91chnX1t+gr+j/kf7t/DvuW7O6ogdVZAcMoVD/MNP2SuKL1f2 FKTQERzxnFUggliTEtvPeAtCd1CPZvd1aVlCaI0j99Dj/nrKOpWtv6a7wXzab7l50nrD tdTA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@toblux-com.20230601.gappssmtp.com header.s=20230601 header.b=QcTx6qP1; arc=pass (i=1 dkim=pass dkdomain=toblux-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-202331-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202331-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d9443c01a7336-1f67cc9fdfcsi56073005ad.537.2024.06.05.08.10.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 08:10:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-202331-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@toblux-com.20230601.gappssmtp.com header.s=20230601 header.b=QcTx6qP1; arc=pass (i=1 dkim=pass dkdomain=toblux-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-202331-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202331-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 1CE51B21E3E for ; Wed, 5 Jun 2024 11:58:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9062B1953B1; Wed, 5 Jun 2024 11:50:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=toblux-com.20230601.gappssmtp.com header.i=@toblux-com.20230601.gappssmtp.com header.b="QcTx6qP1" Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EAE3C1953AD for ; Wed, 5 Jun 2024 11:50:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717588245; cv=none; b=IR47cPiKkfhIycrCqjE9r8jJwUpFgyIayKi65r59hxUEOupgkY1Xt68RQNFO3WNied+RnlrAXcuL28aqflLawa3MROwL1Vlc3BcHtheBH7u73NhkCrpnpWOk1vxd3nFOAjS3tud3PcaN5TNBzyOvbpw13N7K9BUGKregaKmd1KA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717588245; c=relaxed/simple; bh=SntghWWYXHpvUMrfmeO17O9aa2fOgBu9KzWTKtKy24s=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=FQVE69DwM19Y//XB2M/aQJc7FsiaGJ7fo7XOKtdc3jvb5FP8DPp43At8aXITl+C8mjx6yTH6JYkGy8BlvfCKuawhR6CkVCPSEQZG1zCOSso5tceuN+0fINKDra5Pr3frU1RbKdmtGKrAhWOhI5bBlRPW7aPeIDC6B10lHr7A8+E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=toblux.com; spf=none smtp.mailfrom=toblux.com; dkim=pass (2048-bit key) header.d=toblux-com.20230601.gappssmtp.com header.i=@toblux-com.20230601.gappssmtp.com header.b=QcTx6qP1; arc=none smtp.client-ip=209.85.218.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=toblux.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=toblux.com Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-a691bbb7031so402590866b.1 for ; Wed, 05 Jun 2024 04:50:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toblux-com.20230601.gappssmtp.com; s=20230601; t=1717588242; x=1718193042; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=si8jm3GzWRqXx1IokxC0CnOeeKfkWKdxlqw96jlz8gE=; b=QcTx6qP1n4/ppMGehliHrJVBy2bqfvrhK0l+0CKw8gpZUjZ79T6pGYEp7XYKmI3SPZ M/Un12dljeP9EJrEp8exDl54B3MlwZ09NDCtqxGxgE+Ka32MruPLSNzlsix+v6kks3kO k9HvIZWXiP5b6hFFrEt//Fyub5xTyAQy6ejGM2GfMORracV7TSF7hNDqPApECOylNNXE 17XsHmynaXDRxyXyW3KR3hm6ex+/tqMw4XXnBbUphx/74WZM2Xi9pky76gBIkKgwR0S3 vU1N58X0FLoVgXii3yWQAl9xc+sCJo0x8UbPhKauSqWz/20rBwWwtbpM9e3NnraFafMz vOjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717588242; x=1718193042; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=si8jm3GzWRqXx1IokxC0CnOeeKfkWKdxlqw96jlz8gE=; b=b5EcywTnB/6aWcu1Dvfwcb53gTIQE+kZYE2ASUKI4Z+YYrmy6j2UXZHC/4dLzq+z1b zpgl+G1IOfEUXNF0xyv/A3QYfokoDUEX3jRqG9umPv6C1UHPS5Iu5BfZ7B691bWoZG5+ /2PBwgDM3+J/g9OhsWdIxFYWja5+xdKVAnwrkZYfB2Ylulx7Nlnf4xWSt/4YlBqLtW9Q 2O1SWOK6c+64ZMSdURtkg9ZMXdLpKoddC2zeCDOXYQoI0vy29F5qv14Au2hKD7evsedM lAJaVsIczWN8nG4+RVwEuN2NErGcSPJgjlcvxW54yO33M0Huno3JqnE0d0RJ0C3GepCS R/AA== X-Forwarded-Encrypted: i=1; AJvYcCVChm9tx4oGVPuwx/FHEH4+svwmMdes4PmCgeXmVdJS9owcl+NSBzFOyXHQzsDz3AceATp94NzoyDjz/GdkH0Mc5F//RKwj0pzkY4gd X-Gm-Message-State: AOJu0YzEFlTgSbUVyB5baN19Ij0/mv1wBnpXoiGLSGehRip1irCOyN3p Ae4QQu/ta//Sw1TcsiZPHC8qi/u2PORYoeTPfw8W6OlWd0oMk1P7Qf8fB1HuRFU= X-Received: by 2002:a17:907:770c:b0:a67:7649:3c3c with SMTP id a640c23a62f3a-a69a000e966mr187050066b.56.1717588242051; Wed, 05 Jun 2024 04:50:42 -0700 (PDT) Received: from debian.fritz.box. (aftr-82-135-80-164.dynamic.mnet-online.de. [82.135.80.164]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a68ed879eacsm533329966b.99.2024.06.05.04.50.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 04:50:41 -0700 (PDT) From: Thorsten Blum To: maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Thorsten Blum Subject: [PATCH] drm/managed: Simplify if condition Date: Wed, 5 Jun 2024 13:50:01 +0200 Message-Id: <20240605115000.83102-1-thorsten.blum@toblux.com> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The if condition !A || A && B can be simplified to !A || B. Fixes the following Coccinelle/coccicheck warning reported by excluded_middle.cocci: WARNING !A || A && B is equivalent to !A || B Compile-tested only. Signed-off-by: Thorsten Blum --- drivers/gpu/drm/drm_managed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_managed.c b/drivers/gpu/drm/drm_managed.c index 7646f67bda4e..79ce86a5bd67 100644 --- a/drivers/gpu/drm/drm_managed.c +++ b/drivers/gpu/drm/drm_managed.c @@ -197,7 +197,7 @@ void drmm_release_action(struct drm_device *dev, spin_lock_irqsave(&dev->managed.lock, flags); list_for_each_entry_reverse(dr, &dev->managed.resources, node.entry) { if (dr->node.release == action) { - if (!data || (data && *(void **)dr->data == data)) { + if (!data || *(void **)dr->data == data) { dr_match = dr; del_dr(dev, dr_match); break; -- 2.39.2