From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A4DC4C47095 for ; Sun, 4 Oct 2020 06:38:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7CC81206C1 for ; Sun, 4 Oct 2020 06:38:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725869AbgJDGij (ORCPT ); Sun, 4 Oct 2020 02:38:39 -0400 Received: from mga02.intel.com ([134.134.136.20]:50463 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725822AbgJDGij (ORCPT ); Sun, 4 Oct 2020 02:38:39 -0400 IronPort-SDR: oRkwN+tksBQpBG3gpnd9M1QRPwcYPWC/+Hlq/ricmBeU+ZYcweNWw4uExoto5WKwZK0NseLBZZ qMcF833tkoXg== X-IronPort-AV: E=McAfee;i="6000,8403,9763"; a="150898396" X-IronPort-AV: E=Sophos;i="5.77,334,1596524400"; d="scan'208";a="150898396" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Oct 2020 23:38:34 -0700 IronPort-SDR: EIqaZYua/mXODrDO2YZWX+rDJErjwmrYUpwAUumB7CXC5SFCkeoTcnPNTy0qLmGdVpVTHb0jOs t3o05X+7hOnw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,334,1596524400"; d="scan'208";a="295760758" Received: from lkp-server02.sh.intel.com (HELO b5ae2f167493) ([10.239.97.151]) by fmsmga008.fm.intel.com with ESMTP; 03 Oct 2020 23:38:32 -0700 Received: from kbuild by b5ae2f167493 with local (Exim 4.92) (envelope-from ) id 1kOxfD-0000Mc-Ch; Sun, 04 Oct 2020 06:38:31 +0000 Date: Sun, 4 Oct 2020 14:37:55 +0800 From: kernel test robot To: Naveen Krishna Chatradhi Cc: kbuild-all@lists.01.org, linux-hwmon@vger.kernel.org, Guenter Roeck , Jean Delvare , linux-kernel@vger.kernel.org Subject: [PATCH] hwmon: fix ptr_ret.cocci warnings Message-ID: <20201004063755.GA47627@fe6c56ecaa6d> References: <202010041453.4f94XEJB-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202010041453.4f94XEJB-lkp@intel.com> X-Patchwork-Hint: ignore User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: kernel test robot drivers/hwmon/amd_energy.c:302:1-3: WARNING: PTR_ERR_OR_ZERO can be used Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR Generated by: scripts/coccinelle/api/ptr_ret.cocci Fixes: 911766432fd2 ("hwmon: (amd_energy) Improve the accumulation logic") CC: Naveen Krishna Chatradhi Signed-off-by: kernel test robot --- tree: https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next head: 78a28192e301da58ac408f2e98fa30aebafbfda0 commit: 911766432fd2a6054d9813845ad3f48120bd649c [45/55] hwmon: (amd_energy) Improve the accumulation logic amd_energy.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) --- a/drivers/hwmon/amd_energy.c +++ b/drivers/hwmon/amd_energy.c @@ -299,10 +299,7 @@ static int amd_energy_probe(struct platf data->wrap_accumulate = kthread_run(energy_accumulator, data, "%s", dev_name(hwmon_dev)); - if (IS_ERR(data->wrap_accumulate)) - return PTR_ERR(data->wrap_accumulate); - - return 0; + return PTR_ERR_OR_ZERO(data->wrap_accumulate); } static int amd_energy_remove(struct platform_device *pdev)