From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751563AbdIEHlY (ORCPT ); Tue, 5 Sep 2017 03:41:24 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:34109 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750775AbdIEHlW (ORCPT ); Tue, 5 Sep 2017 03:41:22 -0400 X-Google-Smtp-Source: ADKCNb7xUetESYhF3F8Pb1VMih3EnyMtJ8iugnTas33h0eeVlcACg738v/sLWR3bTP/RKmtRzVrDoQ== From: Nicolin Chen To: rui.zhang@intel.com Cc: edubezval@gmail.com, thierry.reding@gmail.com, jonathanh@nvidia.com, wni@nvidia.com, linux-pm@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, srikars@nvidia.com Subject: [PATCH v2] thermal: tegra: remove null check for dev pointer Date: Tue, 5 Sep 2017 00:41:16 -0700 Message-Id: <1504597276-22924-1-git-send-email-nicoleotsuka@gmail.com> X-Mailer: git-send-email 2.1.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The dev pointer is going through a null check after a dereference. So this patch removes that useless check since the driver does not pass a null dev pointer in any case. Signed-off-by: Nicolin Chen --- Changelog v2: * By following Thierry's comments, changed to remove the null pointer check directly and revised the patch subject according. drivers/thermal/tegra/soctherm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/thermal/tegra/soctherm.c b/drivers/thermal/tegra/soctherm.c index 7d2db23..075db1d 100644 --- a/drivers/thermal/tegra/soctherm.c +++ b/drivers/thermal/tegra/soctherm.c @@ -483,7 +483,7 @@ static int throttrip_program(struct device *dev, unsigned int throt; u32 r, reg_off; - if (!dev || !sg || !stc || !stc->init) + if (!sg || !stc || !stc->init) return -EINVAL; temp = enforce_temp_range(dev, trip_temp) / ts->soc->thresh_grain; -- 2.1.4