From patchwork Mon Nov 23 09:56:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: saurabh X-Patchwork-Id: 7679361 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Original-To: patchwork-linux-crypto@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 167CE9F750 for ; Mon, 23 Nov 2015 09:57:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 45B1320453 for ; Mon, 23 Nov 2015 09:57:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 74C0C2043C for ; Mon, 23 Nov 2015 09:57:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754171AbbKWJ5K (ORCPT ); Mon, 23 Nov 2015 04:57:10 -0500 Received: from mail-pa0-f51.google.com ([209.85.220.51]:34529 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753580AbbKWJ5K (ORCPT ); Mon, 23 Nov 2015 04:57:10 -0500 Received: by padhx2 with SMTP id hx2so186595637pad.1; Mon, 23 Nov 2015 01:57:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=5qjy7bzDTi7Ewt5VNhb15mfhmmOb6wmyRb/nfAfEr30=; b=eC2+OGv1s+U5rwdLxr2UDXydfOIiYncuejd8TGvi9eODWInHAns2BsusX9024SGhkt sq1ytMZcfI9Ihvw+dYcftW1lad4qAO0SDXHMusmIuwzQbTxnR7NTolcrxX6SYlY3IKUR uEgsSsfyCDL1MlBeEIlkn1b2cJAjWku5eq/8Mkcp5N0b3xmAORNwibXnkha2boImRKdV ouvWt1Aef2GWA7/j6jPkNvVQZz8rkmFx9IInbQBP6A/TJDPGMuti2DfK1SqcpXrsP1b/ ArfBzekt5cuc9SKkHm162uWHGTRQmBWNflTAq2s/qqesGGF/WJ7hiCg37CG71I9G2N7k SWvg== X-Received: by 10.66.148.67 with SMTP id tq3mr35128924pab.124.1448272629616; Mon, 23 Nov 2015 01:57:09 -0800 (PST) Received: from saurabh-desktop.asia.polycom.com ([122.183.18.146]) by smtp.gmail.com with ESMTPSA id qg1sm5454548pbc.90.2015.11.23.01.57.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 23 Nov 2015 01:57:09 -0800 (PST) From: Saurabh Sengar To: ddstreet@ieee.org, herbert@gondor.apana.org.au, davem@davemloft.net, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Saurabh Sengar Subject: [PATCH] crypto: nx: use of_property_read_u32() Date: Mon, 23 Nov 2015 15:26:54 +0530 Message-Id: <1448272614-24337-1-git-send-email-saurabh.truth@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP use of_propert_read_u32() for reading int value, it can help reducing number of variables used Signed-off-by: Saurabh Sengar Acked-by: Dan Streetman --- drivers/crypto/nx/nx-842-powernv.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/crypto/nx/nx-842-powernv.c b/drivers/crypto/nx/nx-842-powernv.c index 9ef51fa..87f7a0f 100644 --- a/drivers/crypto/nx/nx-842-powernv.c +++ b/drivers/crypto/nx/nx-842-powernv.c @@ -525,7 +525,6 @@ static int nx842_powernv_decompress(const unsigned char *in, unsigned int inlen, static int __init nx842_powernv_probe(struct device_node *dn) { struct nx842_coproc *coproc; - struct property *ct_prop, *ci_prop; unsigned int ct, ci; int chip_id; @@ -534,18 +533,16 @@ static int __init nx842_powernv_probe(struct device_node *dn) pr_err("ibm,chip-id missing\n"); return -EINVAL; } - ct_prop = of_find_property(dn, "ibm,842-coprocessor-type", NULL); - if (!ct_prop) { + + if (of_property_read_u32(dn, "ibm,842-coprocessor-type", &ct)) { pr_err("ibm,842-coprocessor-type missing\n"); return -EINVAL; } - ct = be32_to_cpu(*(unsigned int *)ct_prop->value); - ci_prop = of_find_property(dn, "ibm,842-coprocessor-instance", NULL); - if (!ci_prop) { + + if (of_property_read_u32(dn, "ibm,842-coprocessor-instance", &ci)) { pr_err("ibm,842-coprocessor-instance missing\n"); return -EINVAL; } - ci = be32_to_cpu(*(unsigned int *)ci_prop->value); coproc = kmalloc(sizeof(*coproc), GFP_KERNEL); if (!coproc)