From patchwork Thu May 31 06:45:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fengguang Wu X-Patchwork-Id: 10440385 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 EAAEF603B5 for ; Thu, 31 May 2018 06:46:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D9CE3287B7 for ; Thu, 31 May 2018 06:46:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CC98428BCE; Thu, 31 May 2018 06:46:29 +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=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 706E3287B7 for ; Thu, 31 May 2018 06:46:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753987AbeEaGqO (ORCPT ); Thu, 31 May 2018 02:46:14 -0400 Received: from mga02.intel.com ([134.134.136.20]:58534 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753868AbeEaGqN (ORCPT ); Thu, 31 May 2018 02:46:13 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 May 2018 23:46:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,463,1520924400"; d="scan'208";a="204131565" Received: from bee.sh.intel.com (HELO bee) ([10.239.97.14]) by orsmga004.jf.intel.com with ESMTP; 30 May 2018 23:46:07 -0700 Received: from kbuild by bee with local (Exim 4.84_2) (envelope-from ) id 1fOHLZ-000Uf5-JU; Thu, 31 May 2018 14:46:05 +0800 Date: Thu, 31 May 2018 14:45:35 +0800 From: kbuild test robot To: Joel Fernandes Cc: kbuild-all@01.org, linux-kernel@vger.kernel.org, kernel-team@android.com, "Joel Fernandes (Google)" , Boqun Feng , Byungchul Park , Erick Reyes , Ingo Molnar , Julia Cartwright , linux-kselftest@vger.kernel.org, Masami Hiramatsu , Mathieu Desnoyers , Namhyung Kim , Paul McKenney , Peter Zijlstra , Shuah Khan , Steven Rostedt , Thomas Glexiner , Todd Kjos , Tom Zanussi Subject: [PATCH] kselftests: fix ptr_ret.cocci warnings Message-ID: <20180531064535.GA53792@lkp-ib04> References: <20180530000500.257225-9-joel@joelfernandes.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20180530000500.257225-9-joel@joelfernandes.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: fengguang.wu@intel.com X-SA-Exim-Scanned: No (on bee); SAEximRunCond expanded to false Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: kbuild test robot lib/test_atomic_sections.c:66: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: 3b0e47f0ade1 ("kselftests: Add tests for the preemptoff and irqsoff tracers") CC: Joel Fernandes (Google) Signed-off-by: kbuild test robot --- test_atomic_sections.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/lib/test_atomic_sections.c +++ b/lib/test_atomic_sections.c @@ -63,10 +63,7 @@ static int __init atomic_sect_init(void) snprintf(task_name, 50, "%s dis test", atomic_mode); test_task = kthread_run((void*)atomic_sect_run, NULL, task_name); - if (IS_ERR(test_task)) - return PTR_ERR(test_task); - - return 0; + return PTR_ERR_OR_ZERO(test_task); } static void __exit atomic_sect_exit(void)