From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751269AbbJCVFD (ORCPT ); Sat, 3 Oct 2015 17:05:03 -0400 Received: from mga03.intel.com ([134.134.136.65]:30488 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751152AbbJCVEb (ORCPT ); Sat, 3 Oct 2015 17:04:31 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,630,1437462000"; d="scan'208";a="573544707" Date: Sun, 4 Oct 2015 05:02:30 +0800 From: kbuild test robot To: Daniel Thompson Cc: kbuild-all@01.org, Matt Mackall , Herbert Xu , Daniel Thompson , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, patches@linaro.org, linaro-kernel@lists.linaro.org, Maxime Coquelin , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala Subject: [PATCH] hwrng: fix simple_return.cocci warnings Message-ID: <20151003210230.GA71026@lkp-hsx03> References: <201510040505.eDq0KS9w%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1443904519-24012-3-git-send-email-daniel.thompson@linaro.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-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org drivers/char/hw_random/stm32-rng.c:164:1-4: WARNING: end returns can be simpified Simplify a trivial if-return sequence. Possibly combine with a preceding function call. Generated by: scripts/coccinelle/misc/simple_return.cocci CC: Daniel Thompson Signed-off-by: Fengguang Wu --- stm32-rng.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) --- a/drivers/char/hw_random/stm32-rng.c +++ b/drivers/char/hw_random/stm32-rng.c @@ -161,11 +161,7 @@ static int stm32_rng_probe(struct platfo priv->rng.read = stm32_rng_read, priv->rng.priv = (unsigned long) dev; - err = hwrng_register(&priv->rng); - if (err) - return err; - - return 0; + return hwrng_register(&priv->rng); } static const struct of_device_id stm32_rng_match[] = {