Received: by 2002:ab2:784b:0:b0:1fd:adc2:8405 with SMTP id m11csp223057lqp; Mon, 10 Jun 2024 01:49:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWOtdfEx9w7JIWHdQ2HmuoAUivznhR1WVZDKQcNJqXD0UjiN9c4MWrNtTm1uS5NSiJ5OAKYg2YRHzGSUXUOozi5zSLZHumARse+zLpfbg== X-Google-Smtp-Source: AGHT+IH0X4MOVWhTIZ7c2cl2p8/ZV2iaVBVk6Ovd6pWoDVq0hV0EsQWWS25G0y/FrGeVlZ6fApw2 X-Received: by 2002:a50:cd09:0:b0:57c:5bdd:1c64 with SMTP id 4fb4d7f45d1cf-57c5bdd1e91mr4335142a12.41.1718009362673; Mon, 10 Jun 2024 01:49:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718009362; cv=pass; d=google.com; s=arc-20160816; b=RFVBh+8no7DTj0NOQlg73/Z27Q+F9qTFts8cpWamQB8qIPi0/rAVNEnGpTwkVfB+NK adOo0FmuRWYBlc4n28T1Zgh9XijHQZOBbjD7zdrYSAL4HcReOCCcJ8txEdeKgQl4OljQ QenZJfA3KJJmtx1qFodqL/AlvULiagZ/puTKgzPpo3eVUjgiIBTtuwVyDZVHKlhE4YoG U6ATS8q/NjKpbNJeG35x770D2l1P7Gy+8Xs0JWqDXf3N+7rSvfkIiGAvk73jEdT6qDSB DPD7DPZSprpaUQb0EyzHMaD2lSBzVJb0SPQu/ytgkHIredPFiv5MvRmq1itG/ZQMlP+X iXXw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature:dkim-signature:dkim-signature:dkim-signature; bh=67sKUK9SeGwedFu9SXPQcPagKDR/d3mrg+rTL8kdZAA=; fh=2iJpJ+pQgdB3wLfErelmvBbOgJblEMpYwzz5xeW/8Ts=; b=OZc1sufGvaVTz38oH5b31zS/+n69yHePBJBbGc4iCLEL3HiCVWn3BZxWyUFl9//Sgz NrFrKGYsbL+377ieHyDr45HFtc7CwQ0zp5v6ihMxcadausqQzxHPwVovUWE6TupVKS34 i9dzLF4toIQG70E9+O7StiEQMbDtET6oUh0y178xiOqgdM4vGSFokjcVIRoFiBV+EUYR d1Z31bmzmr8Y8n96Eqhgq+qU4uUSF9k9ExNbYayBT07yW9OoAuPLpv/EiMCmtGOHZQb1 ZOv04HgvQDiDqD3vL50r8s7MuVT+974VCi5sakCV9cXdzJ+jmjTDnm+7SIjywtaBC6NL upUw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=CRmZf5Gx; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=CRmZf5Gx; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-207872-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207872-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57c6e55fbd3si2262253a12.629.2024.06.10.01.49.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 01:49:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-207872-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=CRmZf5Gx; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=CRmZf5Gx; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-207872-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207872-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 3B10C1F216FF for ; Mon, 10 Jun 2024 08:49:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3C7714D8C9; Mon, 10 Jun 2024 08:49:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="CRmZf5Gx"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="VBVti+ZU"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="CRmZf5Gx"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="VBVti+ZU" Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (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 A8F6C5227 for ; Mon, 10 Jun 2024 08:49:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718009355; cv=none; b=uuHRIRL+5Y/7hLiRspasG9Xmmeup8fWEPs2889B0imPL40TKXxTJzwmOqRMQZw6nC5lvoC+Lj74bGrHE0EChQmrejYBo0z3uDZGYTZsXC5GuTUr9bHhndkKHjj+TfoNUNG5c9pMpUWlQvlzOZ29FjOfmTBDVeMsFVT4RLlTDnqQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718009355; c=relaxed/simple; bh=J3DAIcaHfK84BDOVBLrXOIunZFGd5Zj2P+t4gJlRfYo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=blud1uifIIYQ/KNohR9ZVbElwehHP6hqgjUW/z26/VP83Hx/ClrU6NRVbwT8AY3kc28KZg8oLOI2SCY3x4cZSSdLk9czvCXiuBSPdrthsZvAPQFvNr6PZ4ppyCx0fzxMVWf9Lk8iihXtRQahgDSGaxuUCJd2hPBM4dfAwVUcP9M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=CRmZf5Gx; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=VBVti+ZU; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=CRmZf5Gx; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=VBVti+ZU; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 95B7C21A0A; Mon, 10 Jun 2024 08:49:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718009351; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=67sKUK9SeGwedFu9SXPQcPagKDR/d3mrg+rTL8kdZAA=; b=CRmZf5GxiWaFHRnxJY/GLRjXYYsqRSAWRP5OqeEUlOMQ0S6zAtf0eWakqvflaIIs56sfB6 zq9LBlSFtTbIBUJiOxnQziDQK49YdnjpTY22Dsnf+bFyTcFbmbYL7VOOXwPS8CX0guNJUZ J6mcPNmhPRt1rYRu2C87TlKjpsTA/a8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718009351; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=67sKUK9SeGwedFu9SXPQcPagKDR/d3mrg+rTL8kdZAA=; b=VBVti+ZUp7vuQR6sKvZzlDOvI8JrnLE4TwKpXL5AAOY0jafrN1yFfM0Q7b3bhuWcaDkNpk Bqu89+iBl0CsgsDQ== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=CRmZf5Gx; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=VBVti+ZU DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718009351; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=67sKUK9SeGwedFu9SXPQcPagKDR/d3mrg+rTL8kdZAA=; b=CRmZf5GxiWaFHRnxJY/GLRjXYYsqRSAWRP5OqeEUlOMQ0S6zAtf0eWakqvflaIIs56sfB6 zq9LBlSFtTbIBUJiOxnQziDQK49YdnjpTY22Dsnf+bFyTcFbmbYL7VOOXwPS8CX0guNJUZ J6mcPNmhPRt1rYRu2C87TlKjpsTA/a8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718009351; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=67sKUK9SeGwedFu9SXPQcPagKDR/d3mrg+rTL8kdZAA=; b=VBVti+ZUp7vuQR6sKvZzlDOvI8JrnLE4TwKpXL5AAOY0jafrN1yFfM0Q7b3bhuWcaDkNpk Bqu89+iBl0CsgsDQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 6540C13A51; Mon, 10 Jun 2024 08:49:11 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id JddaFwe+ZmZsXgAAD6G6ig (envelope-from ); Mon, 10 Jun 2024 08:49:11 +0000 Message-ID: Date: Mon, 10 Jun 2024 10:49:10 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] drm/managed: Simplify if condition To: Thorsten Blum , maarten.lankhorst@linux.intel.com, mripard@kernel.org, airlied@gmail.com, daniel@ffwll.ch Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20240605115000.83102-1-thorsten.blum@toblux.com> Content-Language: en-US From: Thomas Zimmermann Autocrypt: addr=tzimmermann@suse.de; keydata= xsBNBFs50uABCADEHPidWt974CaxBVbrIBwqcq/WURinJ3+2WlIrKWspiP83vfZKaXhFYsdg XH47fDVbPPj+d6tQrw5lPQCyqjwrCPYnq3WlIBnGPJ4/jreTL6V+qfKRDlGLWFjZcsrPJGE0 BeB5BbqP5erN1qylK9i3gPoQjXGhpBpQYwRrEyQyjuvk+Ev0K1Jc5tVDeJAuau3TGNgah4Yc hdHm3bkPjz9EErV85RwvImQ1dptvx6s7xzwXTgGAsaYZsL8WCwDaTuqFa1d1jjlaxg6+tZsB 9GluwvIhSezPgnEmimZDkGnZRRSFiGP8yjqTjjWuf0bSj5rUnTGiyLyRZRNGcXmu6hjlABEB AAHNJ1Rob21hcyBaaW1tZXJtYW5uIDx0emltbWVybWFubkBzdXNlLmRlPsLAjgQTAQgAOAIb AwULCQgHAgYVCgkICwIEFgIDAQIeAQIXgBYhBHIX+6yM6c9jRKFo5WgNwR1TC3ojBQJftODH AAoJEGgNwR1TC3ojx1wH/0hKGWugiqDgLNXLRD/4TfHBEKmxIrmfu9Z5t7vwUKfwhFL6hqvo lXPJJKQpQ2z8+X2vZm/slsLn7J1yjrOsoJhKABDi+3QWWSGkaGwRJAdPVVyJMfJRNNNIKwVb U6B1BkX2XDKDGffF4TxlOpSQzdtNI/9gleOoUA8+jy8knnDYzjBNOZqLG2FuTdicBXblz0Mf vg41gd9kCwYXDnD91rJU8tzylXv03E75NCaTxTM+FBXPmsAVYQ4GYhhgFt8S2UWMoaaABLDe 7l5FdnLdDEcbmd8uLU2CaG4W2cLrUaI4jz2XbkcPQkqTQ3EB67hYkjiEE6Zy3ggOitiQGcqp j//OwE0EWznS4AEIAMYmP4M/V+T5RY5at/g7rUdNsLhWv1APYrh9RQefODYHrNRHUE9eosYb T6XMryR9hT8XlGOYRwKWwiQBoWSDiTMo/Xi29jUnn4BXfI2px2DTXwc22LKtLAgTRjP+qbU6 3Y0xnQN29UGDbYgyyK51DW3H0If2a3JNsheAAK+Xc9baj0LGIc8T9uiEWHBnCH+RdhgATnWW GKdDegUR5BkDfDg5O/FISymJBHx2Dyoklv5g4BzkgqTqwmaYzsl8UxZKvbaxq0zbehDda8lv hFXodNFMAgTLJlLuDYOGLK2AwbrS3Sp0AEbkpdJBb44qVlGm5bApZouHeJ/+n+7r12+lqdsA EQEAAcLAdgQYAQgAIAIbDBYhBHIX+6yM6c9jRKFo5WgNwR1TC3ojBQJftOH6AAoJEGgNwR1T C3ojVSkIALpAPkIJPQoURPb1VWjh34l0HlglmYHvZszJWTXYwavHR8+k6Baa6H7ufXNQtThR yIxJrQLW6rV5lm7TjhffEhxVCn37+cg0zZ3j7zIsSS0rx/aMwi6VhFJA5hfn3T0TtrijKP4A SAQO9xD1Zk9/61JWk8OysuIh7MXkl0fxbRKWE93XeQBhIJHQfnc+YBLprdnxR446Sh8Wn/2D Ya8cavuWf2zrB6cZurs048xe0UbSW5AOSo4V9M0jzYI4nZqTmPxYyXbm30Kvmz0rYVRaitYJ 4kyYYMhuULvrJDMjZRvaNe52tkKAvMevcGdt38H4KSVXAylqyQOW5zvPc4/sq9c= In-Reply-To: <20240605115000.83102-1-thorsten.blum@toblux.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Flag: NO X-Spam-Score: -4.50 X-Rspamd-Action: no action X-Rspamd-Queue-Id: 95B7C21A0A X-Spam-Level: X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-4.50 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; XM_UA_NO_VERSION(0.01)[]; MX_GOOD(-0.01)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; FREEMAIL_TO(0.00)[toblux.com,linux.intel.com,kernel.org,gmail.com,ffwll.ch]; MIME_TRACE(0.00)[0:+]; TO_MATCH_ENVRCPT_ALL(0.00)[]; ARC_NA(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; RCVD_TLS_ALL(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; DNSWL_BLOCKED(0.00)[2a07:de40:b281:106:10:150:64:167:received]; RCPT_COUNT_SEVEN(0.00)[7]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:email,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns] Am 05.06.24 um 13:50 schrieb Thorsten Blum: > 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 Acked-by: Thomas Zimmermann > --- > 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; -- -- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstrasse 146, 90461 Nuernberg, Germany GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman HRB 36809 (AG Nuernberg)