From patchwork Tue May 14 19:03:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yurii Pavlovskyi X-Patchwork-Id: 10943631 X-Patchwork-Delegate: andy.shevchenko@gmail.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A71276C5 for ; Tue, 14 May 2019 19:03:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 95AF2288B2 for ; Tue, 14 May 2019 19:03:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8862D288B9; Tue, 14 May 2019 19:03:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3AF59288B2 for ; Tue, 14 May 2019 19:03:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726525AbfENTD5 (ORCPT ); Tue, 14 May 2019 15:03:57 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:54182 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726261AbfENTD5 (ORCPT ); Tue, 14 May 2019 15:03:57 -0400 Received: by mail-wm1-f66.google.com with SMTP id 198so186149wme.3; Tue, 14 May 2019 12:03:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:cc:references:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=sYVFDe3XqiJYZ+Tuzea4frhnmRETpX1L6lMup8xZtl4=; b=Fk3l+KWqIIZwCrXmXQw/HBB3jC+TlCkRV1reTLvun1PUrOnB7zdmo8Ou5HysPsE8Sx UQUwsTPMDVj4C74rilPIyn6TLodnbCnyn/C0xaCg1s1eTv17MIfJTbnfm1VKN4s5Vor0 jnsoCvjMMMk1NxVmRGYU5i0bo7f6xbgqWHFpcXd0JHxR5frVSA/gVZlDUNrKOoP7687x q7TVwTHy0vz2JBwRQ6p3N3WIPgnwHZ3Fb47cHmsP00yPhhm8jAkWy1fSeiTN7uXncxFR jfsiqXrEKCrr06TSKlt4cokIokIDSrtfinGxMq3XN5mVP3adCl+r//B9MfcLK3034BSu YZuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=sYVFDe3XqiJYZ+Tuzea4frhnmRETpX1L6lMup8xZtl4=; b=D75rEJMqDh29+7f626yPbdhfuckQiA816oE7bTBaw0pArY3NugARIOmaUmok1wIUJt u7H5UKIztBq4ICc40spHLZE1qs/dLnHFbjDSV5aS0qsdjoXylYZyJ+NlqVRNhgAY493j Cdfr2ppf3ZczrivytK90VYFRqIdcJ9mRX5UMBTvopN0hWYb5o/u0NQmb1XygFHhCEZWw Ngfw82V33yH0IyLSanD6vVzKsFHKFzcDeGNNF5Ne3ESxgs/M/IDtM/uQsxK04TXvS2N+ T1BofN98kmKpNhd4xvl6XvLhfpa/RiV+iDXu2P+3Nn1ACT13WTVZz3w01MUZSMkRlbSi KOUg== X-Gm-Message-State: APjAAAVFlZlzGFG7FUfcCc2piZ62QZ0k0Ybwt8yLLK+Ii96OFEwus0MU /wu6C2uG/VKbqhO8uEtz8GMDyhPm X-Google-Smtp-Source: APXvYqyX0XNMs0j6zQtvmRM5tuqM0jYm2QFJfJx+fzJ9g3rwQQRpJBojJeR+Q/sFDCgqkEnfDi2PJg== X-Received: by 2002:a1c:9d0f:: with SMTP id g15mr21128730wme.97.1557860634659; Tue, 14 May 2019 12:03:54 -0700 (PDT) Received: from [192.168.20.141] ([194.99.104.18]) by smtp.gmail.com with ESMTPSA id 15sm3999650wmg.36.2019.05.14.12.03.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 May 2019 12:03:54 -0700 (PDT) Subject: [PATCH v4 09/13] platform/x86: asus-wmi: Refactor error handling From: Yurii Pavlovskyi Cc: Corentin Chary , Darren Hart , Andy Shevchenko , Daniel Drake , Chris Chiu , acpi4asus-user@lists.sourceforge.net, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org References: Message-ID: <18233d8b-0724-f0c7-2931-def225bd650c@gmail.com> Date: Tue, 14 May 2019 21:03:50 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US To: unlisted-recipients:; (no To-header on input) Sender: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Remove exit label as it is only used once from the point in code where no cleanup is required and return can be called immediately. Signed-off-by: Yurii Pavlovskyi --- drivers/platform/x86/asus-wmi.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c index 7bfac06abae4..090a00af4017 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c @@ -255,7 +255,7 @@ static int asus_wmi_evaluate_method3(u32 method_id, &input, &output); if (ACPI_FAILURE(status)) - goto exit; + return -EIO; obj = (union acpi_object *)output.pointer; if (obj && obj->type == ACPI_TYPE_INTEGER) @@ -266,10 +266,6 @@ static int asus_wmi_evaluate_method3(u32 method_id, kfree(obj); -exit: - if (ACPI_FAILURE(status)) - return -EIO; - if (tmp == ASUS_WMI_UNSUPPORTED_METHOD) return -ENODEV;