From patchwork Sun Sep 25 12:16:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 9349689 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 D3E5E607F0 for ; Sun, 25 Sep 2016 12:16:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C4B9B28D27 for ; Sun, 25 Sep 2016 12:16:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B98D828DA5; Sun, 25 Sep 2016 12:16:42 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 AB44428D27 for ; Sun, 25 Sep 2016 12:16:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965809AbcIYMQj (ORCPT ); Sun, 25 Sep 2016 08:16:39 -0400 Received: from mail-pa0-f65.google.com ([209.85.220.65]:35246 "EHLO mail-pa0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965989AbcIYMQj (ORCPT ); Sun, 25 Sep 2016 08:16:39 -0400 Received: by mail-pa0-f65.google.com with SMTP id zl8so733127pac.2 for ; Sun, 25 Sep 2016 05:16:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ingics-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=7kQ5sWC7Gsb/fdvsExD7039e8fEZwMn6TG9OK99kQQg=; b=tcfuEv7JHinrqjQDm9XL/wmr3SBsWWB/PUT3fE0o46Wc2qJhPvtw0BNUtwoROniSLS 9qsJrjKUxNflxv3MrvNjk67iSqOomrsQpaoJjXFCuzRb2op2KnfC8dmcKXMMBl9rJ96q T62VKq9EX+ryyHEAs9P2MuNdTlu+I24ZRBGtyEa4HH4UPK0Yq1LecwcaptUNO45A2b/0 vtiuzBAMrepEl5CSdm6NcYVys3fkjQgY/hWiL9Y0DB0SMxWSzTYH0NVwwTzCtvvMr9W2 PqV2TELz0pnqNG6R3MgYIDdxXf6FhWoLeI+h9eCNJIh6dg5GQH+qe+ZKDA3rCtkmloeQ AMqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=7kQ5sWC7Gsb/fdvsExD7039e8fEZwMn6TG9OK99kQQg=; b=ER4rmAb9NFgeuKQeak/o1aZWrpL++rsI7U18ErVgSeNypOEIiVEPzQ4m/Q6uKIn4F2 dIxBokkvFHPmbC9iLgeVlqKfgeZLdygSfTVmzDCOG5V/VA36pcNnlJ71KGl/PQkxbfZp rkiaVeTuX43eQDsZ65o/8uXz8gcpHT53beh4sivFNQxaHL7OYsZpYXb4PanPomIlibdU hIGWNgGCzFiDPhZ4Fv9VJAqLPErTQvdk7Gn9WXsH4XSfzuh+8hH+Hjwqpa/msbvPrCki dx01eu59qVLsZiZBqaDMDfWgAVI0LOBLGzbtePCTwrhLLwfS4LJdqZIbJINBNcF6LGc5 R+2w== X-Gm-Message-State: AE9vXwNlkobfn0K4quzGVgbmEztkd13YqgpbwIMDkwebMZ4QgubxsNQGhKrg83d1dsYcpQ== X-Received: by 10.66.131.74 with SMTP id ok10mr28901180pab.126.1474805798268; Sun, 25 Sep 2016 05:16:38 -0700 (PDT) Received: from localhost.localdomain (223-137-0-10.EMOME-IP.hinet.net. [223.137.0.10]) by smtp.gmail.com with ESMTPSA id bu15sm23769370pac.15.2016.09.25.05.16.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 25 Sep 2016 05:16:37 -0700 (PDT) From: Axel Lin To: "Rafael J . Wysocki" Cc: Chanwoo Choi , MyungJoo Ham , Kyungmin Park , linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, Axel Lin Subject: [PATCH] PM / devfreq: event: Remove unnecessary NULL test for to_devfreq_event(dev) Date: Sun, 25 Sep 2016 20:16:28 +0800 Message-Id: <1474805788-30702-1-git-send-email-axel.lin@ingics.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 to_devfreq_event(dev) never returns NULL. Signed-off-by: Axel Lin --- drivers/devfreq/devfreq-event.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/devfreq/devfreq-event.c b/drivers/devfreq/devfreq-event.c index 9aea2c7..d0ae087 100644 --- a/drivers/devfreq/devfreq-event.c +++ b/drivers/devfreq/devfreq-event.c @@ -442,7 +442,7 @@ static ssize_t name_show(struct device *dev, struct device_attribute *attr, { struct devfreq_event_dev *edev = to_devfreq_event(dev); - if (!edev || !edev->desc) + if (!edev->desc) return -EINVAL; return sprintf(buf, "%s\n", edev->desc->name); @@ -454,7 +454,7 @@ static ssize_t enable_count_show(struct device *dev, { struct devfreq_event_dev *edev = to_devfreq_event(dev); - if (!edev || !edev->desc) + if (!edev->desc) return -EINVAL; return sprintf(buf, "%d\n", edev->enable_count);