Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp184898pxu; Tue, 6 Oct 2020 23:41:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2AfGdxhUr4qbyl01ZPQfRvxF7f2gPHizb10hOCWB4u9vp2umTekCVwvMEbjgNoLeileED X-Received: by 2002:a17:907:2089:: with SMTP id pv9mr1885499ejb.427.1602052867673; Tue, 06 Oct 2020 23:41:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602052867; cv=none; d=google.com; s=arc-20160816; b=PMLzJfiQMaUQyFgFDURd5ZxpOcszIpBnEcV6YjF54zgghP8842QJj3wl2clDyjzzsJ UUseYe+K4875aT5jejL3EBmwwEF+CILMR50Pz1yYZ6+/8KwjZMN7+GHXRzVHzmtSH3+O PI79H3wkgutB0Xdh7jyttphyMnqmuda19f+Ef1+TPRFeXDkvDL5+657fLfWpsQ7YEeoh FuqBiZTIE6+hpEAu5ymOiUL6qemZEbDCLk+HgPblYByLidDKsA6/Qhykaje1wQ6KZoXl 7lXyQqR/VmoVSCo50H5TKnbWHoeP3LNc6MVzUQPhtJwZKBAQkl8/lysPioeDCTqk/k4w H2/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=rKIFm60cWNjrLbsJ3A4ku6q97YOSy0+cnPLjgYCYMAc=; b=CO+rarazpFddRQyU5RmTYTAoFYOEoCH9LtbFLw0waElioc28g2+lWu5Jai+iltUHtR 6FKuVOkmFxjhFwIRZaD4oHr18kbTB5ooa+hVTUqtW1UXmyTLiSDYEezBjPZOAQg6N6i9 kESzhu3MJNT4IOR+sonMJ5+4k1XVg8KEu6K9Uk1oID6z4AOQVdFAAJPRhz0z3b6XH+6Z I6eLOQGzUhTH4MSLw/+Fqbmchv4d6R4+2veT4v6y1MzXMYCFdB26RR2Zds8YqwyIYo14 7X2uf+3HMz4z4kFdPaU7j15Kj2zeMqjKqc99yGmfx0YwWxXEZpvodsuAe++sw2HZGuKj 4nKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=V8Vno4xa; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q22si718119edb.85.2020.10.06.23.40.34; Tue, 06 Oct 2020 23:41:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=V8Vno4xa; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727414AbgJGGeG (ORCPT + 99 others); Wed, 7 Oct 2020 02:34:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:47352 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726564AbgJGGeG (ORCPT ); Wed, 7 Oct 2020 02:34:06 -0400 Received: from mail-ot1-f50.google.com (mail-ot1-f50.google.com [209.85.210.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B5C1C206F0; Wed, 7 Oct 2020 06:34:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602052445; bh=57lD1FaZkxIswf9nw9qmot16OW3C5eH025NjTSR6etw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=V8Vno4xaNfPqcyU1XXvzewSArFHy6HmVCnvCaYY4buEz7MYlWnyeRc48TBMDwnnQO ajf91RIfDI5Y5R1TD4cGWz4riX5hoOM0kQ0E5qSC8d0n91kUcnCxQYrDoAde3frgRb lLRChpih2//N1y01leEgHFeLgJTR96ZFX4KlxtYE= Received: by mail-ot1-f50.google.com with SMTP id f10so1242069otb.6; Tue, 06 Oct 2020 23:34:05 -0700 (PDT) X-Gm-Message-State: AOAM5323sJXLKAnNM4nOGAtneltOciQTlHO8ZrgxYzOCakbs9z1yWUqF 1GQ3tqe6+bCvf+A9ZIiYs9dDxsU9FsBN451pYzQ= X-Received: by 2002:a9d:335:: with SMTP id 50mr921206otv.90.1602052444976; Tue, 06 Oct 2020 23:34:04 -0700 (PDT) MIME-Version: 1.0 References: <20201006195848.707504-1-natechancellor@gmail.com> In-Reply-To: <20201006195848.707504-1-natechancellor@gmail.com> From: Ard Biesheuvel Date: Wed, 7 Oct 2020 08:33:54 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] crypto: xor - Remove unused variable count in do_xor_speed To: Nathan Chancellor Cc: Herbert Xu , "David S. Miller" , Douglas Anderson , Linux Crypto Mailing List , Linux Kernel Mailing List , clang-built-linux Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Tue, 6 Oct 2020 at 21:59, Nathan Chancellor wrote: > > Clang warns: > > crypto/xor.c:101:4: warning: variable 'count' is uninitialized when used > here [-Wuninitialized] > count++; > ^~~~~ > crypto/xor.c:86:17: note: initialize the variable 'count' to silence > this warning > int i, j, count; > ^ > = 0 > 1 warning generated. > > After the refactoring to use ktime that happened in this function, count > is only assigned, never read. Just remove the variable to get rid of the > warning. > > Fixes: c055e3eae0f1 ("crypto: xor - use ktime for template benchmarking") > Link: https://github.com/ClangBuiltLinux/linux/issues/1171 > Signed-off-by: Nathan Chancellor Acked-by: Ard Biesheuvel > --- > crypto/xor.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/crypto/xor.c b/crypto/xor.c > index a0badbc03577..eacbf4f93990 100644 > --- a/crypto/xor.c > +++ b/crypto/xor.c > @@ -83,7 +83,7 @@ static void __init > do_xor_speed(struct xor_block_template *tmpl, void *b1, void *b2) > { > int speed; > - int i, j, count; > + int i, j; > ktime_t min, start, diff; > > tmpl->next = template_list; > @@ -98,8 +98,6 @@ do_xor_speed(struct xor_block_template *tmpl, void *b1, void *b2) > mb(); /* prevent loop optimzation */ > tmpl->do_2(BENCH_SIZE, b1, b2); > mb(); > - count++; > - mb(); > } > diff = ktime_sub(ktime_get(), start); > if (diff < min) > > base-commit: ed4424f2fb02497b0ea92bf58c533c598c0da1d3 > -- > 2.29.0.rc0 >