From patchwork Thu Jan 14 06:00:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ying Liu X-Patchwork-Id: 8029951 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2F2E3BEEE5 for ; Thu, 14 Jan 2016 06:09:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5A69220444 for ; Thu, 14 Jan 2016 06:09:08 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 8BF5A20443 for ; Thu, 14 Jan 2016 06:09:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 15CA36E7F7; Wed, 13 Jan 2016 22:09:06 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 891 seconds by postgrey-1.34 at gabe; Wed, 13 Jan 2016 22:09:04 PST Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1bon0081.outbound.protection.outlook.com [157.56.111.81]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9786D6E7F7 for ; Wed, 13 Jan 2016 22:09:04 -0800 (PST) Received: from CH1PR03CA005.namprd03.prod.outlook.com (10.255.156.150) by BN1PR03MB234.namprd03.prod.outlook.com (10.255.200.19) with Microsoft SMTP Server (TLS) id 15.1.365.19; Thu, 14 Jan 2016 05:54:12 +0000 Received: from BY2FFO11FD029.protection.gbl (10.255.156.132) by CH1PR03CA005.outlook.office365.com (10.255.156.150) with Microsoft SMTP Server (TLS) id 15.1.365.19 via Frontend Transport; Thu, 14 Jan 2016 05:54:12 +0000 Authentication-Results: spf=softfail (sender IP is 192.88.158.2) smtp.mailfrom=gmail.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=fail action=none header.from=gmail.com; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning gmail.com discourages use of 192.88.158.2 as permitted sender) Received: from az84smr01.freescale.net (192.88.158.2) by BY2FFO11FD029.mail.protection.outlook.com (10.1.14.212) with Microsoft SMTP Server (TLS) id 15.1.355.15 via Frontend Transport; Thu, 14 Jan 2016 05:54:12 +0000 Received: from victor.ap.freescale.net (victor.ap.freescale.net [10.192.241.62]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id u0E5s7vK005815; Wed, 13 Jan 2016 22:54:10 -0700 From: Liu Ying To: David Airlie Subject: [PATCH 2/2] drm/crtc_helper/set_config: Remove redundant NULL pointer check on set->mode Date: Thu, 14 Jan 2016 14:00:10 +0800 Message-ID: <1452751210-19216-2-git-send-email-gnuiyl@gmail.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1452751210-19216-1-git-send-email-gnuiyl@gmail.com> References: <1452751210-19216-1-git-send-email-gnuiyl@gmail.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 130972244521132679; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD029; 1:MC9TXRiy7Hgoqbnd9bJu7FYua6b4fvkEE0j57nsVpKN7IA/iBMYvvkhI0io6OL4cvl9/ASYOFY2ahTCHQFcnyzp/rKl4O1bALULpQDcN+0DTF9Qql+MMU8hnjzRB0Rwq1OrUsUalSWr95ZnG82Mxpu0hpD392YKvZKBVyw2p0Jk0ltt0itIemlmWEMxzgzlGxWqHrSU710nGVTk42VTjQtVWd+m0y5m5e7xYsUrySA0CV71gagN/MLicKIj29RYIHArOcu3lucN6juX6Bg4AS7rOvaef33DQIzYn+MtX7y5SOZkKqBXaP/AQhdhannJJScgDc1Fn8K5EzHFsxuN/NynWNYo4cMCXPuk+9op1eJ9908I1Ac379u247ajVH4CIo8niRXT1glaMcSI53bvA6ZpQtkfFnLX/NmM7XuSqe9+F3NECy0LB+Ljf4+yvARBt X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(199003)(189002)(55446002)(81442002)(19580405001)(5003940100001)(5001960100002)(50986999)(86362001)(87572001)(110136002)(76176999)(189998001)(82202001)(50226001)(69596002)(105596002)(36756003)(50466002)(19580395003)(106466001)(6260500002)(73972006)(61266001)(6806005)(92566002)(5008740100001)(47776003)(76482005)(97736004)(33646002)(48376002)(4326007)(11100500001)(81156007)(73392002)(104016004)(1096002)(1220700001)(87936001)(77096005)(586003)(2906002)(229853001)(2950100001)(83322999); DIR:OUT; SFP:1101; SCL:1; SRVR:BN1PR03MB234; H:az84smr01.freescale.net; FPR:; SPF:SoftFail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 3eeae538-1263-459b-2287-08d31ca72095 X-Microsoft-Exchange-Diagnostics: 1; BN1PR03MB234; 2:OZRPyI1GSkomTCw26cmgX1qZ/Q5NEG4YhP0vQVp3J1pLaVl4W1APmoefZtNumsH/C/PUzRCOu6qRLsZAdrsfxeLBvujJqlRhNJXie/nqHmcpAIQNQg7CLNLXXwCbJeyuZu+c2KI9YEjbFCOBZK82FnmUwLv/iUj6p/oVdeQudKrmdXGgp9BMFkKV1wzbjPYU; 3:QYgn2QyoyO8eflV6wklL9seiKBXhhH3Vfd4EbfPbb2uX9bz8N89H/RsR98gJuvCL7Ho3NLifeaK6NzVt2rOssoxLU9mW9KSQV7BT1+iMtA5IDma029EQps3gDD8Zm1YetGEJxTmbEHTrNveXiFgX05u9xd4F/bp4gWx7VJDEycZeEVQCNIeQ5e1Ocmu79/ATd6BY842liwQZ/KzMS/iaAwuyAX5WujQvttI12Hi/k6c=; 25:hyW4f6uUPJHPxSDLy5RTTQ3Y7MJPlNQqjHVDEPxAwS3gkAEjxz5viXRCGHNs33G7kH1pg3CD6A8J++5QgEBml+AE++VbhVCuqFWR5w90MQCwIP8Zh6bKJQp0fhHqRP3kZ/XvGFYnkc4v0nfHAYt22DVsP+anA/KgEz35HH0bz98odqhfNgHyEg8M1JUIYQqgapJ8VLBYTDJOA65wVP+BeJsdbNPeh/0yuyXY/2OFLApDDuVbcy1p5qg2mGGC7Kov X-Exchange-Antispam-Report-Test: UriScan:; BCL:0; PCL:0; RULEID:; SRVR:BN1PR03MB234; UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(520078)(5005006)(8121501046)(13018025)(13017025)(13015025)(10201501046)(3002001); SRVR:BN1PR03MB234; BCL:0; PCL:0; RULEID:(400006); SRVR:BN1PR03MB234; X-Microsoft-Exchange-Diagnostics: 1; BN1PR03MB234; 4:12dBfYkO3q/g6NTzIin3iTcyJRfaymXAwU1rGO0Sn5lYoZl8BfNRrP3fk0QnP9OcRAG1BaO+N/D5xU6AEobqOdTuew0XtRvh5RBO+E4TD2l9sovU4c2S6XRl0tcF9KGCX7gN1BKHu5JYZkFhLpgOcyGPhLSa2hDUDFl9b/sttiH/o3r78dqpjXl/9G7IGs2W8te5mMhV4ZnBXwZyHpYFPzFh55THw0jsgG+2JU1MSmXGl/6Pa42bTZSIU+94t1cX+zeETVUd8Ca7jVrk++R7MEmcmugg1Zt1KOXSlhFeu6LAyUelcR6OoD5cM+pW+Pih6nL6qpU5IxQD/1BYifcimPXiHzYHE/3sOG/Pf0RlAaKRBwlSNmvb7UCfLkMPHEaGkQAAQDtDh2/WOwWj/FWQ2dNZMx94B6YmKwCqvpqDwNZo3vmGK2VJoLsFWgNsFYX8 X-Forefront-PRVS: 08213D42D3 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN1PR03MB234; 23:lpJwqh0fC7755HKtGMZ/AKAGNBbWkaKootetNubKJd?= =?us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rwtFfMtNXjHOcgF?= =?us-ascii?Q?CQl4Ky47i0fIPKub6yjzKibEOj/Ojt4tiEvYfUw9SfjAU2ewn3aRFEFy8xKI?= =?us-ascii?Q?3kU9+SrWGfxujQsuHplvZUOReNVH3s5kX4UHdDYr67yZW5N1B9Di5lhk4jyy?= =?us-ascii?Q?sPB5e7TBlG76iRtaD4IUjTqkgAgwVhmnRkByHmp4p9KXZqrkDgKTxI4MPIxm?= =?us-ascii?Q?Eee7g/QMGUaDobQ+aHR2tSANzK9BKQy9mKUPNalU+CVjfoh61us1IWUr+sXZ?= =?us-ascii?Q?tfHIM+0r5lOZms/Lf2v368wyz3tuwRBFaLrxVo6lvTxXfN9qbFAW+MlbUR8G?= =?us-ascii?Q?/P9YfIdicMnHdcrvw=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN1PR03MB234; 5:yAOw9ySqZ2sjGvvfTnkS311mnHmmLZ+P9IL1vqsdJcOutjNSTh6GDOG30S2CtioH1ym1wXHgJcAGGT/ui87yYE3mq9awa28rCqjmhAEJvy0M3zTtMCLbcXCXFcUTVn/JCRKcDG3a+CXhrEDtSHhkzfVWV2BS4/ONlqOLrPv8ct4=; 24:GLcPxEDXU/rrlT5PIgrIDI4Ht3zohGoANe1ovtR/dWDypP6ulJSyTPWdKOftddjOWHBNit54TffzTOo/XLEKVpO3Y/VvV5VypRKBoxl5pAE= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jan 2016 05:54:12.0040 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN1PR03MB234 Cc: dri-devel@lists.freedesktop.org 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, 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 We've done sanity NULL pointer check on set->mode at the beginning of drm_crtc_helper_set_config() and bailed out if necessary, thus any later on check is redundant. Signed-off-by: Liu Ying --- drivers/gpu/drm/drm_crtc_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index cd3fbc1..e333358 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c @@ -551,7 +551,7 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set) if (set->x != set->crtc->x || set->y != set->crtc->y) fb_changed = true; - if (set->mode && !drm_mode_equal(set->mode, &set->crtc->mode)) { + if (!drm_mode_equal(set->mode, &set->crtc->mode)) { DRM_DEBUG_KMS("modes are different, full mode set\n"); drm_mode_debug_printmodeline(&set->crtc->mode); drm_mode_debug_printmodeline(set->mode);