From patchwork Mon Jul 4 13:00:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitoj Kaur Chawla X-Patchwork-Id: 9212589 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 8A26C60752 for ; Mon, 4 Jul 2016 13:00:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A6732863F for ; Mon, 4 Jul 2016 13:00:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6E4F0286B7; Mon, 4 Jul 2016 13:00:30 +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=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 F29042863F for ; Mon, 4 Jul 2016 13:00:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753807AbcGDNA1 (ORCPT ); Mon, 4 Jul 2016 09:00:27 -0400 Received: from mail-pa0-f67.google.com ([209.85.220.67]:32911 "EHLO mail-pa0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753614AbcGDNA0 (ORCPT ); Mon, 4 Jul 2016 09:00:26 -0400 Received: by mail-pa0-f67.google.com with SMTP id ts6so15890584pac.0; Mon, 04 Jul 2016 06:00:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=ephJT7m8DVptyYKTxdGm3zdkakDaKgcDYuRK2huxt50=; b=SwiT6ftksvBFSrQ4rfkCvia2Phn7aPJx/q4N8sGPeTIFsVCkWexOrx5wGh2bku0gGI Z8Ad7IuimwUyoettRoxgpBhVNNbVsRiuj3c9E3r3oop5Y6Nqbn7DGYt7E3IUsQZJkH6n 49IXrN3AHTEiV9mXsEELqZT6dpKsBqA0q2K7y7f9d1N8YIBwMoz9NwpifeLGPo1qrmDH oRM3pDTRrqPRHOkMORHWVVVQpiJCxLRn/taAnGCiPqcFtdgT8co6J7TFH5wW0XLRRKVl bio5Q641auv0KqY2dQynWI24+uM17sf2wdOXRrQbCArpmRtPqlQS/98W72FAJ/QYuZal 1+uQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=ephJT7m8DVptyYKTxdGm3zdkakDaKgcDYuRK2huxt50=; b=Ny0XkRxUmnBcumf0t8iRpeQCkJbVIVyx1fOccCaH8rfTyJ65/HMHFWPV0g66LEOZtn TsX2Dc8ee6WuY8PCtqUw1eIHL8oFwS2XqHmZV7WqXIAJAxJFmk0x/yieRPwi+gopRCaJ rIngvXRie7KoN5uhUAw5vbtlmfyh4R67yGpXkKOCtzESKXKk5mIKw5lDAj5WiOC7EGVQ UeqSaS3zsnNfvLLm7aaMvqnOk+GM21odrG+FeS+CIOJxTLfwjO1yVmg4rzEpdiIE4oM7 bKmsLD4QyM0ffirmVlZEB8jz1kjBnN/Vi1M0+pffWc8qJ5ZHpmY2Sdnhwehf4ZQvFqDH 7VLA== X-Gm-Message-State: ALyK8tIR+V+QPMB40WPMCWQeTZFe2MXnzBbOafGNq8ZOh5jnvq4u4uSvarVAnZl9CTwWVQ== X-Received: by 10.66.52.106 with SMTP id s10mr22388699pao.65.1467637225621; Mon, 04 Jul 2016 06:00:25 -0700 (PDT) Received: from localhost ([122.180.214.164]) by smtp.gmail.com with ESMTPSA id h6sm5390610pac.46.2016.07.04.06.00.23 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Mon, 04 Jul 2016 06:00:25 -0700 (PDT) Date: Mon, 4 Jul 2016 18:30:21 +0530 From: Amitoj Kaur Chawla To: herbert@gondor.apana.org.au, davem@davemloft.net, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Cc: julia.lawall@lip6.fr Subject: [PATCH] crypto: bfin_crc: Simplify use of devm_ioremap_resource Message-ID: <20160704130021.GA16839@amitoj-Inspiron-3542> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Remove unneeded error handling on the result of a call to platform_get_resource when the value is passed to devm_ioremap_resource. The Coccinelle semantic patch that makes this change is as follows: // @@ expression pdev,res,n,e,e1; expression ret != 0; identifier l; @@ - res = platform_get_resource(pdev, IORESOURCE_MEM, n); ... when != res - if (res == NULL) { ... \(goto l;\|return ret;\) } ... when != res + res = platform_get_resource(pdev, IORESOURCE_MEM, n); e = devm_ioremap_resource(e1, res); // Signed-off-by: Amitoj Kaur Chawla --- drivers/crypto/bfin_crc.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/crypto/bfin_crc.c b/drivers/crypto/bfin_crc.c index 95b7396..10db7df 100644 --- a/drivers/crypto/bfin_crc.c +++ b/drivers/crypto/bfin_crc.c @@ -588,11 +588,6 @@ static int bfin_crypto_crc_probe(struct platform_device *pdev) crypto_init_queue(&crc->queue, CRC_CCRYPTO_QUEUE_LENGTH); res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (res == NULL) { - dev_err(&pdev->dev, "Cannot get IORESOURCE_MEM\n"); - return -ENOENT; - } - crc->regs = devm_ioremap_resource(dev, res); if (IS_ERR((void *)crc->regs)) { dev_err(&pdev->dev, "Cannot map CRC IO\n");