From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF5D2CA9EAF for ; Mon, 21 Oct 2019 14:52:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BC97A2053B for ; Mon, 21 Oct 2019 14:52:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728289AbfJUOwt (ORCPT ); Mon, 21 Oct 2019 10:52:49 -0400 Received: from xavier.telenet-ops.be ([195.130.132.52]:35706 "EHLO xavier.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726847AbfJUOwK (ORCPT ); Mon, 21 Oct 2019 10:52:10 -0400 Received: from ramsan ([84.194.98.4]) by xavier.telenet-ops.be with bizsmtp id GErr2100B05gfCL01ErrRZ; Mon, 21 Oct 2019 16:52:08 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan with esmtp (Exim 4.90_1) (envelope-from ) id 1iMZ2E-00075h-Vs; Mon, 21 Oct 2019 16:51:50 +0200 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1iMZ2E-0008FR-UG; Mon, 21 Oct 2019 16:51:50 +0200 From: Geert Uytterhoeven To: =?UTF-8?q?Breno=20Leit=C3=A3o?= , Nayna Jain , Paulo Flabiano Smorigo , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Herbert Xu , "David S . Miller" , Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , David@rox.of.borg, David Airlie , Daniel Vetter , Casey Leedom , Shannon Nelson , Pensando Drivers , Kevin Hilman , Nishanth Menon Cc: Greg Kroah-Hartman , linux-crypto@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, netdev@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 1/5] crypto: nx - Improve debugfs_create_u{32,64}() handling for atomics Date: Mon, 21 Oct 2019 16:51:45 +0200 Message-Id: <20191021145149.31657-2-geert+renesas@glider.be> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191021145149.31657-1-geert+renesas@glider.be> References: <20191021145149.31657-1-geert+renesas@glider.be> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Variables of type atomic{,64}_t can be used fine with debugfs_create_u{32,64}, when passing a pointer to the embedded counter. This allows to get rid of the casts, which prevented compiler checks. Signed-off-by: Geert Uytterhoeven --- drivers/crypto/nx/nx_debugfs.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/crypto/nx/nx_debugfs.c b/drivers/crypto/nx/nx_debugfs.c index e0d44a5512ab455b..1975bcbee997481e 100644 --- a/drivers/crypto/nx/nx_debugfs.c +++ b/drivers/crypto/nx/nx_debugfs.c @@ -38,23 +38,23 @@ void nx_debugfs_init(struct nx_crypto_driver *drv) drv->dfs_root = root; debugfs_create_u32("aes_ops", S_IRUSR | S_IRGRP | S_IROTH, - root, (u32 *)&drv->stats.aes_ops); + root, &drv->stats.aes_ops.counter); debugfs_create_u32("sha256_ops", S_IRUSR | S_IRGRP | S_IROTH, - root, (u32 *)&drv->stats.sha256_ops); + root, &drv->stats.sha256_ops.counter); debugfs_create_u32("sha512_ops", S_IRUSR | S_IRGRP | S_IROTH, - root, (u32 *)&drv->stats.sha512_ops); + root, &drv->stats.sha512_ops.counter); debugfs_create_u64("aes_bytes", S_IRUSR | S_IRGRP | S_IROTH, - root, (u64 *)&drv->stats.aes_bytes); + root, &drv->stats.aes_bytes.counter); debugfs_create_u64("sha256_bytes", S_IRUSR | S_IRGRP | S_IROTH, - root, (u64 *)&drv->stats.sha256_bytes); + root, &drv->stats.sha256_bytes.counter); debugfs_create_u64("sha512_bytes", S_IRUSR | S_IRGRP | S_IROTH, - root, (u64 *)&drv->stats.sha512_bytes); + root, &drv->stats.sha512_bytes.counter); debugfs_create_u32("errors", S_IRUSR | S_IRGRP | S_IROTH, - root, (u32 *)&drv->stats.errors); + root, &drv->stats.errors.counter); debugfs_create_u32("last_error", S_IRUSR | S_IRGRP | S_IROTH, - root, (u32 *)&drv->stats.last_error); + root, &drv->stats.last_error.counter); debugfs_create_u32("last_error_pid", S_IRUSR | S_IRGRP | S_IROTH, - root, (u32 *)&drv->stats.last_error_pid); + root, &drv->stats.last_error_pid.counter); } void -- 2.17.1