From patchwork Sat Nov 11 17:47:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 10054451 X-Patchwork-Delegate: rjw@sisk.pl Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 45E8960632 for ; Sat, 11 Nov 2017 17:47:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 373DD299B1 for ; Sat, 11 Nov 2017 17:47:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2863D29C11; Sat, 11 Nov 2017 17:47:40 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 B990A299B1 for ; Sat, 11 Nov 2017 17:47:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751741AbdKKRri (ORCPT ); Sat, 11 Nov 2017 12:47:38 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:50097 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751699AbdKKRrh (ORCPT ); Sat, 11 Nov 2017 12:47:37 -0500 Received: by mail-pg0-f68.google.com with SMTP id g6so9717663pgn.6; Sat, 11 Nov 2017 09:47:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=YrJkI9er14YXYhQZHJ87IZcTGhF/8uTF693zWoSNGUE=; b=Vzzv83IbczVLbFBnTs1krGd2deG8FwddsxnOx8GAHZ1LGWVwejRDGRGWIkXiAiqj4V h3cs+fJDQetZEMphD5w/QlJi7rGcqlCVXW5Ogx/l2GgyrJuHR7FRygemuVb5Mtj1y82K 2d/q5o+dRUzfE9ixTEw86edwwwJSbWgbycsAv3a0NnqZ7vmWq3M+xtg6wmD0RfX4IsQz DiQBQo8oQPT9PuBNh24yDLwvEuB/mfeoumimPiZzBnlvF380i854SnAxYO1QHzYdgoe6 Y7VB4F3x+l9akQO36bgYVFcM9lBXOiw8UAN6X1Ec41gsLF+OxECya92NfepNYE2tCjqc FN1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=YrJkI9er14YXYhQZHJ87IZcTGhF/8uTF693zWoSNGUE=; b=W4AM+FqlWny8UjRAxaCfS3MbL95+Gg3J9XtmBNdEnosRuzkWncQjHEpavFdx6uGV69 iUmI2+2ByKbbyUIMaWQlKDpc5HKRof+ZjYx0++7Fxlbpf1/zYYYhXGF5dPUnTNiAxo8V X8EI9FXnZBkrlDyvzGIyi/h15TYD4EcrxpubANFwGSVkPC8i4Dz+TJZTYuzM8888QpK3 N3gdnO0P5SKrOwJzZ+YE9nh8feB9rKWJ/HIxUV4BnBhP8yM8OGZKp3JcWdLsIWFcbCw0 v8nAVsGGthUUQZ43WXi6PwrkZRzHHkCQ4C2zUPMTVIBXtZyGKMMOeOQtQIfAUlblnlj5 JfMA== X-Gm-Message-State: AJaThX4oFpkcp2O2zA9j+az4PUEtMblKSjY4qWJBEZYaULQIYq4eafot xbz0ppbIee9Fk9sm9I2d2sO3xg== X-Google-Smtp-Source: AGs4zMY+0s+m3TdGkXh6rd7n+gJTyS/C81/9Srgqji/DjtQEAfVgvY5yA2VAchzjxkxhBZU5jV1Xhg== X-Received: by 10.84.194.195 with SMTP id h61mr4162953pld.72.1510422457048; Sat, 11 Nov 2017 09:47:37 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id g11sm23683298pfe.41.2017.11.11.09.47.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 11 Nov 2017 09:47:35 -0800 (PST) From: Arvind Yadav To: rjw@rjwysocki.net Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: [PATCH] powercap: Remove reassignment Date: Sat, 11 Nov 2017 23:17:26 +0530 Message-Id: <00329a239c8b1640a9e491b6a90a5b20fd45e42c.1510422357.git.arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It is not necessary to reassignment of 'result'. Here, result is being initialized zero and then updated with seed_constraint_attributes(). class_register is enough to return successful and error value. Signed-off-by: Arvind Yadav --- drivers/powercap/powercap_sys.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/powercap/powercap_sys.c b/drivers/powercap/powercap_sys.c index 5b10b50..64b2b25 100644 --- a/drivers/powercap/powercap_sys.c +++ b/drivers/powercap/powercap_sys.c @@ -673,15 +673,13 @@ EXPORT_SYMBOL_GPL(powercap_unregister_control_type); static int __init powercap_init(void) { - int result = 0; + int result; result = seed_constraint_attributes(); if (result) return result; - result = class_register(&powercap_class); - - return result; + return class_register(&powercap_class); } device_initcall(powercap_init);