From patchwork Wed Apr 12 08:40:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jason A. Donenfeld" X-Patchwork-Id: 9676811 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 BA4B160381 for ; Wed, 12 Apr 2017 08:40:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AE7FE2811C for ; Wed, 12 Apr 2017 08:40:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A27E12858A; Wed, 12 Apr 2017 08:40:38 +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.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, 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 E62972811C for ; Wed, 12 Apr 2017 08:40:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753446AbdDLIkg (ORCPT ); Wed, 12 Apr 2017 04:40:36 -0400 Received: from frisell.zx2c4.com ([192.95.5.64]:42779 "EHLO frisell.zx2c4.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753394AbdDLIke (ORCPT ); Wed, 12 Apr 2017 04:40:34 -0400 Received: by frisell.zx2c4.com (ZX2C4 Mail Server) with ESMTP id c2f880e2; Wed, 12 Apr 2017 08:33:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=zx2c4.com; h=from:to:cc :subject:date:message-id:in-reply-to:references; s=mail; bh=x7xc vCanWlc4uouxkWpC1Pce9A0=; b=GPyPUamfsXJ9FEcqiJ/vqVXtI15ge8ZVQfZS 0baDIR/Npx/INytRwINTUNvckQ7pOZ+qhNmzh/MpoHcgGFCIZ/8LvTAvlvLYpKWD 7GKIlDLUYszCle54+Liw3W+ZmLV+JJjAU71x9egDYlXSaYVu+EDQtBQCzVG9tDwd 58J1xey8ir7Kx6wibeScQLZxz6oa89sknNN/xnp6Z/8jm+gXq6rIJr3WCO5VVpid 0oAGifx2pPnnQ4WcKFcKqEQc3oh0OgMd6C1pjVpVrShHoMtza8Zw///tGUKkfuz5 0dgpRD4NkRIpEpppm+x07M9oVd9V1/WTtujDz5UmqaHnFi71cw== Received: by frisell.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id f8b0c5fb (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Wed, 12 Apr 2017 08:33:31 +0000 (UTC) From: "Jason A. Donenfeld" To: steffen.klassert@secunet.com, linux-crypto@vger.kernel.org, dan.carpenter@oracle.com, linux-kernel@vger.kernel.org Cc: "Jason A. Donenfeld" Subject: [PATCH] padata: get_next is never NULL Date: Wed, 12 Apr 2017 10:40:19 +0200 Message-Id: <20170412084019.16190-1-Jason@zx2c4.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170411091601.GA24844@mwanda> References: <20170411091601.GA24844@mwanda> 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 Per Dan's static checker warning, the code that returns NULL was removed in 2010, so this patch updates the comments and fixes the code assumptions. Signed-off-by: Jason A. Donenfeld Reported-by: Dan Carpenter Acked-by: Steffen Klassert --- kernel/padata.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/kernel/padata.c b/kernel/padata.c index f1aef1639204..ac8f1e524836 100644 --- a/kernel/padata.c +++ b/kernel/padata.c @@ -154,8 +154,6 @@ EXPORT_SYMBOL(padata_do_parallel); * A pointer to the control struct of the next object that needs * serialization, if present in one of the percpu reorder queues. * - * NULL, if all percpu reorder queues are empty. - * * -EINPROGRESS, if the next object that needs serialization will * be parallel processed by another cpu and is not yet present in * the cpu's reorder queue. @@ -182,8 +180,6 @@ static struct padata_priv *padata_get_next(struct parallel_data *pd) cpu = padata_index_to_cpu(pd, next_index); next_queue = per_cpu_ptr(pd->pqueue, cpu); - padata = NULL; - reorder = &next_queue->reorder; spin_lock(&reorder->lock); @@ -235,12 +231,11 @@ static void padata_reorder(struct parallel_data *pd) padata = padata_get_next(pd); /* - * All reorder queues are empty, or the next object that needs - * serialization is parallel processed by another cpu and is - * still on it's way to the cpu's reorder queue, nothing to - * do for now. + * If the next object that needs serialization is parallel + * processed by another cpu and is still on it's way to the + * cpu's reorder queue, nothing to do for now. */ - if (!padata || PTR_ERR(padata) == -EINPROGRESS) + if (PTR_ERR(padata) == -EINPROGRESS) break; /*