From patchwork Tue Nov 9 11:48:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 12610467 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3A223C433EF for ; Tue, 9 Nov 2021 11:49:15 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F034A60D42 for ; Tue, 9 Nov 2021 11:49:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org F034A60D42 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 785C86E8A3; Tue, 9 Nov 2021 11:49:13 +0000 (UTC) Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7F7F96E8A3; Tue, 9 Nov 2021 11:49:12 +0000 (UTC) Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1A9A078e017419; Tue, 9 Nov 2021 11:49:08 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : content-type : mime-version; s=corp-2021-07-09; bh=h5/eBmu47csnu766K5nMaghwmJ3AsR23URowhF9jqUk=; b=gBo1OYI1aVJw8EmjeMDrCNXC/YFXz96bpf+DljjSCpDE0SsZQhy7e5NWKtg2hV+Gb8X/ SGH/bfuLtmLpUzmIshRPODx2YjnSU4hjAHak2+pL6QECWHU/K+z5Tgr8kviAd/LVEaBb j3C92cTJxQMfvPjl0BvwTvgrrXhGBXvohWuxZ1IuY7Sli6x2UOWmrekJDigdEunWO5IP YIgkXgbGQx6MLoupMdh11vHoiE47XDY0sC2FtZQiQULqyXjslxry573rD4+VESWwGKmD Wgaos0DMpmanNF9/36wT3c0XvWhocXg0/RlzwjPLUIT2Je+N6mmocYABW9QrbxkgaME2 FQ== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 3c6sbk9xm3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 09 Nov 2021 11:49:08 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 1A9BkFx4125893; Tue, 9 Nov 2021 11:49:07 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2173.outbound.protection.outlook.com [104.47.57.173]) by aserp3020.oracle.com with ESMTP id 3c5hh3g1rf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 09 Nov 2021 11:49:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BLlTOvNQLtNq0KprxFdC5fBWRyZjtCnYUOmLwL2T1+cP3A+miXx7qJd8iSx4Fu9GoooRaJGnVaBii3bPiF4MEYWSFNiFE1N5PCpE1ZgBNR9wRv4w4AP1bRJbfd+YC9LO5DhFpWqeODTqfxwEx1dC3XuPn9Z3PsITWafRUGW+EySQ2oCiYSDBnd29pfTFeiVLC1W4/nAYiASSmQSY+GQRJElQh0TcyakZ0VMRx35wZyufYBQ7CWH/LLLKXSxtYNPKqqWPQNpcflrpv571GupNiwDtfXVJ/uXElSpeU8cy/b9RsLb/UvNyqV5/b+k9lIm4mQq3KA1BcEmIAO22mw2vGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=h5/eBmu47csnu766K5nMaghwmJ3AsR23URowhF9jqUk=; b=lp2XUe7fUZJ75gH2XA9iSGoKrR8g4Ryv0eGQs1pr8f++nW1ZsPN6KeQaZxLWmPYuLPiMgnQVKYL+08lZTm/JWbTqlHHbAV9LM8UVUdwIRnmxHr7k/GzuWN6tTmoxIswUdhHfsKGYmMwwsNSXiNv3tqVmvjpn7mfrUF80aFttv6zLFUPsSjASuKZF1aBPFdQwtOqfhNoKcjgEJxyZSoF1M8TKqcbO8WlL0e0icPW8kL5JGcagtohuTwE6R0gTUpk0KJn53utJGn4uH9L6wYOtf2+07Haf76WGOEjhkCoeB6QCsM3RoL4ZIQ9SfZNh94FEHDnc7EKhodCUuBVzEa5R/A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=h5/eBmu47csnu766K5nMaghwmJ3AsR23URowhF9jqUk=; b=Vo4VkvVSt8jwxVttV/A8XiFxKxWNbB1vrN8KbWPv++AbmtySCMvrdl17H3VFq/LCrOitgOOu61HQuImYhTLTF8X/Xc7XmLpVQOV/3T+MmxtNTdZMdsDSN9oXeFAwih1cCELkfGeLotW/evOYbAxf+TSh39KWiCVd2O/KuPkkvEg= Authentication-Results: linux.intel.com; dkim=none (message not signed) header.d=none; linux.intel.com; dmarc=none action=none header.from=oracle.com; Received: from MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) by MWHPR10MB1999.namprd10.prod.outlook.com (2603:10b6:300:10a::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.15; Tue, 9 Nov 2021 11:49:05 +0000 Received: from MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::d409:11b5:5eb2:6be9]) by MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::d409:11b5:5eb2:6be9%5]) with mapi id 15.20.4690.015; Tue, 9 Nov 2021 11:49:05 +0000 Date: Tue, 9 Nov 2021 14:48:50 +0300 From: Dan Carpenter To: Jani Nikula , Maarten Lankhorst Subject: [PATCH] drm/i915: pin: delete duplicate check in intel_pin_and_fence_fb_obj() Message-ID: <20211109114850.GB16587@kili> Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: Mutt/1.10.1 (2018-07-13) X-ClientProxiedBy: AS9PR06CA0085.eurprd06.prod.outlook.com (2603:10a6:20b:464::15) To MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) MIME-Version: 1.0 Received: from kili (102.222.70.114) by AS9PR06CA0085.eurprd06.prod.outlook.com (2603:10a6:20b:464::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11 via Frontend Transport; Tue, 9 Nov 2021 11:49:00 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ed380d19-2ba8-44c5-53db-08d9a376ee3a X-MS-TrafficTypeDiagnostic: MWHPR10MB1999: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1303; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2g+/54rzoNnEcQ48IW5r/eqebNnJEnruECDE55D04ORIBeYJjcOpQDiR/Pa++6VNA/1dWhYThcZZE5QcNZlnmjJdvS9p1nX5qlzz+ml1sPVDsOhAfxWOlPsRHWFsW1qBwvj0SreV999iLHEBxd+Pc27uePVON1ocMKhHYdHtjEwRlZ9cwPG4zoZcOyXSBOlkiPk+234VO1lI7EQla4JPEHL4IyJdEkuJ+3IPrkdqk3llIFREDGPD0TCC0w0MvcA249Qs+GDyc8RQkoW1PMZZgRKF1KyQj+sWzkVUPXqluNMyXZ54OMxpCdRWD4ZW2zK/ZE4yC+NbPSPDoNwfu665UPtGxNHmUjVStbe7XadofeFrkltdz9Qj0oY/ubcWnP2sSlmDdQ+3wt1asWUuO6eMqS3pYo817VCNhCXFjVakgl92tU8Ob+yXJ9VUB+ejygHTcfML5/9Wt7Y2cLHC+8lVtdfrsgNKXJ6YWu1QXs4fzONLYoblKVYFBBdkri2W620t0wPWTTrpWC2idZ4x8Uq5ha6LSJO97cJvRbg2wQhyDqgiEdesAEtr+PCb6HLXwITPMZTHpxhlBZSHH04RyBDQyPMXiO6Ur2bMhV1Ugd11BO84fr5J5lJCaH2TbmlLWSFJaIJZBGx5eLsd2T7B0kwT4l3Sr2ukwNyLidLpakTIS2QdUpJwK7zhY/JkQBGCBzBpmEauOudzWpxTn0XU61z8FA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR1001MB2365.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(8936002)(33656002)(508600001)(7416002)(55016002)(110136005)(6496006)(26005)(186003)(9576002)(33716001)(54906003)(52116002)(86362001)(4326008)(4744005)(316002)(44832011)(9686003)(66946007)(38350700002)(38100700002)(6666004)(1076003)(83380400001)(956004)(5660300002)(2906002)(66556008)(66476007)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-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Gv5Ln44sXyIKO0nfabMSA/CYe042I+EBfcIirEhPFxphnTc6DPhMLmsdwS8HGj4u9txa49fTMf1rUjT6nUM25oVWDPnHuVzZwsHbozlEO+qrTfZ0zdchfSzBznH4GdrUWVNvuqubVzcyKW4aMn0NEttFaTjP/edrxELIcFfqcbvJlqtni3OTQMM+66X5QvLkq+zqhoWRdN4beOgP1DsOuVgatGffhQtVKOZLv5oyf6m1nzWMH4I/SsvfC2GByzb6TaNPmORux07vyFPhIhQNtMLcFTRfP+QUj3JCkKdfybj15NZP0yraqFAu8PKLdSXvNJOgJ2QGaCxFvtKze9RjGWl/c0upQr0SpPCLriJfM7TD1MkUgdfOXHBJSrW2R0LzJSoAeeMWjCriB7VMky2YZFmDoXfZmOSgHeoJd1Z51GBgY+8OnzM9ifCora28Takbt1+ke8DJkpY/Y1atfmy4chh8H71cYeoapy4iag/IOI5BR7aZu/n/qR0/AehPLv9E9i+fS2R8BFQQZPRcxbemcRPbw3lvuYK+ccMl/eJQ6QxWHlvr/wgr+26tdtguyzIcpzXP3cfImeEKB6Vg12AJv/dmbGIrKWkoEUZia+S9z4ZR9qbaxCXN2zJHfz3kpAD11IP6tfhqe1BI= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ed380d19-2ba8-44c5-53db-08d9a376ee3a X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2365.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Nov 2021 11:49:05.1741 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ndI0KZmS987gtV4LaePrYe1IqmUBIr9keDTuf57OVggKn0y+fnuO1CZXp4b2r9D0NOC866qOHkCt/BY34p4CiSW10qBPE5YThQweGA8r/HM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR10MB1999 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10162 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 bulkscore=0 mlxscore=0 malwarescore=0 spamscore=0 adultscore=0 suspectscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2111090071 X-Proofpoint-GUID: Zmkst-Q9M7DnMZpUOZWwJtpvE81UvX2x X-Proofpoint-ORIG-GUID: Zmkst-Q9M7DnMZpUOZWwJtpvE81UvX2x X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , intel-gfx@lists.freedesktop.org, kernel-janitors@vger.kernel.org, dri-devel@lists.freedesktop.org, Rodrigo Vivi , Dave Airlie Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The "ret" variable is checked on the previous line so we know it's zero. No need to check again. Signed-off-by: Dan Carpenter Reviewed-by: Rodrigo Vivi --- drivers/gpu/drm/i915/display/intel_fb_pin.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_fb_pin.c b/drivers/gpu/drm/i915/display/intel_fb_pin.c index 3f77f3013584..3b20f69e0240 100644 --- a/drivers/gpu/drm/i915/display/intel_fb_pin.c +++ b/drivers/gpu/drm/i915/display/intel_fb_pin.c @@ -142,13 +142,11 @@ intel_pin_and_fence_fb_obj(struct drm_framebuffer *fb, if (ret) goto err; - if (!ret) { - vma = i915_gem_object_pin_to_display_plane(obj, &ww, alignment, - view, pinctl); - if (IS_ERR(vma)) { - ret = PTR_ERR(vma); - goto err_unpin; - } + vma = i915_gem_object_pin_to_display_plane(obj, &ww, alignment, + view, pinctl); + if (IS_ERR(vma)) { + ret = PTR_ERR(vma); + goto err_unpin; } if (uses_fence && i915_vma_is_map_and_fenceable(vma)) {