From patchwork Wed Sep 9 12:21:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Herrmann X-Patchwork-Id: 7146121 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7ADA29F314 for ; Wed, 9 Sep 2015 12:22:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B39A420965 for ; Wed, 9 Sep 2015 12:22:01 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id DAC3F20961 for ; Wed, 9 Sep 2015 12:21:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F3D386E0C7; Wed, 9 Sep 2015 05:21:56 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com [209.85.212.181]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1ACDD6E0AE for ; Wed, 9 Sep 2015 05:21:55 -0700 (PDT) Received: by wiclk2 with SMTP id lk2so155026100wic.0 for ; Wed, 09 Sep 2015 05:21:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=GiwP6EieNSNCvT8m8SvLKmpH8wczJItWHcRP6euSfzM=; b=sv7VyTbY8n7suUOnYCe7GS6zz+eUPyJNXOvxABrDMHCqTdBqYMdn+gXiIPbd0iDB7S Ch9JnikimH2lEhfRvUtr9MOuYkRHRVlcN/D4WbD5iC1aGtymaN53QBGh5taRpM95Gjma A5Dw5NHREqAyc6leOhJ6Z7IV/Ydb9JBS+ctcgmqvCO8F+VOLzBfQdXTH/otcCNKLvpEo QelukjSI30SWqaMxNmsRQ+YESJWXSZ5KyaqrsWpS5/6afk7f/9UxkySmgUnzAa9V5tyb tmGLul0IZPDkNvN2Exo+21FZmc7XPR+0sCwoOetJTJn2rpjxWdj2/QoE3UwQ3OMW65H+ IGpQ== X-Received: by 10.194.58.40 with SMTP id n8mr61721643wjq.134.1441801313500; Wed, 09 Sep 2015 05:21:53 -0700 (PDT) Received: from david-t2.fritz.box (p5DDC7D72.dip0.t-ipconnect.de. [93.220.125.114]) by smtp.gmail.com with ESMTPSA id fu5sm6380823wic.0.2015.09.09.05.21.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 09 Sep 2015 05:21:52 -0700 (PDT) From: David Herrmann To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/5] drm: simplify drm_sysfs_destroy() via IS_ERR_OR_NULL() Date: Wed, 9 Sep 2015 14:21:29 +0200 Message-Id: <1441801293-1440-2-git-send-email-dh.herrmann@gmail.com> X-Mailer: git-send-email 2.5.1 In-Reply-To: <1441801293-1440-1-git-send-email-dh.herrmann@gmail.com> References: <1441801293-1440-1-git-send-email-dh.herrmann@gmail.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Simplify `foo == NULL || IS_ERR(foo)` via IS_ERR_OR_NULL(). This is pretty commonly used all over the kernel, especially for debugfs/sysfs cleanup paths. Signed-off-by: David Herrmann --- drivers/gpu/drm/drm_sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c index 0f6cd33..3f66cb0 100644 --- a/drivers/gpu/drm/drm_sysfs.c +++ b/drivers/gpu/drm/drm_sysfs.c @@ -156,7 +156,7 @@ err_out: */ void drm_sysfs_destroy(void) { - if ((drm_class == NULL) || (IS_ERR(drm_class))) + if (IS_ERR_OR_NULL(drm_class)) return; class_remove_file(drm_class, &class_attr_version.attr); class_destroy(drm_class);