Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp154049pxb; Fri, 17 Sep 2021 22:07:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxiS7Y6j2tBRjxJvxqWA0q/qlnBbGyRu1PQ2He9kuXNplJLnvTxQEqzaBXXLMfE3trd96jY X-Received: by 2002:a5e:a813:: with SMTP id c19mr11346213ioa.199.1631941677252; Fri, 17 Sep 2021 22:07:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631941677; cv=none; d=google.com; s=arc-20160816; b=if75cF3CdxDE3YtGxSH7iJLO2MLaaFQQ5+Ne1M+QjtlrNrM6XBNiPLWv0SfkDPXptt gJeb2FHhqNqaEcCrRpFhGszbAeQfOLdB6FjaOrlMZOVRJSB87Mwc+G7iyj01D5p5mWGY xnIXDDrPu5ikHX1i1qGfGDxwKJTB59usS6gWMa5JYKmaqyVmIjZI/MmLNFRTAtWv55Yv wINMbxLudMW9wwpZrhc+FfnmnrnVK6HOjAQu+pko+crDFj3q9Y2Y1igzFlgYr5tmoTUJ wMrQPX+x2cVl/T9EzP3AO/PXmjEw7Y+71AAHuqqsj6ExyetYY93cOqlFqXFFdd2O5kVE maxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=Pwv+7pylkaIrPBg3R0kBxNlV+QfDULkAa/KMRtw0Pno=; b=l6v8+EtvaFVJPojdHaWkBBaelsKr0sdp5N6ELhZ4iju8JGDJNytsSz9y5Bq3IjlUK0 PeUE3QLNFj0JeONTuIA5vZw0MNRyErzkxcccer3+L1kz4fOk7I1vRzKEv8/g/y+CNo1m spUFR2eeQI/RW5daIzo5va2NDv/v3bWZekLhk7tH/vet82ev304b0a4GEYhmda3n74NZ D8hsI1y2hSEVZ2pGdZAnbOtbOxoBdQ3FFrspGszgeY1fgZcI5670fyskRdL6/kiKTFYG AxCc7qtmAB7PsgkwL9XiDf3sDz/e7NuGey+jxxKF22j1gMx/eYyPGsGUA5SYks00WDVi LH3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@u92.eu header.s=fm3 header.b=cfp6Lw7y; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=OT0vUGuS; 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 s7si7332298ilp.105.2021.09.17.22.07.46; Fri, 17 Sep 2021 22:07:57 -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=@u92.eu header.s=fm3 header.b=cfp6Lw7y; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=OT0vUGuS; 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 S245556AbhIQWeY (ORCPT + 99 others); Fri, 17 Sep 2021 18:34:24 -0400 Received: from wnew3-smtp.messagingengine.com ([64.147.123.17]:45345 "EHLO wnew3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232719AbhIQWeW (ORCPT ); Fri, 17 Sep 2021 18:34:22 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailnew.west.internal (Postfix) with ESMTP id 509562B00BB2; Fri, 17 Sep 2021 18:32:59 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 17 Sep 2021 18:33:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=u92.eu; h=date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=Pwv+7pylkaIrPBg3R0kBxNlV+Qf DULkAa/KMRtw0Pno=; b=cfp6Lw7yuzUQ0udmdQnhrDY8tgotCYiVevyu0EjtXCj KJacrwUjOBWZJWeXN0Sz14XZVtEJbMQ46gwVn6S1HQDcYsNwDq2jqyZiY/Z9ObdO 1vJkK66GTlosny/xLMkHvVNIThNMfn2VG5maIVFf20nlpR+9y6b7Y89jzNN572hk 56+i9UG6adSGYwQ+Ha31bT/ZKo9JEls6qXOWdhaZTvDO9o5zx71d0IBKkOQ1eFff xsujTYE1EkvMBaAhi/ZXTcU8E874UTt+PSSKenlNB4Qwsc820XcLR/zmuMcJiBc8 KJKf7gSTcbrzfH7NRU1t3SomC0fkGuaSxmJoGjYxgqg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=Pwv+7p ylkaIrPBg3R0kBxNlV+QfDULkAa/KMRtw0Pno=; b=OT0vUGuSB3Q5GUldtkZ4hD ISjHzWRc9lXwqyHNnnx6Peo23H19RklTOphrbBZUNdCTQyRu5r+kbWTEfrLUFbHn 5svWwEO38lRt1VJqd6W69ohk0Lo6XGOyxrMZCQ/s0MX7w0Y9zOl7yzNQTBDa9CqW gfObJfg1FFmTZZkocCGwnLlqeMCyw5TTzIhfMXhBYHPcT/CA7lCCezfXVtBz2bQr Exf8wJBCzAWDF+/QpJo68z7TBJlF2+S/9bP0qmexdv61MBJR0XRFhXBu/g7cOSdz hvpXFlV7dEfudE1n3FV692nxLddDL1PkqVzv7PyUPUclMd0L+xUiUJvz9AaEmy8g == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudehjedgudduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehttdertddttdejnecuhfhrohhmpefhvghrnhgr nhguohcutfgrmhhoshcuoehgrhgvvghnfhhoohesuhelvddrvghuqeenucggtffrrghtth gvrhhnpedvjeeifeelhfetiefhhfdthfefkefhhfeutdetvdfgvefgveefheffgfekjeef heenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehgrh gvvghnfhhoohesuhelvddrvghu X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 17 Sep 2021 18:32:55 -0400 (EDT) Date: Sat, 18 Sep 2021 00:32:52 +0200 From: Fernando Ramos To: Sean Paul Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, amd-gfx@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, linux-tegra@vger.kernel.org Subject: Re: [PATCH 08/15] drm/radeon: cleanup: drm_modeset_lock_all() --> DRM_MODESET_LOCK_ALL_BEGIN() Message-ID: References: <20210916211552.33490-1-greenfoo@u92.eu> <20210916211552.33490-9-greenfoo@u92.eu> <20210917154031.GH2515@art_vandelay> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210917154031.GH2515@art_vandelay> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > + struct drm_modeset_acquire_ctx ctx; > > int i, r; > > + int ret; > > Could you please tuck this up with i & r? Done! > > - drm_modeset_unlock_all(dev); > > + DRM_MODESET_LOCK_ALL_END(dev, ctx, ret); > > You should check ret here Would it be save to return at this point if the lock fails? In other words, can I just add this? --> "if (ret) return ret;" > > + struct drm_modeset_acquire_ctx ctx; > > int r; > > + int ret; > > Same suggestion here, move up with r Done! > > - drm_modeset_unlock_all(dev); > > + DRM_MODESET_LOCK_ALL_END(dev, ctx, ret); > > Also check ret here Same question. Would "if (ret) return ret;" be safe here? > > int i; > > + int ret; > > Move up with i Done! > > - drm_modeset_unlock_all(dev); > > + DRM_MODESET_LOCK_ALL_END(dev, ctx, ret); > > return 0; I can also "return ret;" instead of "0". What happens when a DEFINE_SHOW_ATTRIBUTE'd function returns non-zero? Is it ok? Or do we want to always return "0" to print whatever we can?