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: 9349691 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 022256086A for ; Sun, 25 Sep 2016 12:16:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E71E328D27 for ; Sun, 25 Sep 2016 12:16:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DC32D28D99; 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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 CBFF728D47 for ; Sun, 25 Sep 2016 12:16:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966128AbcIYMQj (ORCPT ); Sun, 25 Sep 2016 08:16:39 -0400 Received: from mail-pa0-f67.google.com ([209.85.220.67]:36125 "EHLO mail-pa0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965809AbcIYMQj (ORCPT ); Sun, 25 Sep 2016 08:16:39 -0400 Received: by mail-pa0-f67.google.com with SMTP id my20so7383254pab.3 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=AnqAu43Dpf/8kFzTqQL+tbxpJHXhswjwsItHEA0sEFqmKE9wesLkklzi3lFTba2TrI Y/ikB4+BEanyxQD92Uhlj6jgo/xQX5lY3tcdBqjGIlEkOqX3RlT5v+lvN0cNUgmwzRlX MTZQqDNpXrpehQ1GwttmoPxfnWDAdVhtGjc+wcHu4bPi650YpNyrCHCiIxtekHdflhNk lM+rV5Lvkz9Gio+XWUlf7cPvR/G8ftCC1PAgFCPeD1iEVgFg7S7cP4DDJAETH4hVSW1v bvrZrtT0kxnWv8qKWXOAtM5j7/rn9VCVNVry4mFcmpH7kThlJv94ZyHeX1iIP0QM8dGa Ynhw== X-Gm-Message-State: AE9vXwMjVr7wcKC7rGrqMHSFcNU5S1/z8189Fc4CBgpwGMfqJsZ2B4DfGMYSjjm0bdjL1g== 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-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@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);