All of lore.kernel.org
 help / color / mirror / Atom feed
From: Axel Lin <axel.lin@ingics.com>
To: "Rafael J . Wysocki" <rafael.j.wysocki@intel.com>
Cc: Chanwoo Choi <cw00.choi@samsung.com>,
	MyungJoo Ham <myungjoo.ham@samsung.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
	Axel Lin <axel.lin@ingics.com>
Subject: [PATCH] PM / devfreq: event: Remove unnecessary NULL test for to_devfreq_event(dev)
Date: Sun, 25 Sep 2016 20:16:28 +0800	[thread overview]
Message-ID: <1474805788-30702-1-git-send-email-axel.lin@ingics.com> (raw)

to_devfreq_event(dev) never returns NULL.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 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);
-- 
2.7.4

             reply	other threads:[~2016-09-25 12:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-25 12:16 Axel Lin [this message]
2016-09-30 13:50 ` [PATCH] PM / devfreq: event: Remove unnecessary NULL test for to_devfreq_event(dev) MyungJoo Ham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1474805788-30702-1-git-send-email-axel.lin@ingics.com \
    --to=axel.lin@ingics.com \
    --cc=cw00.choi@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=myungjoo.ham@samsung.com \
    --cc=rafael.j.wysocki@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.