All of lore.kernel.org
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert+renesas@glider.be>
To: "Breno Leitão" <leitao@debian.org>,
	"Nayna Jain" <nayna@linux.ibm.com>,
	"Paulo Flabiano Smorigo" <pfsmorigo@gmail.com>,
	"Benjamin Herrenschmidt" <benh@kernel.crashing.org>,
	"Paul Mackerras" <paulus@samba.org>,
	"Michael Ellerman" <mpe@ellerman.id.au>,
	"Herbert Xu" <herbert@gondor.apana.org.au>,
	"David S . Miller" <davem@davemloft.net>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	David@rox.of.borg, "David Airlie" <airlied@linux.ie>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Casey Leedom" <leedom@chelsio.com>,
	"Shannon Nelson" <snelson@pensando.io>,
	"Pensando Drivers" <drivers@pensando.io>,
	"Kevin Hilman" <khilman@kernel.org>, "Nishanth Menon" <nm@ti.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	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 <geert+renesas@glider.be>
Subject: [PATCH 1/5] crypto: nx - Improve debugfs_create_u{32,64}() handling for atomics
Date: Mon, 21 Oct 2019 16:51:45 +0200	[thread overview]
Message-ID: <20191021145149.31657-2-geert+renesas@glider.be> (raw)
In-Reply-To: <20191021145149.31657-1-geert+renesas@glider.be>

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 <geert+renesas@glider.be>
---
 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


WARNING: multiple messages have this Message-ID (diff)
From: Geert Uytterhoeven <geert+renesas@glider.be>
To: "Breno Leitão" <leitao@debian.org>,
	"Nayna Jain" <nayna@linux.ibm.com>,
	"Paulo Flabiano Smorigo" <pfsmorigo@gmail.com>,
	"Benjamin Herrenschmidt" <benh@kernel.crashing.org>,
	"Paul Mackerras" <paulus@samba.org>,
	"Michael Ellerman" <mpe@ellerman.id.au>,
	"Herbert Xu" <herbert@gondor.apana.org.au>,
	"David S . Miller" <davem@davemloft.net>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	David@rox.of.borg, "David Airlie" <airlied@linux.ie>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Casey Leedom" <leedom@chelsio.com>,
	"Shannon Nelson" <snelson@pensando.io>,
	"Pensando Drivers" <drivers@pensando.io>,
	"Kevin Hilman" <khilman@kernel.org>, "Nishanth Menon" <nm@ti.com>
Cc: amd-gfx@lists.freedesktop.org,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	linux-pm@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-crypto@vger.kernel.org, netdev@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org
Subject: [PATCH 1/5] crypto: nx - Improve debugfs_create_u{32, 64}() handling for atomics
Date: Mon, 21 Oct 2019 16:51:45 +0200	[thread overview]
Message-ID: <20191021145149.31657-2-geert+renesas@glider.be> (raw)
In-Reply-To: <20191021145149.31657-1-geert+renesas@glider.be>

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 <geert+renesas@glider.be>
---
 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


  reply	other threads:[~2019-10-21 14:52 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-21 14:51 [PATCH 0/5] debugfs: Remove casts in debugfs_create_*() callers Geert Uytterhoeven
2019-10-21 14:51 ` Geert Uytterhoeven
2019-10-21 14:51 ` Geert Uytterhoeven [this message]
2019-10-21 14:51   ` [PATCH 1/5] crypto: nx - Improve debugfs_create_u{32, 64}() handling for atomics Geert Uytterhoeven
2019-10-25 15:27   ` [PATCH 1/5] crypto: nx - Improve debugfs_create_u{32,64}() " Herbert Xu
2019-10-25 15:27     ` Herbert Xu
2019-10-25 15:27     ` Herbert Xu
2019-10-25 15:27     ` Herbert Xu
2019-10-25 15:27     ` Herbert Xu
2019-10-21 14:51 ` [PATCH 2/5] cxgb4/cxgb4vf: Remove superfluous void * cast in debugfs_create_file() call Geert Uytterhoeven
2019-10-21 14:51   ` Geert Uytterhoeven
2019-10-21 14:51 ` [PATCH 3/5] drm/amdgpu: " Geert Uytterhoeven
2019-10-21 14:51   ` Geert Uytterhoeven
2019-10-28 17:56   ` Alex Deucher
2019-10-28 17:56     ` Alex Deucher
2019-10-28 17:56     ` Alex Deucher
2019-10-28 17:56     ` Alex Deucher
2019-10-28 17:56     ` Alex Deucher
2019-10-21 14:51 ` [PATCH 4/5] power: avs: smartreflex: Remove superfluous " Geert Uytterhoeven
2019-10-21 14:51   ` Geert Uytterhoeven
2019-11-08 11:24   ` Rafael J. Wysocki
2019-11-08 11:24     ` Rafael J. Wysocki
2019-11-08 11:24     ` Rafael J. Wysocki
2019-11-08 11:24     ` Rafael J. Wysocki
2019-11-08 11:24     ` Rafael J. Wysocki
2019-11-08 11:37     ` Greg Kroah-Hartman
2019-11-08 11:37       ` Greg Kroah-Hartman
2019-11-08 11:37       ` Greg Kroah-Hartman
2019-11-08 11:37       ` Greg Kroah-Hartman
2019-11-08 11:37       ` Greg Kroah-Hartman
2019-11-13 11:02   ` Rafael J. Wysocki
2019-11-13 11:02     ` Rafael J. Wysocki
2019-11-13 11:02     ` Rafael J. Wysocki
2019-11-13 11:02     ` Rafael J. Wysocki
2019-11-13 11:02     ` Rafael J. Wysocki
2019-10-21 14:51 ` [PATCH 5/5] ionic: Use debugfs_create_bool() to export bool Geert Uytterhoeven
2019-10-21 14:51   ` Geert Uytterhoeven
2019-10-21 16:35   ` Shannon Nelson
2019-10-21 16:35     ` Shannon Nelson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191021145149.31657-2-geert+renesas@glider.be \
    --to=geert+renesas@glider.be \
    --cc=David@rox.of.borg \
    --cc=airlied@linux.ie \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=benh@kernel.crashing.org \
    --cc=christian.koenig@amd.com \
    --cc=daniel@ffwll.ch \
    --cc=davem@davemloft.net \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=drivers@pensando.io \
    --cc=gregkh@linuxfoundation.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=khilman@kernel.org \
    --cc=leedom@chelsio.com \
    --cc=leitao@debian.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=nayna@linux.ibm.com \
    --cc=netdev@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=paulus@samba.org \
    --cc=pfsmorigo@gmail.com \
    --cc=snelson@pensando.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.