public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/7] drm/msm/mdp: fix a problematic usage of WARN_ON()
@ 2015-11-25 13:12 Geliang Tang
  2015-11-25 13:12 ` [PATCH 2/7] drm/vmwgfx: " Geliang Tang
  0 siblings, 1 reply; 19+ messages in thread
From: Geliang Tang @ 2015-11-25 13:12 UTC (permalink / raw)
  To: David Airlie, Rob Clark, jilai wang; +Cc: Geliang Tang, dri-devel, linux-kernel

WARN_ON() takes a condition rather than a format string. This patch
converted WARN_ON() to WARN() instead.

Signed-off-by: Geliang Tang <geliangtang@163.com>
---
 drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.h b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.h
index 8a7f6e1..00f7ecc 100644
--- a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.h
+++ b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.h
@@ -157,7 +157,7 @@ static inline uint32_t mixercfg(uint32_t mixer_cfg, int mixer,
 			COND(mixer == 1, MDP4_LAYERMIXER_IN_CFG_PIPE6_MIXER1);
 		break;
 	default:
-		WARN_ON("invalid pipe");
+		WARN(1, "invalid pipe");
 		break;
 	}
 
-- 
2.5.0



^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 2/7] drm/vmwgfx: fix a problematic usage of WARN_ON()
  2015-11-25 13:12 [PATCH 1/7] drm/msm/mdp: fix a problematic usage of WARN_ON() Geliang Tang
@ 2015-11-25 13:12 ` Geliang Tang
  2015-11-25 13:12   ` [PATCH 3/7] iio: " Geliang Tang
                     ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Geliang Tang @ 2015-11-25 13:12 UTC (permalink / raw)
  To: David Airlie, Thomas Hellstrom, Sinclair Yeh, Charmaine Lee
  Cc: Geliang Tang, dri-devel, linux-kernel

WARN_ON() takes a condition rather than a format string. This patch
converted WARN_ON() to WARN() instead.

Signed-off-by: Geliang Tang <geliangtang@163.com>
---
 drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c
index a8baf5f..b6a0806 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c
@@ -390,7 +390,7 @@ void *vmw_fifo_reserve_dx(struct vmw_private *dev_priv, uint32_t bytes,
 	else if (ctx_id == SVGA3D_INVALID_ID)
 		ret = vmw_local_fifo_reserve(dev_priv, bytes);
 	else {
-		WARN_ON("Command buffer has not been allocated.\n");
+		WARN(1, "Command buffer has not been allocated.\n");
 		ret = NULL;
 	}
 	if (IS_ERR_OR_NULL(ret)) {
-- 
2.5.0



^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 3/7] iio: fix a problematic usage of WARN_ON()
  2015-11-25 13:12 ` [PATCH 2/7] drm/vmwgfx: " Geliang Tang
@ 2015-11-25 13:12   ` Geliang Tang
  2015-11-25 13:12     ` [PATCH 4/7] iwlwifi: fix a problematic usage of WARN_ON_ONCE() Geliang Tang
  2015-11-25 13:14     ` [PATCH 3/7] iio: fix a problematic usage of WARN_ON() Lars-Peter Clausen
  2015-11-25 15:50   ` [PATCH 2/7] drm/vmwgfx: " Sinclair Yeh
  2015-11-26 14:51   ` Thomas Hellstrom
  2 siblings, 2 replies; 19+ messages in thread
From: Geliang Tang @ 2015-11-25 13:12 UTC (permalink / raw)
  To: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald
  Cc: Geliang Tang, linux-iio, linux-kernel

WARN_ON() takes a condition rather than a format string. This patch
converted WARN_ON() to WARN() instead.

Signed-off-by: Geliang Tang <geliangtang@163.com>
---
 drivers/iio/industrialio-buffer.c | 2 +-
 drivers/iio/industrialio-core.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c
index d7e908a..0f6f63b 100644
--- a/drivers/iio/industrialio-buffer.c
+++ b/drivers/iio/industrialio-buffer.c
@@ -302,7 +302,7 @@ static int iio_scan_mask_set(struct iio_dev *indio_dev,
 	if (trialmask == NULL)
 		return -ENOMEM;
 	if (!indio_dev->masklength) {
-		WARN_ON("Trying to set scanmask prior to registering buffer\n");
+		WARN(1, "Trying to set scanmask prior to registering buffer\n");
 		goto err_invalid_mask;
 	}
 	bitmap_copy(trialmask, buffer->scan_mask, indio_dev->masklength);
diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
index 37697d5..fe80366 100644
--- a/drivers/iio/industrialio-core.c
+++ b/drivers/iio/industrialio-core.c
@@ -654,7 +654,7 @@ int __iio_device_attr_init(struct device_attribute *dev_attr,
 			break;
 		case IIO_SEPARATE:
 			if (!chan->indexed) {
-				WARN_ON("Differential channels must be indexed\n");
+				WARN(1, "Differential channels must be indexed\n");
 				ret = -EINVAL;
 				goto error_free_full_postfix;
 			}
-- 
2.5.0



^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 4/7] iwlwifi: fix a problematic usage of WARN_ON_ONCE()
  2015-11-25 13:12   ` [PATCH 3/7] iio: " Geliang Tang
@ 2015-11-25 13:12     ` Geliang Tang
  2015-11-25 13:12       ` [PATCH 5/7] vfio: fix a problematic usage of WARN() Geliang Tang
  2015-11-25 13:47       ` [PATCH 4/7] iwlwifi: fix a problematic usage of WARN_ON_ONCE() Grumbach, Emmanuel
  2015-11-25 13:14     ` [PATCH 3/7] iio: fix a problematic usage of WARN_ON() Lars-Peter Clausen
  1 sibling, 2 replies; 19+ messages in thread
From: Geliang Tang @ 2015-11-25 13:12 UTC (permalink / raw)
  To: Johannes Berg, Emmanuel Grumbach, Intel Linux Wireless,
	Kalle Valo
  Cc: Geliang Tang, linux-wireless, netdev, linux-kernel

WARN_ON_ONCE() takes a condition rather than a format string. This
patch converted WARN_ON_ONCE() to WARN_ONCE() instead.

Signed-off-by: Geliang Tang <geliangtang@163.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/rs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rs.c b/drivers/net/wireless/intel/iwlwifi/mvm/rs.c
index d1ad103..58d7bee 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/rs.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/rs.c
@@ -1827,7 +1827,7 @@ static int rs_switch_to_column(struct iwl_mvm *mvm,
 		rate->type = lq_sta->is_vht ? LQ_VHT_MIMO2 : LQ_HT_MIMO2;
 		rate_mask = lq_sta->active_mimo2_rate;
 	} else {
-		WARN_ON_ONCE("Bad column mode");
+		WARN_ONCE(1, "Bad column mode");
 	}
 
 	if (column->mode != RS_LEGACY) {
-- 
2.5.0



^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 5/7] vfio: fix a problematic usage of WARN()
  2015-11-25 13:12     ` [PATCH 4/7] iwlwifi: fix a problematic usage of WARN_ON_ONCE() Geliang Tang
@ 2015-11-25 13:12       ` Geliang Tang
  2015-11-25 13:12         ` [PATCH 6/7] ARM: davinci: " Geliang Tang
  2015-11-25 13:35         ` [PATCH 5/7] vfio: " Alex Williamson
  2015-11-25 13:47       ` [PATCH 4/7] iwlwifi: fix a problematic usage of WARN_ON_ONCE() Grumbach, Emmanuel
  1 sibling, 2 replies; 19+ messages in thread
From: Geliang Tang @ 2015-11-25 13:12 UTC (permalink / raw)
  To: Alex Williamson; +Cc: Geliang Tang, kvm, linux-kernel

WARN() takes a condition and a format string. The condition was
omitted. So I added it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
---
 drivers/vfio/vfio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c
index de632da..9da0703 100644
--- a/drivers/vfio/vfio.c
+++ b/drivers/vfio/vfio.c
@@ -682,7 +682,7 @@ static int vfio_group_nb_add_dev(struct vfio_group *group, struct device *dev)
 		return 0;
 
 	/* TODO Prevent device auto probing */
-	WARN("Device %s added to live group %d!\n", dev_name(dev),
+	WARN(1, "Device %s added to live group %d!\n", dev_name(dev),
 	     iommu_group_id(group->iommu_group));
 
 	return 0;
-- 
2.5.0



^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 6/7] ARM: davinci: fix a problematic usage of WARN()
  2015-11-25 13:12       ` [PATCH 5/7] vfio: fix a problematic usage of WARN() Geliang Tang
@ 2015-11-25 13:12         ` Geliang Tang
  2015-11-25 13:12           ` [PATCH 7/7] powerpc: " Geliang Tang
  2015-11-25 13:39           ` [PATCH 6/7] ARM: davinci: " Arnd Bergmann
  2015-11-25 13:35         ` [PATCH 5/7] vfio: " Alex Williamson
  1 sibling, 2 replies; 19+ messages in thread
From: Geliang Tang @ 2015-11-25 13:12 UTC (permalink / raw)
  To: Sekhar Nori, Kevin Hilman, Russell King
  Cc: Geliang Tang, linux-arm-kernel, linux-kernel

WARN() takes a condition and a format string. The condition was
omitted. So I added it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
---
 arch/arm/mach-davinci/board-dm355-evm.c     | 2 +-
 arch/arm/mach-davinci/board-dm355-leopard.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-davinci/board-dm355-evm.c b/arch/arm/mach-davinci/board-dm355-evm.c
index c71dd99..e47f24c 100644
--- a/arch/arm/mach-davinci/board-dm355-evm.c
+++ b/arch/arm/mach-davinci/board-dm355-evm.c
@@ -385,7 +385,7 @@ static __init void dm355_evm_init(void)
 
 	aemif = clk_get(&dm355evm_dm9000.dev, "aemif");
 	if (IS_ERR(aemif))
-		WARN("%s: unable to get AEMIF clock\n", __func__);
+		WARN(1, "%s: unable to get AEMIF clock\n", __func__);
 	else
 		clk_prepare_enable(aemif);
 
diff --git a/arch/arm/mach-davinci/board-dm355-leopard.c b/arch/arm/mach-davinci/board-dm355-leopard.c
index 680a7a2..83b625c 100644
--- a/arch/arm/mach-davinci/board-dm355-leopard.c
+++ b/arch/arm/mach-davinci/board-dm355-leopard.c
@@ -243,7 +243,7 @@ static __init void dm355_leopard_init(void)
 
 	aemif = clk_get(&dm355leopard_dm9000.dev, "aemif");
 	if (IS_ERR(aemif))
-		WARN("%s: unable to get AEMIF clock\n", __func__);
+		WARN(1, "%s: unable to get AEMIF clock\n", __func__);
 	else
 		clk_prepare_enable(aemif);
 
-- 
2.5.0



^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 7/7] powerpc: fix a problematic usage of WARN()
  2015-11-25 13:12         ` [PATCH 6/7] ARM: davinci: " Geliang Tang
@ 2015-11-25 13:12           ` Geliang Tang
  2015-11-26  5:25             ` Michael Ellerman
  2015-11-25 13:39           ` [PATCH 6/7] ARM: davinci: " Arnd Bergmann
  1 sibling, 1 reply; 19+ messages in thread
From: Geliang Tang @ 2015-11-25 13:12 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
	Scott Wood, David Gibson
  Cc: Geliang Tang, linuxppc-dev, linux-kernel

WARN() takes a condition and a format string. The condition was
omitted. So I added it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
---
 arch/powerpc/kernel/setup_64.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 5c03a6a..726a9fb 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -127,7 +127,7 @@ static void setup_tlb_core_data(void)
 		    !mmu_has_feature(MMU_FTR_USE_TLBRSRV) &&
 		    book3e_htw_mode != PPC_HTW_E6500) {
 			/* Should we panic instead? */
-			WARN_ONCE("%s: unsupported MMU configuration -- expect problems\n",
+			WARN_ONCE(1, "%s: unsupported MMU configuration -- expect problems\n",
 				  __func__);
 		}
 	}
-- 
2.5.0



^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH 3/7] iio: fix a problematic usage of WARN_ON()
  2015-11-25 13:12   ` [PATCH 3/7] iio: " Geliang Tang
  2015-11-25 13:12     ` [PATCH 4/7] iwlwifi: fix a problematic usage of WARN_ON_ONCE() Geliang Tang
@ 2015-11-25 13:14     ` Lars-Peter Clausen
  1 sibling, 0 replies; 19+ messages in thread
From: Lars-Peter Clausen @ 2015-11-25 13:14 UTC (permalink / raw)
  To: Geliang Tang, Jonathan Cameron, Hartmut Knaack, Peter Meerwald
  Cc: linux-iio, linux-kernel

On 11/25/2015 02:12 PM, Geliang Tang wrote:
> WARN_ON() takes a condition rather than a format string. This patch
> converted WARN_ON() to WARN() instead.
> 
> Signed-off-by: Geliang Tang <geliangtang@163.com>

Thanks for the patch, the issue was already fixed a few days ago.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 5/7] vfio: fix a problematic usage of WARN()
  2015-11-25 13:12       ` [PATCH 5/7] vfio: fix a problematic usage of WARN() Geliang Tang
  2015-11-25 13:12         ` [PATCH 6/7] ARM: davinci: " Geliang Tang
@ 2015-11-25 13:35         ` Alex Williamson
  1 sibling, 0 replies; 19+ messages in thread
From: Alex Williamson @ 2015-11-25 13:35 UTC (permalink / raw)
  To: Geliang Tang; +Cc: kvm, linux-kernel

On Wed, 2015-11-25 at 21:12 +0800, Geliang Tang wrote:
> WARN() takes a condition and a format string. The condition was
> omitted. So I added it.
> 
> Signed-off-by: Geliang Tang <geliangtang@163.com>
> ---
>  drivers/vfio/vfio.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c
> index de632da..9da0703 100644
> --- a/drivers/vfio/vfio.c
> +++ b/drivers/vfio/vfio.c
> @@ -682,7 +682,7 @@ static int vfio_group_nb_add_dev(struct vfio_group *group, struct device *dev)
>  		return 0;
>  
>  	/* TODO Prevent device auto probing */
> -	WARN("Device %s added to live group %d!\n", dev_name(dev),
> +	WARN(1, "Device %s added to live group %d!\n", dev_name(dev),
>  	     iommu_group_id(group->iommu_group));
>  
>  	return 0;

This was already reported and I've got a patch queued to resolve it:

https://www.mail-archive.com/kvm@vger.kernel.org/msg123061.html

Thanks,

Alex


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 6/7] ARM: davinci: fix a problematic usage of WARN()
  2015-11-25 13:12         ` [PATCH 6/7] ARM: davinci: " Geliang Tang
  2015-11-25 13:12           ` [PATCH 7/7] powerpc: " Geliang Tang
@ 2015-11-25 13:39           ` Arnd Bergmann
  2015-11-25 14:13             ` [PATCH v2] " Geliang Tang
  1 sibling, 1 reply; 19+ messages in thread
From: Arnd Bergmann @ 2015-11-25 13:39 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Geliang Tang, Sekhar Nori, Kevin Hilman, Russell King,
	linux-kernel

On Wednesday 25 November 2015 21:12:19 Geliang Tang wrote:
> +++ b/arch/arm/mach-davinci/board-dm355-evm.c
> @@ -385,7 +385,7 @@ static __init void dm355_evm_init(void)
>  
>         aemif = clk_get(&dm355evm_dm9000.dev, "aemif");
>         if (IS_ERR(aemif))
> -               WARN("%s: unable to get AEMIF clock\n", __func__);
> +               WARN(1, "%s: unable to get AEMIF clock\n", __func__);
>         else
>                 clk_prepare_enable(aemif);
>  
> 

How about writing this as 

	if (!WARN(IS_ERR(aemif)), "unable to get AEMIF clock\n"))
		clk_prepare_enable(aemif);

Note that WARN() already contains file and line, so you don't really
need the __func__ here either.

	Arnd

^ permalink raw reply	[flat|nested] 19+ messages in thread

* RE: [PATCH 4/7] iwlwifi: fix a problematic usage of WARN_ON_ONCE()
  2015-11-25 13:12     ` [PATCH 4/7] iwlwifi: fix a problematic usage of WARN_ON_ONCE() Geliang Tang
  2015-11-25 13:12       ` [PATCH 5/7] vfio: fix a problematic usage of WARN() Geliang Tang
@ 2015-11-25 13:47       ` Grumbach, Emmanuel
  1 sibling, 0 replies; 19+ messages in thread
From: Grumbach, Emmanuel @ 2015-11-25 13:47 UTC (permalink / raw)
  To: Geliang Tang, Berg, Johannes, linuxwifi, Kalle Valo
  Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org

> 
> WARN_ON_ONCE() takes a condition rather than a format string. This patch
> converted WARN_ON_ONCE() to WARN_ONCE() instead.
> 
> Signed-off-by: Geliang Tang <geliangtang@163.com>
> ---
>  drivers/net/wireless/intel/iwlwifi/mvm/rs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Already fixed. Thanks.

> 
> diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rs.c
> b/drivers/net/wireless/intel/iwlwifi/mvm/rs.c
> index d1ad103..58d7bee 100644
> --- a/drivers/net/wireless/intel/iwlwifi/mvm/rs.c
> +++ b/drivers/net/wireless/intel/iwlwifi/mvm/rs.c
> @@ -1827,7 +1827,7 @@ static int rs_switch_to_column(struct iwl_mvm
> *mvm,
>  		rate->type = lq_sta->is_vht ? LQ_VHT_MIMO2 :
> LQ_HT_MIMO2;
>  		rate_mask = lq_sta->active_mimo2_rate;
>  	} else {
> -		WARN_ON_ONCE("Bad column mode");
> +		WARN_ONCE(1, "Bad column mode");
>  	}
> 
>  	if (column->mode != RS_LEGACY) {
> --
> 2.5.0
> 


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH v2] ARM: davinci: fix a problematic usage of WARN()
  2015-11-25 13:39           ` [PATCH 6/7] ARM: davinci: " Arnd Bergmann
@ 2015-11-25 14:13             ` Geliang Tang
  2015-11-25 20:21               ` kbuild test robot
  0 siblings, 1 reply; 19+ messages in thread
From: Geliang Tang @ 2015-11-25 14:13 UTC (permalink / raw)
  To: Sekhar Nori, Kevin Hilman, Russell King
  Cc: Geliang Tang, linux-arm-kernel, linux-kernel

WARN() takes a condition and a format string. The condition was
omitted. So I added it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
---
Changes in v2:
 - remove __func__ in WARN()
---
 arch/arm/mach-davinci/board-dm355-evm.c     | 4 +---
 arch/arm/mach-davinci/board-dm355-leopard.c | 4 +---
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-davinci/board-dm355-evm.c b/arch/arm/mach-davinci/board-dm355-evm.c
index c71dd99..3c79796 100644
--- a/arch/arm/mach-davinci/board-dm355-evm.c
+++ b/arch/arm/mach-davinci/board-dm355-evm.c
@@ -384,9 +384,7 @@ static __init void dm355_evm_init(void)
 	dm355evm_dm9000_rsrc[2].start = gpio_to_irq(1);
 
 	aemif = clk_get(&dm355evm_dm9000.dev, "aemif");
-	if (IS_ERR(aemif))
-		WARN("%s: unable to get AEMIF clock\n", __func__);
-	else
+	if (!WARN(IS_ERR(aemif)), "unable to get AEMIF clock\n"))
 		clk_prepare_enable(aemif);
 
 	platform_add_devices(davinci_evm_devices,
diff --git a/arch/arm/mach-davinci/board-dm355-leopard.c b/arch/arm/mach-davinci/board-dm355-leopard.c
index 680a7a2..627ba89 100644
--- a/arch/arm/mach-davinci/board-dm355-leopard.c
+++ b/arch/arm/mach-davinci/board-dm355-leopard.c
@@ -242,9 +242,7 @@ static __init void dm355_leopard_init(void)
 	dm355leopard_dm9000_rsrc[2].start = gpio_to_irq(9);
 
 	aemif = clk_get(&dm355leopard_dm9000.dev, "aemif");
-	if (IS_ERR(aemif))
-		WARN("%s: unable to get AEMIF clock\n", __func__);
-	else
+	if (!WARN(IS_ERR(aemif)), "unable to get AEMIF clock\n"))
 		clk_prepare_enable(aemif);
 
 	platform_add_devices(davinci_leopard_devices,
-- 
2.5.0



^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH 2/7] drm/vmwgfx: fix a problematic usage of WARN_ON()
  2015-11-25 13:12 ` [PATCH 2/7] drm/vmwgfx: " Geliang Tang
  2015-11-25 13:12   ` [PATCH 3/7] iio: " Geliang Tang
@ 2015-11-25 15:50   ` Sinclair Yeh
  2015-11-26 14:51   ` Thomas Hellstrom
  2 siblings, 0 replies; 19+ messages in thread
From: Sinclair Yeh @ 2015-11-25 15:50 UTC (permalink / raw)
  To: Geliang Tang
  Cc: David Airlie, Thomas Hellstrom, Charmaine Lee, dri-devel,
	linux-kernel

Reviewed-by: Sinclair Yeh <syeh@vmware.com>

On Wed, Nov 25, 2015 at 09:12:15PM +0800, Geliang Tang wrote:
> WARN_ON() takes a condition rather than a format string. This patch
> converted WARN_ON() to WARN() instead.
> 
> Signed-off-by: Geliang Tang <geliangtang@163.com>
> ---
>  drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c
> index a8baf5f..b6a0806 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c
> @@ -390,7 +390,7 @@ void *vmw_fifo_reserve_dx(struct vmw_private *dev_priv, uint32_t bytes,
>  	else if (ctx_id == SVGA3D_INVALID_ID)
>  		ret = vmw_local_fifo_reserve(dev_priv, bytes);
>  	else {
> -		WARN_ON("Command buffer has not been allocated.\n");
> +		WARN(1, "Command buffer has not been allocated.\n");
>  		ret = NULL;
>  	}
>  	if (IS_ERR_OR_NULL(ret)) {
> -- 
> 2.5.0
> 
> 

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v2] ARM: davinci: fix a problematic usage of WARN()
  2015-11-25 14:13             ` [PATCH v2] " Geliang Tang
@ 2015-11-25 20:21               ` kbuild test robot
  2015-11-25 20:28                 ` Arnd Bergmann
  0 siblings, 1 reply; 19+ messages in thread
From: kbuild test robot @ 2015-11-25 20:21 UTC (permalink / raw)
  To: Geliang Tang
  Cc: kbuild-all, Sekhar Nori, Kevin Hilman, Russell King, Geliang Tang,
	linux-arm-kernel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 3708 bytes --]

Hi Geliang,

[auto build test ERROR on arm-soc/for-next]
[also build test ERROR on v4.4-rc2 next-20151124]

url:    https://github.com/0day-ci/linux/commits/Geliang-Tang/ARM-davinci-fix-a-problematic-usage-of-WARN/20151125-221653
base:   https://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc.git for-next
config: arm-davinci_all_defconfig (attached as .config)
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=arm 

All error/warnings (new ones prefixed by >>):

   In file included from arch/arm/include/asm/bug.h:62:0,
                    from arch/arm/include/asm/div64.h:63,
                    from include/linux/kernel.h:136,
                    from arch/arm/mach-davinci/board-dm355-evm.c:11:
   arch/arm/mach-davinci/board-dm355-evm.c: In function 'dm355_evm_init':
>> include/asm-generic/bug.h:74:72: error: expected expression before ')' token
    #define __WARN_printf(arg...) warn_slowpath_fmt(__FILE__, __LINE__, arg)
                                                                           ^
   include/asm-generic/bug.h:97:3: note: in expansion of macro '__WARN_printf'
      __WARN_printf(format);     \
      ^
>> arch/arm/mach-davinci/board-dm355-evm.c:387:7: note: in expansion of macro 'WARN'
     if (!WARN(IS_ERR(aemif)), "unable to get AEMIF clock\n"))
          ^
   arch/arm/mach-davinci/board-dm355-evm.c:387:6: warning: value computed is not used [-Wunused-value]
     if (!WARN(IS_ERR(aemif)), "unable to get AEMIF clock\n"))
         ^
>> arch/arm/mach-davinci/board-dm355-evm.c:387:58: error: expected statement before ')' token
     if (!WARN(IS_ERR(aemif)), "unable to get AEMIF clock\n"))
                                                             ^
--
   In file included from arch/arm/include/asm/bug.h:62:0,
                    from arch/arm/include/asm/div64.h:63,
                    from include/linux/kernel.h:136,
                    from arch/arm/mach-davinci/board-dm355-leopard.c:10:
   arch/arm/mach-davinci/board-dm355-leopard.c: In function 'dm355_leopard_init':
>> include/asm-generic/bug.h:74:72: error: expected expression before ')' token
    #define __WARN_printf(arg...) warn_slowpath_fmt(__FILE__, __LINE__, arg)
                                                                           ^
   include/asm-generic/bug.h:97:3: note: in expansion of macro '__WARN_printf'
      __WARN_printf(format);     \
      ^
>> arch/arm/mach-davinci/board-dm355-leopard.c:245:7: note: in expansion of macro 'WARN'
     if (!WARN(IS_ERR(aemif)), "unable to get AEMIF clock\n"))
          ^
   arch/arm/mach-davinci/board-dm355-leopard.c:245:6: warning: value computed is not used [-Wunused-value]
     if (!WARN(IS_ERR(aemif)), "unable to get AEMIF clock\n"))
         ^
>> arch/arm/mach-davinci/board-dm355-leopard.c:245:58: error: expected statement before ')' token
     if (!WARN(IS_ERR(aemif)), "unable to get AEMIF clock\n"))
                                                             ^

vim +387 arch/arm/mach-davinci/board-dm355-evm.c

   381	
   382		gpio_request(1, "dm9000");
   383		gpio_direction_input(1);
   384		dm355evm_dm9000_rsrc[2].start = gpio_to_irq(1);
   385	
   386		aemif = clk_get(&dm355evm_dm9000.dev, "aemif");
 > 387		if (!WARN(IS_ERR(aemif)), "unable to get AEMIF clock\n"))
   388			clk_prepare_enable(aemif);
   389	
   390		platform_add_devices(davinci_evm_devices,

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 18871 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v2] ARM: davinci: fix a problematic usage of WARN()
  2015-11-25 20:21               ` kbuild test robot
@ 2015-11-25 20:28                 ` Arnd Bergmann
  2015-11-26  0:35                   ` [PATCH v3] " Geliang Tang
  0 siblings, 1 reply; 19+ messages in thread
From: Arnd Bergmann @ 2015-11-25 20:28 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: kbuild test robot, Geliang Tang, Russell King, Kevin Hilman,
	Sekhar Nori, linux-kernel, kbuild-all

On Thursday 26 November 2015 04:21:09 kbuild test robot wrote:
>    386          aemif = clk_get(&dm355evm_dm9000.dev, "aemif");
>  > 387          if (!WARN(IS_ERR(aemif)), "unable to get AEMIF clock\n"))
>    388                  clk_prepare_enable(aemif);
>    389  
> 

That is an extra ')' after aemif.

	Arnd

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH v3] ARM: davinci: fix a problematic usage of WARN()
  2015-11-25 20:28                 ` Arnd Bergmann
@ 2015-11-26  0:35                   ` Geliang Tang
  2015-12-15  9:58                     ` Sekhar Nori
  0 siblings, 1 reply; 19+ messages in thread
From: Geliang Tang @ 2015-11-26  0:35 UTC (permalink / raw)
  To: Arnd Bergmann, Sekhar Nori, Kevin Hilman, Russell King
  Cc: Geliang Tang, linux-arm-kernel, linux-kernel

WARN() takes a condition and a format string. The condition was
omitted. So I added it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
---
Changes in v3:
 - fix kbuild test robot error.
Changes in v2:
 - remove __func__ in WARN()
---
 arch/arm/mach-davinci/board-dm355-evm.c     | 4 +---
 arch/arm/mach-davinci/board-dm355-leopard.c | 4 +---
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-davinci/board-dm355-evm.c b/arch/arm/mach-davinci/board-dm355-evm.c
index c71dd99..1844076 100644
--- a/arch/arm/mach-davinci/board-dm355-evm.c
+++ b/arch/arm/mach-davinci/board-dm355-evm.c
@@ -384,9 +384,7 @@ static __init void dm355_evm_init(void)
 	dm355evm_dm9000_rsrc[2].start = gpio_to_irq(1);
 
 	aemif = clk_get(&dm355evm_dm9000.dev, "aemif");
-	if (IS_ERR(aemif))
-		WARN("%s: unable to get AEMIF clock\n", __func__);
-	else
+	if (!WARN(IS_ERR(aemif), "unable to get AEMIF clock\n"))
 		clk_prepare_enable(aemif);
 
 	platform_add_devices(davinci_evm_devices,
diff --git a/arch/arm/mach-davinci/board-dm355-leopard.c b/arch/arm/mach-davinci/board-dm355-leopard.c
index 680a7a2..284ff27 100644
--- a/arch/arm/mach-davinci/board-dm355-leopard.c
+++ b/arch/arm/mach-davinci/board-dm355-leopard.c
@@ -242,9 +242,7 @@ static __init void dm355_leopard_init(void)
 	dm355leopard_dm9000_rsrc[2].start = gpio_to_irq(9);
 
 	aemif = clk_get(&dm355leopard_dm9000.dev, "aemif");
-	if (IS_ERR(aemif))
-		WARN("%s: unable to get AEMIF clock\n", __func__);
-	else
+	if (!WARN(IS_ERR(aemif), "unable to get AEMIF clock\n"))
 		clk_prepare_enable(aemif);
 
 	platform_add_devices(davinci_leopard_devices,
-- 
2.5.0



^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH 7/7] powerpc: fix a problematic usage of WARN()
  2015-11-25 13:12           ` [PATCH 7/7] powerpc: " Geliang Tang
@ 2015-11-26  5:25             ` Michael Ellerman
  0 siblings, 0 replies; 19+ messages in thread
From: Michael Ellerman @ 2015-11-26  5:25 UTC (permalink / raw)
  To: Geliang Tang, Benjamin Herrenschmidt, Paul Mackerras, Scott Wood,
	David Gibson
  Cc: linuxppc-dev, linux-kernel

On Wed, 2015-11-25 at 21:12 +0800, Geliang Tang wrote:
> WARN() takes a condition and a format string. The condition was
> omitted. So I added it.
> 
> Signed-off-by: Geliang Tang <geliangtang@163.com>
> ---
>  arch/powerpc/kernel/setup_64.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
> index 5c03a6a..726a9fb 100644
> --- a/arch/powerpc/kernel/setup_64.c
> +++ b/arch/powerpc/kernel/setup_64.c
> @@ -127,7 +127,7 @@ static void setup_tlb_core_data(void)
>  		    !mmu_has_feature(MMU_FTR_USE_TLBRSRV) &&
>  		    book3e_htw_mode != PPC_HTW_E6500) {
>  			/* Should we panic instead? */
> -			WARN_ONCE("%s: unsupported MMU configuration -- expect problems\n",
> +			WARN_ONCE(1, "%s: unsupported MMU configuration -- expect problems\n",
>  				  __func__);
>  		}
>  	}

Oh yuck.

Acked-by: Michael Ellerman <mpe@ellerman.id.au>

cheers


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 2/7] drm/vmwgfx: fix a problematic usage of WARN_ON()
  2015-11-25 13:12 ` [PATCH 2/7] drm/vmwgfx: " Geliang Tang
  2015-11-25 13:12   ` [PATCH 3/7] iio: " Geliang Tang
  2015-11-25 15:50   ` [PATCH 2/7] drm/vmwgfx: " Sinclair Yeh
@ 2015-11-26 14:51   ` Thomas Hellstrom
  2 siblings, 0 replies; 19+ messages in thread
From: Thomas Hellstrom @ 2015-11-26 14:51 UTC (permalink / raw)
  To: Geliang Tang, David Airlie, Sinclair Yeh, Charmaine Lee
  Cc: dri-devel, linux-kernel

Thanks for reporting!

This fix was already reported by Dan Carpenter and has already been
queued in vmwgfx-fixes-4.4

/Thomas


On 11/25/2015 02:12 PM, Geliang Tang wrote:
> WARN_ON() takes a condition rather than a format string. This patch
> converted WARN_ON() to WARN() instead.
>
> Signed-off-by: Geliang Tang <geliangtang@163.com>
> ---
>  drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c
> index a8baf5f..b6a0806 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c
> @@ -390,7 +390,7 @@ void *vmw_fifo_reserve_dx(struct vmw_private *dev_priv, uint32_t bytes,
>  	else if (ctx_id == SVGA3D_INVALID_ID)
>  		ret = vmw_local_fifo_reserve(dev_priv, bytes);
>  	else {
> -		WARN_ON("Command buffer has not been allocated.\n");
> +		WARN(1, "Command buffer has not been allocated.\n");
>  		ret = NULL;
>  	}
>  	if (IS_ERR_OR_NULL(ret)) {


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v3] ARM: davinci: fix a problematic usage of WARN()
  2015-11-26  0:35                   ` [PATCH v3] " Geliang Tang
@ 2015-12-15  9:58                     ` Sekhar Nori
  0 siblings, 0 replies; 19+ messages in thread
From: Sekhar Nori @ 2015-12-15  9:58 UTC (permalink / raw)
  To: Geliang Tang, Arnd Bergmann, Kevin Hilman, Russell King
  Cc: linux-arm-kernel, linux-kernel

On Thursday 26 November 2015 06:05 AM, Geliang Tang wrote:
> WARN() takes a condition and a format string. The condition was
> omitted. So I added it.
> 
> Signed-off-by: Geliang Tang <geliangtang@163.com>

Applied.

Thanks,
Sekhar

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2015-12-15  9:59 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-25 13:12 [PATCH 1/7] drm/msm/mdp: fix a problematic usage of WARN_ON() Geliang Tang
2015-11-25 13:12 ` [PATCH 2/7] drm/vmwgfx: " Geliang Tang
2015-11-25 13:12   ` [PATCH 3/7] iio: " Geliang Tang
2015-11-25 13:12     ` [PATCH 4/7] iwlwifi: fix a problematic usage of WARN_ON_ONCE() Geliang Tang
2015-11-25 13:12       ` [PATCH 5/7] vfio: fix a problematic usage of WARN() Geliang Tang
2015-11-25 13:12         ` [PATCH 6/7] ARM: davinci: " Geliang Tang
2015-11-25 13:12           ` [PATCH 7/7] powerpc: " Geliang Tang
2015-11-26  5:25             ` Michael Ellerman
2015-11-25 13:39           ` [PATCH 6/7] ARM: davinci: " Arnd Bergmann
2015-11-25 14:13             ` [PATCH v2] " Geliang Tang
2015-11-25 20:21               ` kbuild test robot
2015-11-25 20:28                 ` Arnd Bergmann
2015-11-26  0:35                   ` [PATCH v3] " Geliang Tang
2015-12-15  9:58                     ` Sekhar Nori
2015-11-25 13:35         ` [PATCH 5/7] vfio: " Alex Williamson
2015-11-25 13:47       ` [PATCH 4/7] iwlwifi: fix a problematic usage of WARN_ON_ONCE() Grumbach, Emmanuel
2015-11-25 13:14     ` [PATCH 3/7] iio: fix a problematic usage of WARN_ON() Lars-Peter Clausen
2015-11-25 15:50   ` [PATCH 2/7] drm/vmwgfx: " Sinclair Yeh
2015-11-26 14:51   ` Thomas Hellstrom

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox