From patchwork Mon Oct 21 14:37:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 11202421 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BCD7C913 for ; Mon, 21 Oct 2019 14:38:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9AA4B20640 for ; Mon, 21 Oct 2019 14:38:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729423AbfJUOh4 (ORCPT ); Mon, 21 Oct 2019 10:37:56 -0400 Received: from xavier.telenet-ops.be ([195.130.132.52]:54264 "EHLO xavier.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727211AbfJUOhz (ORCPT ); Mon, 21 Oct 2019 10:37:55 -0400 Received: from ramsan ([84.194.98.4]) by xavier.telenet-ops.be with bizsmtp id GEdo2100C05gfCL01Edox6; Mon, 21 Oct 2019 16:37:54 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan with esmtp (Exim 4.90_1) (envelope-from ) id 1iMYoe-0007cx-CY; Mon, 21 Oct 2019 16:37:48 +0200 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1iMYoe-0003ma-AN; Mon, 21 Oct 2019 16:37:48 +0200 From: Geert Uytterhoeven To: Greg Kroah-Hartman , Ludovic Desroches , Ulf Hansson , Nicolas Ferre , Alexandre Belloni , Jaehoon Chung , "David S . Miller" , "Rafael J . Wysocki" , Johannes Berg Cc: linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 1/7] debugfs: Add debugfs_create_xul() for hexadecimal unsigned long Date: Mon, 21 Oct 2019 16:37:36 +0200 Message-Id: <20191021143742.14487-2-geert+renesas@glider.be> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191021143742.14487-1-geert+renesas@glider.be> References: <20191021143742.14487-1-geert+renesas@glider.be> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org The existing debugfs_create_ulong() function supports objects of type "unsigned long", which are 32-bit or 64-bit depending on the platform, in decimal form. To format objects in hexadecimal, various debugfs_create_x*() functions exist, but all of them take fixed-size types. Add a debugfs helper for "unsigned long" objects in hexadecimal format. This avoids the need for users to open-code the same, or introduce bugs when casting the value pointer to "u32 *" or "u64 *" to call debugfs_create_x{32,64}(). Signed-off-by: Geert Uytterhoeven --- include/linux/debugfs.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h index 33690949b45d6904..d7b2aebcc277d65e 100644 --- a/include/linux/debugfs.h +++ b/include/linux/debugfs.h @@ -356,4 +356,14 @@ static inline ssize_t debugfs_write_file_bool(struct file *file, #endif +static inline void debugfs_create_xul(const char *name, umode_t mode, + struct dentry *parent, + unsigned long *value) +{ + if (sizeof(*value) == sizeof(u32)) + debugfs_create_x32(name, mode, parent, (u32 *)value); + else + debugfs_create_x64(name, mode, parent, (u64 *)value); +} + #endif From patchwork Mon Oct 21 14:37:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 11202395 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 38419112B for ; Mon, 21 Oct 2019 14:38:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 16EE520659 for ; Mon, 21 Oct 2019 14:38:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729415AbfJUOiP (ORCPT ); Mon, 21 Oct 2019 10:38:15 -0400 Received: from michel.telenet-ops.be ([195.130.137.88]:57614 "EHLO michel.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729416AbfJUOh4 (ORCPT ); Mon, 21 Oct 2019 10:37:56 -0400 Received: from ramsan ([84.194.98.4]) by michel.telenet-ops.be with bizsmtp id GEdo2100S05gfCL06Edorm; Mon, 21 Oct 2019 16:37:54 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan with esmtp (Exim 4.90_1) (envelope-from ) id 1iMYoe-0007cz-DO; Mon, 21 Oct 2019 16:37:48 +0200 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1iMYoe-0003mc-C6; Mon, 21 Oct 2019 16:37:48 +0200 From: Geert Uytterhoeven To: Greg Kroah-Hartman , Ludovic Desroches , Ulf Hansson , Nicolas Ferre , Alexandre Belloni , Jaehoon Chung , "David S . Miller" , "Rafael J . Wysocki" , Johannes Berg Cc: linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 2/7] mac80211: Use debugfs_create_xul() helper Date: Mon, 21 Oct 2019 16:37:37 +0200 Message-Id: <20191021143742.14487-3-geert+renesas@glider.be> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191021143742.14487-1-geert+renesas@glider.be> References: <20191021143742.14487-1-geert+renesas@glider.be> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org Use the new debugfs_create_xul() helper instead of open-coding the same operation. Signed-off-by: Geert Uytterhoeven --- net/mac80211/debugfs_sta.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/net/mac80211/debugfs_sta.c b/net/mac80211/debugfs_sta.c index c8ad20c28c438dab..ca34dcdac8c0bd4d 100644 --- a/net/mac80211/debugfs_sta.c +++ b/net/mac80211/debugfs_sta.c @@ -928,12 +928,7 @@ STA_OPS(he_capa); sta->debugfs_dir, sta, &sta_ ##name## _ops); #define DEBUGFS_ADD_COUNTER(name, field) \ - if (sizeof(sta->field) == sizeof(u32)) \ - debugfs_create_u32(#name, 0400, sta->debugfs_dir, \ - (u32 *) &sta->field); \ - else \ - debugfs_create_u64(#name, 0400, sta->debugfs_dir, \ - (u64 *) &sta->field); + debugfs_create_ulong(#name, 0400, sta->debugfs_dir, &sta->field); void ieee80211_sta_debugfs_add(struct sta_info *sta) { @@ -978,14 +973,8 @@ void ieee80211_sta_debugfs_add(struct sta_info *sta) NL80211_EXT_FEATURE_AIRTIME_FAIRNESS)) DEBUGFS_ADD(airtime); - if (sizeof(sta->driver_buffered_tids) == sizeof(u32)) - debugfs_create_x32("driver_buffered_tids", 0400, - sta->debugfs_dir, - (u32 *)&sta->driver_buffered_tids); - else - debugfs_create_x64("driver_buffered_tids", 0400, - sta->debugfs_dir, - (u64 *)&sta->driver_buffered_tids); + debugfs_create_xul("driver_buffered_tids", 0400, sta->debugfs_dir, + &sta->driver_buffered_tids); drv_sta_add_debugfs(local, sdata, &sta->sta, sta->debugfs_dir); } From patchwork Mon Oct 21 14:37:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 11202403 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D0EE1112B for ; Mon, 21 Oct 2019 14:38:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B99562084C for ; Mon, 21 Oct 2019 14:38:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728033AbfJUOi0 (ORCPT ); Mon, 21 Oct 2019 10:38:26 -0400 Received: from albert.telenet-ops.be ([195.130.137.90]:49116 "EHLO albert.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728003AbfJUOh4 (ORCPT ); Mon, 21 Oct 2019 10:37:56 -0400 Received: from ramsan ([84.194.98.4]) by albert.telenet-ops.be with bizsmtp id GEdo2100C05gfCL06EdoBi; Mon, 21 Oct 2019 16:37:54 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan with esmtp (Exim 4.90_1) (envelope-from ) id 1iMYoe-0007d1-Dw; Mon, 21 Oct 2019 16:37:48 +0200 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1iMYoe-0003mg-Ct; Mon, 21 Oct 2019 16:37:48 +0200 From: Geert Uytterhoeven To: Greg Kroah-Hartman , Ludovic Desroches , Ulf Hansson , Nicolas Ferre , Alexandre Belloni , Jaehoon Chung , "David S . Miller" , "Rafael J . Wysocki" , Johannes Berg Cc: linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 3/7] net: caif: Fix debugfs on 64-bit platforms Date: Mon, 21 Oct 2019 16:37:38 +0200 Message-Id: <20191021143742.14487-4-geert+renesas@glider.be> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191021143742.14487-1-geert+renesas@glider.be> References: <20191021143742.14487-1-geert+renesas@glider.be> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org "ser_device.state" is "unsigned long", i.e. 32-bit or 64-bit, depending on the platform. Hence casting its address to "u32 *", and calling debugfs_create_x32() breaks operation on 64-bit platforms. Fix this by using the new debugfs_create_xul() helper instead. Fixes: 9b27105b4a44c54b ("net-caif-driver: add CAIF serial driver (ldisc)") Signed-off-by: Geert Uytterhoeven --- drivers/net/caif/caif_serial.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/caif/caif_serial.c b/drivers/net/caif/caif_serial.c index 40b079162804fb0c..bd40b114d6cd7214 100644 --- a/drivers/net/caif/caif_serial.c +++ b/drivers/net/caif/caif_serial.c @@ -102,8 +102,8 @@ static inline void debugfs_init(struct ser_device *ser, struct tty_struct *tty) debugfs_create_blob("last_rx_msg", 0400, ser->debugfs_tty_dir, &ser->rx_blob); - debugfs_create_x32("ser_state", 0400, ser->debugfs_tty_dir, - (u32 *)&ser->state); + debugfs_create_xul("ser_state", 0400, ser->debugfs_tty_dir, + &ser->state); debugfs_create_x8("tty_status", 0400, ser->debugfs_tty_dir, &ser->tty_status); From patchwork Mon Oct 21 14:37:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 11202387 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C4F19112B for ; Mon, 21 Oct 2019 14:38:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ADC9C2084B for ; Mon, 21 Oct 2019 14:38:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729481AbfJUOiA (ORCPT ); Mon, 21 Oct 2019 10:38:00 -0400 Received: from andre.telenet-ops.be ([195.130.132.53]:34766 "EHLO andre.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729457AbfJUOh7 (ORCPT ); Mon, 21 Oct 2019 10:37:59 -0400 Received: from ramsan ([84.194.98.4]) by andre.telenet-ops.be with bizsmtp id GEdo2100G05gfCL01EdoDj; Mon, 21 Oct 2019 16:37:56 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan with esmtp (Exim 4.90_1) (envelope-from ) id 1iMYoe-0007d7-Ef; Mon, 21 Oct 2019 16:37:48 +0200 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1iMYoe-0003mj-DW; Mon, 21 Oct 2019 16:37:48 +0200 From: Geert Uytterhoeven To: Greg Kroah-Hartman , Ludovic Desroches , Ulf Hansson , Nicolas Ferre , Alexandre Belloni , Jaehoon Chung , "David S . Miller" , "Rafael J . Wysocki" , Johannes Berg Cc: linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 4/7] mmc: atmel-mci: Fix debugfs on 64-bit platforms Date: Mon, 21 Oct 2019 16:37:39 +0200 Message-Id: <20191021143742.14487-5-geert+renesas@glider.be> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191021143742.14487-1-geert+renesas@glider.be> References: <20191021143742.14487-1-geert+renesas@glider.be> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org "atmel_mci.pending_events" and "atmel_mci.completed_events" are "unsigned long", i.e. 32-bit or 64-bit, depending on the platform. Hence casting their addresses to "u32 *", and calling debugfs_create_x32() breaks operation on 64-bit platforms. Fix this by using the new debugfs_create_xul() helper instead. Fixes: deec9ae31e607955 ("atmel-mci: debugfs support") Signed-off-by: Geert Uytterhoeven --- drivers/mmc/host/atmel-mci.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c index c26fbe5f22221d95..ef2eb9e7c75a32a1 100644 --- a/drivers/mmc/host/atmel-mci.c +++ b/drivers/mmc/host/atmel-mci.c @@ -584,10 +584,10 @@ static void atmci_init_debugfs(struct atmel_mci_slot *slot) debugfs_create_file("regs", S_IRUSR, root, host, &atmci_regs_fops); debugfs_create_file("req", S_IRUSR, root, slot, &atmci_req_fops); debugfs_create_u32("state", S_IRUSR, root, (u32 *)&host->state); - debugfs_create_x32("pending_events", S_IRUSR, root, - (u32 *)&host->pending_events); - debugfs_create_x32("completed_events", S_IRUSR, root, - (u32 *)&host->completed_events); + debugfs_create_xul("pending_events", S_IRUSR, root, + &host->pending_events); + debugfs_create_xul("completed_events", S_IRUSR, root, + &host->completed_events); } #if defined(CONFIG_OF) From patchwork Mon Oct 21 14:37:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 11202417 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 62B2C112B for ; Mon, 21 Oct 2019 14:38:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 419F22053B for ; Mon, 21 Oct 2019 14:38:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729437AbfJUOh4 (ORCPT ); Mon, 21 Oct 2019 10:37:56 -0400 Received: from xavier.telenet-ops.be ([195.130.132.52]:54274 "EHLO xavier.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727555AbfJUOhz (ORCPT ); Mon, 21 Oct 2019 10:37:55 -0400 Received: from ramsan ([84.194.98.4]) by xavier.telenet-ops.be with bizsmtp id GEdo2100E05gfCL01Edox7; Mon, 21 Oct 2019 16:37:54 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan with esmtp (Exim 4.90_1) (envelope-from ) id 1iMYoe-0007d9-GL; Mon, 21 Oct 2019 16:37:48 +0200 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1iMYoe-0003mm-E8; Mon, 21 Oct 2019 16:37:48 +0200 From: Geert Uytterhoeven To: Greg Kroah-Hartman , Ludovic Desroches , Ulf Hansson , Nicolas Ferre , Alexandre Belloni , Jaehoon Chung , "David S . Miller" , "Rafael J . Wysocki" , Johannes Berg Cc: linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 5/7] mmc: atmel-mci: Remove superfluous cast in debugfs_create_u32() call Date: Mon, 21 Oct 2019 16:37:40 +0200 Message-Id: <20191021143742.14487-6-geert+renesas@glider.be> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191021143742.14487-1-geert+renesas@glider.be> References: <20191021143742.14487-1-geert+renesas@glider.be> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org "atmel_mci.state" is an enum, which is compatible with u32, so there is no need to cast its address, preventing further compiler checks. Signed-off-by: Geert Uytterhoeven --- drivers/mmc/host/atmel-mci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c index ef2eb9e7c75a32a1..34c992d875298932 100644 --- a/drivers/mmc/host/atmel-mci.c +++ b/drivers/mmc/host/atmel-mci.c @@ -583,7 +583,7 @@ static void atmci_init_debugfs(struct atmel_mci_slot *slot) debugfs_create_file("regs", S_IRUSR, root, host, &atmci_regs_fops); debugfs_create_file("req", S_IRUSR, root, slot, &atmci_req_fops); - debugfs_create_u32("state", S_IRUSR, root, (u32 *)&host->state); + debugfs_create_u32("state", S_IRUSR, root, &host->state); debugfs_create_xul("pending_events", S_IRUSR, root, &host->pending_events); debugfs_create_xul("completed_events", S_IRUSR, root, From patchwork Mon Oct 21 14:37:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 11202389 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 50ADB112B for ; Mon, 21 Oct 2019 14:38:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2FB2B20656 for ; Mon, 21 Oct 2019 14:38:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728018AbfJUOiE (ORCPT ); Mon, 21 Oct 2019 10:38:04 -0400 Received: from laurent.telenet-ops.be ([195.130.137.89]:52340 "EHLO laurent.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729466AbfJUOh7 (ORCPT ); Mon, 21 Oct 2019 10:37:59 -0400 Received: from ramsan ([84.194.98.4]) by laurent.telenet-ops.be with bizsmtp id GEdo2100H05gfCL01EdoBs; Mon, 21 Oct 2019 16:37:57 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan with esmtp (Exim 4.90_1) (envelope-from ) id 1iMYoe-0007dC-Gu; Mon, 21 Oct 2019 16:37:48 +0200 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1iMYoe-0003mp-Ew; Mon, 21 Oct 2019 16:37:48 +0200 From: Geert Uytterhoeven To: Greg Kroah-Hartman , Ludovic Desroches , Ulf Hansson , Nicolas Ferre , Alexandre Belloni , Jaehoon Chung , "David S . Miller" , "Rafael J . Wysocki" , Johannes Berg Cc: linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 6/7] mmc: dw_mmc: Fix debugfs on 64-bit platforms Date: Mon, 21 Oct 2019 16:37:41 +0200 Message-Id: <20191021143742.14487-7-geert+renesas@glider.be> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191021143742.14487-1-geert+renesas@glider.be> References: <20191021143742.14487-1-geert+renesas@glider.be> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org "dw_mci.pending_events" and "dw_mci.completed_events" are "unsigned long", i.e. 32-bit or 64-bit, depending on the platform. Hence casting their addresses to "u32 *", and calling debugfs_create_x32() breaks operation on 64-bit platforms. Fix this by using the new debugfs_create_xul() helper instead. Fixes: f95f3850f7a9e1d4 ("mmc: dw_mmc: Add Synopsys DesignWare mmc host driver.") Signed-off-by: Geert Uytterhoeven --- drivers/mmc/host/dw_mmc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index bf0048ebbda356a7..b4c4a9cd6365f122 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -177,10 +177,10 @@ static void dw_mci_init_debugfs(struct dw_mci_slot *slot) debugfs_create_file("regs", S_IRUSR, root, host, &dw_mci_regs_fops); debugfs_create_file("req", S_IRUSR, root, slot, &dw_mci_req_fops); debugfs_create_u32("state", S_IRUSR, root, (u32 *)&host->state); - debugfs_create_x32("pending_events", S_IRUSR, root, - (u32 *)&host->pending_events); - debugfs_create_x32("completed_events", S_IRUSR, root, - (u32 *)&host->completed_events); + debugfs_create_xul("pending_events", S_IRUSR, root, + &host->pending_events); + debugfs_create_xul("completed_events", S_IRUSR, root, + &host->completed_events); } #endif /* defined(CONFIG_DEBUG_FS) */ From patchwork Mon Oct 21 14:37:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 11202411 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AAC3F913 for ; Mon, 21 Oct 2019 14:38:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8897420640 for ; Mon, 21 Oct 2019 14:38:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729601AbfJUOis (ORCPT ); Mon, 21 Oct 2019 10:38:48 -0400 Received: from albert.telenet-ops.be ([195.130.137.90]:49124 "EHLO albert.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727822AbfJUOh4 (ORCPT ); Mon, 21 Oct 2019 10:37:56 -0400 Received: from ramsan ([84.194.98.4]) by albert.telenet-ops.be with bizsmtp id GEdo2100D05gfCL06EdoBj; Mon, 21 Oct 2019 16:37:54 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan with esmtp (Exim 4.90_1) (envelope-from ) id 1iMYoe-0007dG-HN; Mon, 21 Oct 2019 16:37:48 +0200 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1iMYoe-0003mr-Fi; Mon, 21 Oct 2019 16:37:48 +0200 From: Geert Uytterhoeven To: Greg Kroah-Hartman , Ludovic Desroches , Ulf Hansson , Nicolas Ferre , Alexandre Belloni , Jaehoon Chung , "David S . Miller" , "Rafael J . Wysocki" , Johannes Berg Cc: linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 7/7] mmc: dw_mmc: Remove superfluous cast in debugfs_create_u32() call Date: Mon, 21 Oct 2019 16:37:42 +0200 Message-Id: <20191021143742.14487-8-geert+renesas@glider.be> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191021143742.14487-1-geert+renesas@glider.be> References: <20191021143742.14487-1-geert+renesas@glider.be> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org "dw_mci.state" is an enum, which is compatible with u32, so there is no need to cast its address, preventing further compiler checks. Signed-off-by: Geert Uytterhoeven --- drivers/mmc/host/dw_mmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index b4c4a9cd6365f122..fc9d4d000f97e434 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -176,7 +176,7 @@ static void dw_mci_init_debugfs(struct dw_mci_slot *slot) debugfs_create_file("regs", S_IRUSR, root, host, &dw_mci_regs_fops); debugfs_create_file("req", S_IRUSR, root, slot, &dw_mci_req_fops); - debugfs_create_u32("state", S_IRUSR, root, (u32 *)&host->state); + debugfs_create_u32("state", S_IRUSR, root, &host->state); debugfs_create_xul("pending_events", S_IRUSR, root, &host->pending_events); debugfs_create_xul("completed_events", S_IRUSR, root,