From patchwork Fri Dec 5 05:06:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Joshua I. James" X-Patchwork-Id: 5441801 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Original-To: patchwork-linux-crypto@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B01E8BEEA8 for ; Fri, 5 Dec 2014 05:06:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E0B4D20256 for ; Fri, 5 Dec 2014 05:06:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E0DA62021B for ; Fri, 5 Dec 2014 05:06:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750740AbaLEFGb (ORCPT ); Fri, 5 Dec 2014 00:06:31 -0500 Received: from mail-pa0-f47.google.com ([209.85.220.47]:64704 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750718AbaLEFGa (ORCPT ); Fri, 5 Dec 2014 00:06:30 -0500 Received: by mail-pa0-f47.google.com with SMTP id kq14so19483199pab.20 for ; Thu, 04 Dec 2014 21:06:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=LZzW5dAEXvLSnYcir3j/DA7bKuAfBbVgHH1dpc5whis=; b=kmoUbdmRIE65OHvCo9QKXKgKryQWfvRGZwR+L1L+u3ZeU18Mrq1UiQ1LYDmOlQMpNQ K1PdI1OurFSoF3lU4sQDQvW8lYRvrJqlMqsEKj+hWGX177t4U6exOG0bcjvRU7iuyc5P xNx6pTvM0nGbBt7tOdJLLcIxlbFNSwdMXzurqvL3hPjqLL0qPNFffBadG6ZjPjDP6xfu 5hsmqB31y/V3ijJ1KVaPuBFlodecyCq8VwChbyje8L9R3QBHZlCTFPoItfAjXMdk8DdP lfYy/Z98GAnrD8JvefWP5wWRmFyBYKj0R5kVpZIsj22sDQhwN85mUfVZ/pl3+DQfxwGR J9JQ== X-Gm-Message-State: ALoCoQlbJ3WHzG+If1Ih3TA7P/8dpCRKMRlc7aN65vyzQPwfsUyo3xPaOwfPreWiyHA5RS2SOY98 X-Received: by 10.66.236.36 with SMTP id ur4mr24401047pac.107.1417755989901; Thu, 04 Dec 2014 21:06:29 -0800 (PST) Received: from localhost.localdomain ([121.168.23.141]) by mx.google.com with ESMTPSA id gh6sm6739809pbd.28.2014.12.04.21.06.27 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 04 Dec 2014 21:06:28 -0800 (PST) From: "Joshua I. James" X-Google-Original-From: "Joshua I. James" To: linux-crypto@vger.kernel.org Cc: "Joshua I. James" Subject: [PATCH] staging: crypto: fixed style errors in ablkcipher.c Date: Fri, 5 Dec 2014 14:06:16 +0900 Message-Id: <1417755976-19514-1-git-send-email-Joshua@cybercrimetech.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=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, 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 From: "Joshua I. James" Fixed style errors reported by checkpatch. WARNING: Missing a blank line after declarations + u8 *end_page = (u8 *)(((unsigned long)(start + len - 1)) & PAGE_MASK); + return max(start, end_page); WARNING: line over 80 characters + scatterwalk_start(&walk->out, scatterwalk_sg_next(walk->out.sg)); WARNING: Missing a blank line after declarations + int err = ablkcipher_copy_iv(walk, tfm, alignmask); + if (err) ERROR: do not use assignment in if condition + if ((err = crypto_register_instance(tmpl, inst))) { Signed-off-by: Joshua I. James --- crypto/ablkcipher.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/crypto/ablkcipher.c b/crypto/ablkcipher.c index 40886c4..7bbc8b4 100644 --- a/crypto/ablkcipher.c +++ b/crypto/ablkcipher.c @@ -69,6 +69,7 @@ static inline void ablkcipher_queue_write(struct ablkcipher_walk *walk, static inline u8 *ablkcipher_get_spot(u8 *start, unsigned int len) { u8 *end_page = (u8 *)(((unsigned long)(start + len - 1)) & PAGE_MASK); + return max(start, end_page); } @@ -86,7 +87,8 @@ static inline unsigned int ablkcipher_done_slow(struct ablkcipher_walk *walk, if (n == len_this_page) break; n -= len_this_page; - scatterwalk_start(&walk->out, scatterwalk_sg_next(walk->out.sg)); + scatterwalk_start(&walk->out, scatterwalk_sg_next( + walk->out.sg)); } return bsize; @@ -284,6 +286,7 @@ static int ablkcipher_walk_first(struct ablkcipher_request *req, walk->iv = req->info; if (unlikely(((unsigned long)walk->iv & alignmask))) { int err = ablkcipher_copy_iv(walk, tfm, alignmask); + if (err) return err; } @@ -589,7 +592,8 @@ static int crypto_givcipher_default(struct crypto_alg *alg, u32 type, u32 mask) if (IS_ERR(inst)) goto put_tmpl; - if ((err = crypto_register_instance(tmpl, inst))) { + err = crypto_register_instance(tmpl, inst); + if (err) { tmpl->free(inst); goto put_tmpl; }