public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/25] treewide: Use bool function return values of true/false not 1/0
@ 2015-03-30 23:45 Joe Perches
  2015-03-30 23:45 ` [PATCH 01/25] arm: " Joe Perches
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Joe Perches @ 2015-03-30 23:45 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel, kvmarm, kvm, linux-omap, kvm-ppc,
	virtualization, linux-fsdevel, linux-nfs, linux-ide,
	kgdb-bugreport, linux-mm, linux-pm, netdev, alsa-devel, bridge,
	netfilter-devel, coreteam, patches
  Cc: linux-hexagon, linux-ia64, linux-mips, linuxppc-dev, linux-s390,
	sparclinux, linux-scsi, linux-security-module

Joe Perches (25):
  arm: Use bool function return values of true/false not 1/0
  arm64: Use bool function return values of true/false not 1/0
  hexagon: Use bool function return values of true/false not 1/0
  ia64: Use bool function return values of true/false not 1/0
  mips: Use bool function return values of true/false not 1/0
  powerpc: Use bool function return values of true/false not 1/0
  s390: Use bool function return values of true/false not 1/0
  sparc: Use bool function return values of true/false not 1/0
  tile: Use bool function return values of true/false not 1/0
  unicore32: Use bool function return values of true/false not 1/0
  x86: Use bool function return values of true/false not 1/0
  virtio_console: Use bool function return values of true/false not 1/0
  csiostor: Use bool function return values of true/false not 1/0
  dcache: Use bool function return values of true/false not 1/0
  nfsd: nfs4state: Use bool function return values of true/false not 1/0
  include/linux: Use bool function return values of true/false not 1/0
  sound: Use bool function return values of true/false not 1/0
  rcu: tree_plugin: Use bool function return values of true/false not 1/0
  sched: Use bool function return values of true/false not 1/0
  ftrace: Use bool function return values of true/false not 1/0
  slub: Use bool function return values of true/false not 1/0
  bridge: Use bool function return values of true/false not 1/0
  netfilter: Use bool function return values of true/false not 1/0
  security: Use bool function return values of true/false not 1/0
  sound: wm5100-tables: Use bool function return values of true/false not 1/0

 arch/arm/include/asm/dma-mapping.h           |  8 ++--
 arch/arm/include/asm/kvm_emulate.h           |  2 +-
 arch/arm/mach-omap2/powerdomain.c            | 14 +++---
 arch/arm64/include/asm/dma-mapping.h         |  2 +-
 arch/hexagon/include/asm/dma-mapping.h       |  2 +-
 arch/ia64/include/asm/dma-mapping.h          |  2 +-
 arch/mips/include/asm/dma-mapping.h          |  2 +-
 arch/powerpc/include/asm/dcr-native.h        |  2 +-
 arch/powerpc/include/asm/dma-mapping.h       |  4 +-
 arch/powerpc/include/asm/kvm_book3s_64.h     |  4 +-
 arch/powerpc/sysdev/dcr.c                    |  2 +-
 arch/s390/include/asm/dma-mapping.h          |  2 +-
 arch/sparc/mm/init_64.c                      |  8 ++--
 arch/tile/include/asm/dma-mapping.h          |  2 +-
 arch/unicore32/include/asm/dma-mapping.h     |  2 +-
 arch/x86/include/asm/archrandom.h            |  2 +-
 arch/x86/include/asm/dma-mapping.h           |  2 +-
 arch/x86/include/asm/kvm_para.h              |  2 +-
 arch/x86/kvm/cpuid.h                         |  2 +-
 arch/x86/kvm/vmx.c                           | 72 ++++++++++++++--------------
 drivers/char/virtio_console.c                |  2 +-
 drivers/scsi/csiostor/csio_scsi.c            |  4 +-
 fs/dcache.c                                  | 12 ++---
 fs/nfsd/nfs4state.c                          |  2 +-
 include/linux/blkdev.h                       |  2 +-
 include/linux/ide.h                          |  2 +-
 include/linux/kgdb.h                         |  2 +-
 include/linux/mfd/db8500-prcmu.h             |  2 +-
 include/linux/mm.h                           |  2 +-
 include/linux/power_supply.h                 |  8 ++--
 include/linux/ssb/ssb_driver_extif.h         |  2 +-
 include/linux/ssb/ssb_driver_gige.h          | 16 +++----
 include/sound/soc.h                          |  4 +-
 kernel/rcu/tree_plugin.h                     |  4 +-
 kernel/sched/auto_group.h                    |  2 +-
 kernel/sched/completion.c                    | 16 ++++---
 kernel/trace/ftrace.c                        | 10 ++--
 mm/slub.c                                    | 12 ++---
 net/bridge/br_private.h                      |  2 +-
 net/ipv4/netfilter/ipt_ah.c                  |  2 +-
 net/netfilter/ipset/ip_set_hash_ip.c         |  8 ++--
 net/netfilter/ipset/ip_set_hash_ipmark.c     |  8 ++--
 net/netfilter/ipset/ip_set_hash_ipport.c     |  8 ++--
 net/netfilter/ipset/ip_set_hash_ipportip.c   |  8 ++--
 net/netfilter/ipset/ip_set_hash_ipportnet.c  |  8 ++--
 net/netfilter/ipset/ip_set_hash_net.c        |  8 ++--
 net/netfilter/ipset/ip_set_hash_netiface.c   |  8 ++--
 net/netfilter/ipset/ip_set_hash_netport.c    |  8 ++--
 net/netfilter/ipset/ip_set_hash_netportnet.c |  8 ++--
 net/netfilter/xt_connlimit.c                 |  2 +-
 net/netfilter/xt_hashlimit.c                 |  2 +-
 net/netfilter/xt_ipcomp.c                    |  2 +-
 security/apparmor/file.c                     |  8 ++--
 security/apparmor/policy.c                   | 10 ++--
 sound/soc/codecs/wm5100-tables.c             | 12 ++---
 55 files changed, 178 insertions(+), 176 deletions(-)

-- 
2.1.2

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* [PATCH 01/25] arm: Use bool function return values of true/false not 1/0
  2015-03-30 23:45 [PATCH 00/25] treewide: Use bool function return values of true/false not 1/0 Joe Perches
@ 2015-03-30 23:45 ` Joe Perches
  2015-03-31 15:54   ` Tony Lindgren
  2015-03-31 15:58   ` Paolo Bonzini
  2015-03-30 23:46 ` [PATCH 06/25] powerpc: " Joe Perches
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 12+ messages in thread
From: Joe Perches @ 2015-03-30 23:45 UTC (permalink / raw)
  To: linux-kernel, Christoffer Dall, Marc Zyngier, Gleb Natapov,
	Paolo Bonzini, Tony Lindgren
  Cc: Russell King, linux-arm-kernel, kvmarm, kvm, linux-omap

Use the normal return values for bool functions

Signed-off-by: Joe Perches <joe@perches.com>
---
 arch/arm/include/asm/dma-mapping.h |  8 ++++----
 arch/arm/include/asm/kvm_emulate.h |  2 +-
 arch/arm/mach-omap2/powerdomain.c  | 14 +++++++-------
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/arch/arm/include/asm/dma-mapping.h b/arch/arm/include/asm/dma-mapping.h
index b52101d..166e1e1 100644
--- a/arch/arm/include/asm/dma-mapping.h
+++ b/arch/arm/include/asm/dma-mapping.h
@@ -151,18 +151,18 @@ static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size)
 	u64 limit, mask;
 
 	if (!dev->dma_mask)
-		return 0;
+		return false;
 
 	mask = *dev->dma_mask;
 
 	limit = (mask + 1) & ~mask;
 	if (limit && size > limit)
-		return 0;
+		return false;
 
 	if ((addr | (addr + size - 1)) & ~mask)
-		return 0;
+		return false;
 
-	return 1;
+	return true;
 }
 
 static inline void dma_mark_clean(void *addr, size_t size) { }
diff --git a/arch/arm/include/asm/kvm_emulate.h b/arch/arm/include/asm/kvm_emulate.h
index a9c80a2..ad200a0 100644
--- a/arch/arm/include/asm/kvm_emulate.h
+++ b/arch/arm/include/asm/kvm_emulate.h
@@ -51,7 +51,7 @@ static inline void vcpu_set_hcr(struct kvm_vcpu *vcpu, unsigned long hcr)
 
 static inline bool vcpu_mode_is_32bit(struct kvm_vcpu *vcpu)
 {
-	return 1;
+	return true;
 }
 
 static inline unsigned long *vcpu_pc(struct kvm_vcpu *vcpu)
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
index 78af6d8..897f9fb 100644
--- a/arch/arm/mach-omap2/powerdomain.c
+++ b/arch/arm/mach-omap2/powerdomain.c
@@ -950,7 +950,7 @@ int pwrdm_disable_hdwr_sar(struct powerdomain *pwrdm)
  */
 bool pwrdm_has_hdwr_sar(struct powerdomain *pwrdm)
 {
-	return (pwrdm && pwrdm->flags & PWRDM_HAS_HDWR_SAR) ? 1 : 0;
+	return pwrdm && (pwrdm->flags & PWRDM_HAS_HDWR_SAR);
 }
 
 int pwrdm_state_switch_nolock(struct powerdomain *pwrdm)
@@ -1185,24 +1185,24 @@ bool pwrdm_can_ever_lose_context(struct powerdomain *pwrdm)
 	if (!pwrdm) {
 		pr_debug("powerdomain: %s: invalid powerdomain pointer\n",
 			 __func__);
-		return 1;
+		return true;
 	}
 
 	if (pwrdm->pwrsts & PWRSTS_OFF)
-		return 1;
+		return true;
 
 	if (pwrdm->pwrsts & PWRSTS_RET) {
 		if (pwrdm->pwrsts_logic_ret & PWRSTS_OFF)
-			return 1;
+			return true;
 
 		for (i = 0; i < pwrdm->banks; i++)
 			if (pwrdm->pwrsts_mem_ret[i] & PWRSTS_OFF)
-				return 1;
+				return true;
 	}
 
 	for (i = 0; i < pwrdm->banks; i++)
 		if (pwrdm->pwrsts_mem_on[i] & PWRSTS_OFF)
-			return 1;
+			return true;
 
-	return 0;
+	return false;
 }
-- 
2.1.2

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

* [PATCH 06/25] powerpc: Use bool function return values of true/false not 1/0
  2015-03-30 23:45 [PATCH 00/25] treewide: Use bool function return values of true/false not 1/0 Joe Perches
  2015-03-30 23:45 ` [PATCH 01/25] arm: " Joe Perches
@ 2015-03-30 23:46 ` Joe Perches
  2015-03-31  1:49   ` Benjamin Herrenschmidt
  2015-03-30 23:46 ` [PATCH 11/25] x86: " Joe Perches
  2015-03-31  0:07 ` [PATCH 00/25] treewide: " Casey Schaufler
  3 siblings, 1 reply; 12+ messages in thread
From: Joe Perches @ 2015-03-30 23:46 UTC (permalink / raw)
  To: linux-kernel, Alexander Graf, Gleb Natapov, Paolo Bonzini
  Cc: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
	linuxppc-dev, kvm-ppc, kvm

Use the normal return values for bool functions

Signed-off-by: Joe Perches <joe@perches.com>
---
 arch/powerpc/include/asm/dcr-native.h    | 2 +-
 arch/powerpc/include/asm/dma-mapping.h   | 4 ++--
 arch/powerpc/include/asm/kvm_book3s_64.h | 4 ++--
 arch/powerpc/sysdev/dcr.c                | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/include/asm/dcr-native.h b/arch/powerpc/include/asm/dcr-native.h
index 7d2e623..4efc11d 100644
--- a/arch/powerpc/include/asm/dcr-native.h
+++ b/arch/powerpc/include/asm/dcr-native.h
@@ -31,7 +31,7 @@ typedef struct {
 
 static inline bool dcr_map_ok_native(dcr_host_native_t host)
 {
-	return 1;
+	return true;
 }
 
 #define dcr_map_native(dev, dcr_n, dcr_c) \
diff --git a/arch/powerpc/include/asm/dma-mapping.h b/arch/powerpc/include/asm/dma-mapping.h
index 894d538..9103687 100644
--- a/arch/powerpc/include/asm/dma-mapping.h
+++ b/arch/powerpc/include/asm/dma-mapping.h
@@ -191,11 +191,11 @@ static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size)
 	struct dev_archdata *sd = &dev->archdata;
 
 	if (sd->max_direct_dma_addr && addr + size > sd->max_direct_dma_addr)
-		return 0;
+		return false;
 #endif
 
 	if (!dev->dma_mask)
-		return 0;
+		return false;
 
 	return addr + size - 1 <= *dev->dma_mask;
 }
diff --git a/arch/powerpc/include/asm/kvm_book3s_64.h b/arch/powerpc/include/asm/kvm_book3s_64.h
index 2d81e20..2a244bf 100644
--- a/arch/powerpc/include/asm/kvm_book3s_64.h
+++ b/arch/powerpc/include/asm/kvm_book3s_64.h
@@ -335,7 +335,7 @@ static inline bool hpte_read_permission(unsigned long pp, unsigned long key)
 {
 	if (key)
 		return PP_RWRX <= pp && pp <= PP_RXRX;
-	return 1;
+	return true;
 }
 
 static inline bool hpte_write_permission(unsigned long pp, unsigned long key)
@@ -373,7 +373,7 @@ static inline bool slot_is_aligned(struct kvm_memory_slot *memslot,
 	unsigned long mask = (pagesize >> PAGE_SHIFT) - 1;
 
 	if (pagesize <= PAGE_SIZE)
-		return 1;
+		return true;
 	return !(memslot->base_gfn & mask) && !(memslot->npages & mask);
 }
 
diff --git a/arch/powerpc/sysdev/dcr.c b/arch/powerpc/sysdev/dcr.c
index 2d8a101..121e26f 100644
--- a/arch/powerpc/sysdev/dcr.c
+++ b/arch/powerpc/sysdev/dcr.c
@@ -54,7 +54,7 @@ bool dcr_map_ok_generic(dcr_host_t host)
 	else if (host.type == DCR_HOST_MMIO)
 		return dcr_map_ok_mmio(host.host.mmio);
 	else
-		return 0;
+		return false;
 }
 EXPORT_SYMBOL_GPL(dcr_map_ok_generic);
 
-- 
2.1.2

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

* [PATCH 11/25] x86: Use bool function return values of true/false not 1/0
  2015-03-30 23:45 [PATCH 00/25] treewide: Use bool function return values of true/false not 1/0 Joe Perches
  2015-03-30 23:45 ` [PATCH 01/25] arm: " Joe Perches
  2015-03-30 23:46 ` [PATCH 06/25] powerpc: " Joe Perches
@ 2015-03-30 23:46 ` Joe Perches
  2015-03-31 16:05   ` Paolo Bonzini
  2015-03-31  0:07 ` [PATCH 00/25] treewide: " Casey Schaufler
  3 siblings, 1 reply; 12+ messages in thread
From: Joe Perches @ 2015-03-30 23:46 UTC (permalink / raw)
  To: linux-kernel, Gleb Natapov, Paolo Bonzini
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, kvm

Use the normal return values for bool functions

Signed-off-by: Joe Perches <joe@perches.com>
---
 arch/x86/include/asm/archrandom.h  |  2 +-
 arch/x86/include/asm/dma-mapping.h |  2 +-
 arch/x86/include/asm/kvm_para.h    |  2 +-
 arch/x86/kvm/cpuid.h               |  2 +-
 arch/x86/kvm/vmx.c                 | 72 +++++++++++++++++++-------------------
 5 files changed, 40 insertions(+), 40 deletions(-)

diff --git a/arch/x86/include/asm/archrandom.h b/arch/x86/include/asm/archrandom.h
index 69f1366..7abcd71 100644
--- a/arch/x86/include/asm/archrandom.h
+++ b/arch/x86/include/asm/archrandom.h
@@ -126,7 +126,7 @@ static inline int rdrand_long(unsigned long *v)
 
 static inline bool rdseed_long(unsigned long *v)
 {
-	return 0;
+	return false;
 }
 
 #endif  /* CONFIG_ARCH_RANDOM */
diff --git a/arch/x86/include/asm/dma-mapping.h b/arch/x86/include/asm/dma-mapping.h
index 808dae6..efac032 100644
--- a/arch/x86/include/asm/dma-mapping.h
+++ b/arch/x86/include/asm/dma-mapping.h
@@ -77,7 +77,7 @@ extern phys_addr_t dma_to_phys(struct device *dev, dma_addr_t daddr);
 static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size)
 {
 	if (!dev->dma_mask)
-		return 0;
+		return false;
 
 	return addr + size - 1 <= *dev->dma_mask;
 }
diff --git a/arch/x86/include/asm/kvm_para.h b/arch/x86/include/asm/kvm_para.h
index e62cf89..c1adf33 100644
--- a/arch/x86/include/asm/kvm_para.h
+++ b/arch/x86/include/asm/kvm_para.h
@@ -115,7 +115,7 @@ static inline void kvm_spinlock_init(void)
 
 static inline bool kvm_para_available(void)
 {
-	return 0;
+	return false;
 }
 
 static inline unsigned int kvm_arch_para_features(void)
diff --git a/arch/x86/kvm/cpuid.h b/arch/x86/kvm/cpuid.h
index 4452eed..2622846 100644
--- a/arch/x86/kvm/cpuid.h
+++ b/arch/x86/kvm/cpuid.h
@@ -26,7 +26,7 @@ static inline bool guest_cpuid_has_xsave(struct kvm_vcpu *vcpu)
 	struct kvm_cpuid_entry2 *best;
 
 	if (!static_cpu_has(X86_FEATURE_XSAVE))
-		return 0;
+		return false;
 
 	best = kvm_find_cpuid_entry(vcpu, 1, 0);
 	return best && (best->ecx & bit(X86_FEATURE_XSAVE));
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index ae4f6d3..ab121db 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -7318,21 +7318,21 @@ static bool nested_vmx_exit_handled_io(struct kvm_vcpu *vcpu,
 		else if (port < 0x10000)
 			bitmap = vmcs12->io_bitmap_b;
 		else
-			return 1;
+			return true;
 		bitmap += (port & 0x7fff) / 8;
 
 		if (last_bitmap != bitmap)
 			if (kvm_read_guest(vcpu->kvm, bitmap, &b, 1))
-				return 1;
+				return true;
 		if (b & (1 << (port & 7)))
-			return 1;
+			return true;
 
 		port++;
 		size--;
 		last_bitmap = bitmap;
 	}
 
-	return 0;
+	return false;
 }
 
 /*
@@ -7348,7 +7348,7 @@ static bool nested_vmx_exit_handled_msr(struct kvm_vcpu *vcpu,
 	gpa_t bitmap;
 
 	if (!nested_cpu_has(vmcs12, CPU_BASED_USE_MSR_BITMAPS))
-		return 1;
+		return true;
 
 	/*
 	 * The MSR_BITMAP page is divided into four 1024-byte bitmaps,
@@ -7367,10 +7367,10 @@ static bool nested_vmx_exit_handled_msr(struct kvm_vcpu *vcpu,
 	if (msr_index < 1024*8) {
 		unsigned char b;
 		if (kvm_read_guest(vcpu->kvm, bitmap + msr_index/8, &b, 1))
-			return 1;
+			return true;
 		return 1 & (b >> (msr_index & 7));
 	} else
-		return 1; /* let L1 handle the wrong parameter */
+		return true; /* let L1 handle the wrong parameter */
 }
 
 /*
@@ -7392,7 +7392,7 @@ static bool nested_vmx_exit_handled_cr(struct kvm_vcpu *vcpu,
 		case 0:
 			if (vmcs12->cr0_guest_host_mask &
 			    (val ^ vmcs12->cr0_read_shadow))
-				return 1;
+				return true;
 			break;
 		case 3:
 			if ((vmcs12->cr3_target_count >= 1 &&
@@ -7403,37 +7403,37 @@ static bool nested_vmx_exit_handled_cr(struct kvm_vcpu *vcpu,
 					vmcs12->cr3_target_value2 == val) ||
 				(vmcs12->cr3_target_count >= 4 &&
 					vmcs12->cr3_target_value3 == val))
-				return 0;
+				return false;
 			if (nested_cpu_has(vmcs12, CPU_BASED_CR3_LOAD_EXITING))
-				return 1;
+				return true;
 			break;
 		case 4:
 			if (vmcs12->cr4_guest_host_mask &
 			    (vmcs12->cr4_read_shadow ^ val))
-				return 1;
+				return true;
 			break;
 		case 8:
 			if (nested_cpu_has(vmcs12, CPU_BASED_CR8_LOAD_EXITING))
-				return 1;
+				return true;
 			break;
 		}
 		break;
 	case 2: /* clts */
 		if ((vmcs12->cr0_guest_host_mask & X86_CR0_TS) &&
 		    (vmcs12->cr0_read_shadow & X86_CR0_TS))
-			return 1;
+			return true;
 		break;
 	case 1: /* mov from cr */
 		switch (cr) {
 		case 3:
 			if (vmcs12->cpu_based_vm_exec_control &
 			    CPU_BASED_CR3_STORE_EXITING)
-				return 1;
+				return true;
 			break;
 		case 8:
 			if (vmcs12->cpu_based_vm_exec_control &
 			    CPU_BASED_CR8_STORE_EXITING)
-				return 1;
+				return true;
 			break;
 		}
 		break;
@@ -7444,14 +7444,14 @@ static bool nested_vmx_exit_handled_cr(struct kvm_vcpu *vcpu,
 		 */
 		if (vmcs12->cr0_guest_host_mask & 0xe &
 		    (val ^ vmcs12->cr0_read_shadow))
-			return 1;
+			return true;
 		if ((vmcs12->cr0_guest_host_mask & 0x1) &&
 		    !(vmcs12->cr0_read_shadow & 0x1) &&
 		    (val & 0x1))
-			return 1;
+			return true;
 		break;
 	}
-	return 0;
+	return false;
 }
 
 /*
@@ -7474,43 +7474,43 @@ static bool nested_vmx_exit_handled(struct kvm_vcpu *vcpu)
 				KVM_ISA_VMX);
 
 	if (vmx->nested.nested_run_pending)
-		return 0;
+		return false;
 
 	if (unlikely(vmx->fail)) {
 		pr_info_ratelimited("%s failed vm entry %x\n", __func__,
 				    vmcs_read32(VM_INSTRUCTION_ERROR));
-		return 1;
+		return true;
 	}
 
 	switch (exit_reason) {
 	case EXIT_REASON_EXCEPTION_NMI:
 		if (!is_exception(intr_info))
-			return 0;
+			return false;
 		else if (is_page_fault(intr_info))
 			return enable_ept;
 		else if (is_no_device(intr_info) &&
 			 !(vmcs12->guest_cr0 & X86_CR0_TS))
-			return 0;
+			return false;
 		return vmcs12->exception_bitmap &
 				(1u << (intr_info & INTR_INFO_VECTOR_MASK));
 	case EXIT_REASON_EXTERNAL_INTERRUPT:
-		return 0;
+		return false;
 	case EXIT_REASON_TRIPLE_FAULT:
-		return 1;
+		return true;
 	case EXIT_REASON_PENDING_INTERRUPT:
 		return nested_cpu_has(vmcs12, CPU_BASED_VIRTUAL_INTR_PENDING);
 	case EXIT_REASON_NMI_WINDOW:
 		return nested_cpu_has(vmcs12, CPU_BASED_VIRTUAL_NMI_PENDING);
 	case EXIT_REASON_TASK_SWITCH:
-		return 1;
+		return true;
 	case EXIT_REASON_CPUID:
 		if (kvm_register_read(vcpu, VCPU_REGS_RAX) == 0xa)
-			return 0;
-		return 1;
+			return false;
+		return true;
 	case EXIT_REASON_HLT:
 		return nested_cpu_has(vmcs12, CPU_BASED_HLT_EXITING);
 	case EXIT_REASON_INVD:
-		return 1;
+		return true;
 	case EXIT_REASON_INVLPG:
 		return nested_cpu_has(vmcs12, CPU_BASED_INVLPG_EXITING);
 	case EXIT_REASON_RDPMC:
@@ -7527,7 +7527,7 @@ static bool nested_vmx_exit_handled(struct kvm_vcpu *vcpu)
 		 * VMX instructions trap unconditionally. This allows L1 to
 		 * emulate them for its L2 guest, i.e., allows 3-level nesting!
 		 */
-		return 1;
+		return true;
 	case EXIT_REASON_CR_ACCESS:
 		return nested_vmx_exit_handled_cr(vcpu, vmcs12);
 	case EXIT_REASON_DR_ACCESS:
@@ -7538,7 +7538,7 @@ static bool nested_vmx_exit_handled(struct kvm_vcpu *vcpu)
 	case EXIT_REASON_MSR_WRITE:
 		return nested_vmx_exit_handled_msr(vcpu, vmcs12, exit_reason);
 	case EXIT_REASON_INVALID_STATE:
-		return 1;
+		return true;
 	case EXIT_REASON_MWAIT_INSTRUCTION:
 		return nested_cpu_has(vmcs12, CPU_BASED_MWAIT_EXITING);
 	case EXIT_REASON_MONITOR_INSTRUCTION:
@@ -7548,7 +7548,7 @@ static bool nested_vmx_exit_handled(struct kvm_vcpu *vcpu)
 			nested_cpu_has2(vmcs12,
 				SECONDARY_EXEC_PAUSE_LOOP_EXITING);
 	case EXIT_REASON_MCE_DURING_VMENTRY:
-		return 0;
+		return false;
 	case EXIT_REASON_TPR_BELOW_THRESHOLD:
 		return nested_cpu_has(vmcs12, CPU_BASED_TPR_SHADOW);
 	case EXIT_REASON_APIC_ACCESS:
@@ -7557,7 +7557,7 @@ static bool nested_vmx_exit_handled(struct kvm_vcpu *vcpu)
 	case EXIT_REASON_APIC_WRITE:
 	case EXIT_REASON_EOI_INDUCED:
 		/* apic_write and eoi_induced should exit unconditionally. */
-		return 1;
+		return true;
 	case EXIT_REASON_EPT_VIOLATION:
 		/*
 		 * L0 always deals with the EPT violation. If nested EPT is
@@ -7565,7 +7565,7 @@ static bool nested_vmx_exit_handled(struct kvm_vcpu *vcpu)
 		 * missing in the guest EPT table (EPT12), the EPT violation
 		 * will be injected with nested_ept_inject_page_fault()
 		 */
-		return 0;
+		return false;
 	case EXIT_REASON_EPT_MISCONFIG:
 		/*
 		 * L2 never uses directly L1's EPT, but rather L0's own EPT
@@ -7573,11 +7573,11 @@ static bool nested_vmx_exit_handled(struct kvm_vcpu *vcpu)
 		 * (EPT on EPT). So any problems with the structure of the
 		 * table is L0's fault.
 		 */
-		return 0;
+		return false;
 	case EXIT_REASON_WBINVD:
 		return nested_cpu_has2(vmcs12, SECONDARY_EXEC_WBINVD_EXITING);
 	case EXIT_REASON_XSETBV:
-		return 1;
+		return true;
 	case EXIT_REASON_XSAVES: case EXIT_REASON_XRSTORS:
 		/*
 		 * This should never happen, since it is not possible to
@@ -7587,7 +7587,7 @@ static bool nested_vmx_exit_handled(struct kvm_vcpu *vcpu)
 		 */
 		return nested_cpu_has2(vmcs12, SECONDARY_EXEC_XSAVES);
 	default:
-		return 1;
+		return true;
 	}
 }
 
-- 
2.1.2

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

* Re: [PATCH 00/25] treewide: Use bool function return values of true/false not 1/0
  2015-03-30 23:45 [PATCH 00/25] treewide: Use bool function return values of true/false not 1/0 Joe Perches
                   ` (2 preceding siblings ...)
  2015-03-30 23:46 ` [PATCH 11/25] x86: " Joe Perches
@ 2015-03-31  0:07 ` Casey Schaufler
  2015-03-31  0:14   ` Joe Perches
  3 siblings, 1 reply; 12+ messages in thread
From: Casey Schaufler @ 2015-03-31  0:07 UTC (permalink / raw)
  To: Joe Perches, linux-kernel, linux-arm-kernel, kvmarm, kvm,
	linux-omap, kvm-ppc, virtualization, linux-fsdevel, linux-nfs,
	linux-ide, kgdb-bugreport, linux-mm, linux-pm, netdev, alsa-devel,
	bridge, netfilter-devel, coreteam, patches
  Cc: linux-hexagon, linux-ia64, linux-mips, linuxppc-dev, linux-s390,
	sparclinux, linux-scsi, linux-security-module

On 3/30/2015 4:45 PM, Joe Perches wrote:
> Joe Perches (25):
>   arm: Use bool function return values of true/false not 1/0
>   arm64: Use bool function return values of true/false not 1/0
>   hexagon: Use bool function return values of true/false not 1/0
>   ia64: Use bool function return values of true/false not 1/0
>   mips: Use bool function return values of true/false not 1/0
>   powerpc: Use bool function return values of true/false not 1/0
>   s390: Use bool function return values of true/false not 1/0
>   sparc: Use bool function return values of true/false not 1/0
>   tile: Use bool function return values of true/false not 1/0
>   unicore32: Use bool function return values of true/false not 1/0
>   x86: Use bool function return values of true/false not 1/0
>   virtio_console: Use bool function return values of true/false not 1/0
>   csiostor: Use bool function return values of true/false not 1/0
>   dcache: Use bool function return values of true/false not 1/0
>   nfsd: nfs4state: Use bool function return values of true/false not 1/0
>   include/linux: Use bool function return values of true/false not 1/0
>   sound: Use bool function return values of true/false not 1/0
>   rcu: tree_plugin: Use bool function return values of true/false not 1/0
>   sched: Use bool function return values of true/false not 1/0
>   ftrace: Use bool function return values of true/false not 1/0
>   slub: Use bool function return values of true/false not 1/0
>   bridge: Use bool function return values of true/false not 1/0
>   netfilter: Use bool function return values of true/false not 1/0
>   security: Use bool function return values of true/false not 1/0
>   sound: wm5100-tables: Use bool function return values of true/false not 1/0
>
>  arch/arm/include/asm/dma-mapping.h           |  8 ++--
>  arch/arm/include/asm/kvm_emulate.h           |  2 +-
>  arch/arm/mach-omap2/powerdomain.c            | 14 +++---
>  arch/arm64/include/asm/dma-mapping.h         |  2 +-
>  arch/hexagon/include/asm/dma-mapping.h       |  2 +-
>  arch/ia64/include/asm/dma-mapping.h          |  2 +-
>  arch/mips/include/asm/dma-mapping.h          |  2 +-
>  arch/powerpc/include/asm/dcr-native.h        |  2 +-
>  arch/powerpc/include/asm/dma-mapping.h       |  4 +-
>  arch/powerpc/include/asm/kvm_book3s_64.h     |  4 +-
>  arch/powerpc/sysdev/dcr.c                    |  2 +-
>  arch/s390/include/asm/dma-mapping.h          |  2 +-
>  arch/sparc/mm/init_64.c                      |  8 ++--
>  arch/tile/include/asm/dma-mapping.h          |  2 +-
>  arch/unicore32/include/asm/dma-mapping.h     |  2 +-
>  arch/x86/include/asm/archrandom.h            |  2 +-
>  arch/x86/include/asm/dma-mapping.h           |  2 +-
>  arch/x86/include/asm/kvm_para.h              |  2 +-
>  arch/x86/kvm/cpuid.h                         |  2 +-
>  arch/x86/kvm/vmx.c                           | 72 ++++++++++++++--------------
>  drivers/char/virtio_console.c                |  2 +-
>  drivers/scsi/csiostor/csio_scsi.c            |  4 +-
>  fs/dcache.c                                  | 12 ++---
>  fs/nfsd/nfs4state.c                          |  2 +-
>  include/linux/blkdev.h                       |  2 +-
>  include/linux/ide.h                          |  2 +-
>  include/linux/kgdb.h                         |  2 +-
>  include/linux/mfd/db8500-prcmu.h             |  2 +-
>  include/linux/mm.h                           |  2 +-
>  include/linux/power_supply.h                 |  8 ++--
>  include/linux/ssb/ssb_driver_extif.h         |  2 +-
>  include/linux/ssb/ssb_driver_gige.h          | 16 +++----
>  include/sound/soc.h                          |  4 +-
>  kernel/rcu/tree_plugin.h                     |  4 +-
>  kernel/sched/auto_group.h                    |  2 +-
>  kernel/sched/completion.c                    | 16 ++++---
>  kernel/trace/ftrace.c                        | 10 ++--
>  mm/slub.c                                    | 12 ++---
>  net/bridge/br_private.h                      |  2 +-
>  net/ipv4/netfilter/ipt_ah.c                  |  2 +-
>  net/netfilter/ipset/ip_set_hash_ip.c         |  8 ++--
>  net/netfilter/ipset/ip_set_hash_ipmark.c     |  8 ++--
>  net/netfilter/ipset/ip_set_hash_ipport.c     |  8 ++--
>  net/netfilter/ipset/ip_set_hash_ipportip.c   |  8 ++--
>  net/netfilter/ipset/ip_set_hash_ipportnet.c  |  8 ++--
>  net/netfilter/ipset/ip_set_hash_net.c        |  8 ++--
>  net/netfilter/ipset/ip_set_hash_netiface.c   |  8 ++--
>  net/netfilter/ipset/ip_set_hash_netport.c    |  8 ++--
>  net/netfilter/ipset/ip_set_hash_netportnet.c |  8 ++--
>  net/netfilter/xt_connlimit.c                 |  2 +-
>  net/netfilter/xt_hashlimit.c                 |  2 +-
>  net/netfilter/xt_ipcomp.c                    |  2 +-
>  security/apparmor/file.c                     |  8 ++--
>  security/apparmor/policy.c                   | 10 ++--
>  sound/soc/codecs/wm5100-tables.c             | 12 ++---

Why, and why these in particular?

>  55 files changed, 178 insertions(+), 176 deletions(-)
>


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

* Re: [PATCH 00/25] treewide: Use bool function return values of true/false not 1/0
  2015-03-31  0:07 ` [PATCH 00/25] treewide: " Casey Schaufler
@ 2015-03-31  0:14   ` Joe Perches
  0 siblings, 0 replies; 12+ messages in thread
From: Joe Perches @ 2015-03-31  0:14 UTC (permalink / raw)
  To: Casey Schaufler
  Cc: linux-kernel, linux-arm-kernel, kvmarm, kvm, linux-omap, kvm-ppc,
	virtualization, linux-fsdevel, linux-nfs, linux-ide,
	kgdb-bugreport, linux-mm, linux-pm, netdev, alsa-devel, bridge,
	netfilter-devel, coreteam, patches, linux-hexagon, linux-ia64,
	linux-mips, linuxppc-dev, linux-s390, sparclinux, linux-scsi,
	linux-security-module

On Mon, 2015-03-30 at 17:07 -0700, Casey Schaufler wrote:
> On 3/30/2015 4:45 PM, Joe Perches wrote:
> > Joe Perches (25):
> >   arm: Use bool function return values of true/false not 1/0

[etc...]

> Why, and why these in particular?

bool functions are probably better returning
bool values instead of 1 and 0.

Especially when the functions intermix returning
returning 1/0 and true/false.

(there are only a couple of those though)

These are all the remaining instances in the
kernel tree.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH 06/25] powerpc: Use bool function return values of true/false not 1/0
  2015-03-30 23:46 ` [PATCH 06/25] powerpc: " Joe Perches
@ 2015-03-31  1:49   ` Benjamin Herrenschmidt
  2015-03-31  1:57     ` Joe Perches
  0 siblings, 1 reply; 12+ messages in thread
From: Benjamin Herrenschmidt @ 2015-03-31  1:49 UTC (permalink / raw)
  To: Joe Perches
  Cc: kvm, Gleb Natapov, linux-kernel, kvm-ppc, Alexander Graf,
	Paul Mackerras, Paolo Bonzini, linuxppc-dev

On Mon, 2015-03-30 at 16:46 -0700, Joe Perches wrote:
> Use the normal return values for bool functions

Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Should we merge it or will you ?

Cheers,
Ben.

> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  arch/powerpc/include/asm/dcr-native.h    | 2 +-
>  arch/powerpc/include/asm/dma-mapping.h   | 4 ++--
>  arch/powerpc/include/asm/kvm_book3s_64.h | 4 ++--
>  arch/powerpc/sysdev/dcr.c                | 2 +-
>  4 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/powerpc/include/asm/dcr-native.h b/arch/powerpc/include/asm/dcr-native.h
> index 7d2e623..4efc11d 100644
> --- a/arch/powerpc/include/asm/dcr-native.h
> +++ b/arch/powerpc/include/asm/dcr-native.h
> @@ -31,7 +31,7 @@ typedef struct {
>  
>  static inline bool dcr_map_ok_native(dcr_host_native_t host)
>  {
> -	return 1;
> +	return true;
>  }
>  
>  #define dcr_map_native(dev, dcr_n, dcr_c) \
> diff --git a/arch/powerpc/include/asm/dma-mapping.h b/arch/powerpc/include/asm/dma-mapping.h
> index 894d538..9103687 100644
> --- a/arch/powerpc/include/asm/dma-mapping.h
> +++ b/arch/powerpc/include/asm/dma-mapping.h
> @@ -191,11 +191,11 @@ static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size)
>  	struct dev_archdata *sd = &dev->archdata;
>  
>  	if (sd->max_direct_dma_addr && addr + size > sd->max_direct_dma_addr)
> -		return 0;
> +		return false;
>  #endif
>  
>  	if (!dev->dma_mask)
> -		return 0;
> +		return false;
>  
>  	return addr + size - 1 <= *dev->dma_mask;
>  }
> diff --git a/arch/powerpc/include/asm/kvm_book3s_64.h b/arch/powerpc/include/asm/kvm_book3s_64.h
> index 2d81e20..2a244bf 100644
> --- a/arch/powerpc/include/asm/kvm_book3s_64.h
> +++ b/arch/powerpc/include/asm/kvm_book3s_64.h
> @@ -335,7 +335,7 @@ static inline bool hpte_read_permission(unsigned long pp, unsigned long key)
>  {
>  	if (key)
>  		return PP_RWRX <= pp && pp <= PP_RXRX;
> -	return 1;
> +	return true;
>  }
>  
>  static inline bool hpte_write_permission(unsigned long pp, unsigned long key)
> @@ -373,7 +373,7 @@ static inline bool slot_is_aligned(struct kvm_memory_slot *memslot,
>  	unsigned long mask = (pagesize >> PAGE_SHIFT) - 1;
>  
>  	if (pagesize <= PAGE_SIZE)
> -		return 1;
> +		return true;
>  	return !(memslot->base_gfn & mask) && !(memslot->npages & mask);
>  }
>  
> diff --git a/arch/powerpc/sysdev/dcr.c b/arch/powerpc/sysdev/dcr.c
> index 2d8a101..121e26f 100644
> --- a/arch/powerpc/sysdev/dcr.c
> +++ b/arch/powerpc/sysdev/dcr.c
> @@ -54,7 +54,7 @@ bool dcr_map_ok_generic(dcr_host_t host)
>  	else if (host.type == DCR_HOST_MMIO)
>  		return dcr_map_ok_mmio(host.host.mmio);
>  	else
> -		return 0;
> +		return false;
>  }
>  EXPORT_SYMBOL_GPL(dcr_map_ok_generic);
>  


_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

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

* Re: [PATCH 06/25] powerpc: Use bool function return values of true/false not 1/0
  2015-03-31  1:49   ` Benjamin Herrenschmidt
@ 2015-03-31  1:57     ` Joe Perches
  0 siblings, 0 replies; 12+ messages in thread
From: Joe Perches @ 2015-03-31  1:57 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: linux-kernel, Alexander Graf, Gleb Natapov, Paolo Bonzini,
	Paul Mackerras, Michael Ellerman, linuxppc-dev, kvm-ppc, kvm

On Tue, 2015-03-31 at 12:49 +1100, Benjamin Herrenschmidt wrote:
> On Mon, 2015-03-30 at 16:46 -0700, Joe Perches wrote:
> > Use the normal return values for bool functions
> 
> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> 
> Should we merge it or will you ?

Hey Ben.

I don't merge stuff.  I just send patches.
So, it'll be better if you do it.

I'll resend whatever doesn't get picked up in
the next couple months on to Andrew Morton.

cheers.  Joe

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

* Re: [PATCH 01/25] arm: Use bool function return values of true/false not 1/0
  2015-03-30 23:45 ` [PATCH 01/25] arm: " Joe Perches
@ 2015-03-31 15:54   ` Tony Lindgren
  2015-03-31 15:58   ` Paolo Bonzini
  1 sibling, 0 replies; 12+ messages in thread
From: Tony Lindgren @ 2015-03-31 15:54 UTC (permalink / raw)
  To: Joe Perches
  Cc: linux-kernel, Christoffer Dall, Marc Zyngier, Gleb Natapov,
	Paolo Bonzini, Russell King, linux-arm-kernel, kvmarm, kvm,
	linux-omap

* Joe Perches <joe@perches.com> [150330 16:47]:
> Use the normal return values for bool functions
> 
> Signed-off-by: Joe Perches <joe@perches.com>

Acked-by: Tony Lindgren <tony@atomide.com>

> ---
>  arch/arm/include/asm/dma-mapping.h |  8 ++++----
>  arch/arm/include/asm/kvm_emulate.h |  2 +-
>  arch/arm/mach-omap2/powerdomain.c  | 14 +++++++-------
>  3 files changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/arch/arm/include/asm/dma-mapping.h b/arch/arm/include/asm/dma-mapping.h
> index b52101d..166e1e1 100644
> --- a/arch/arm/include/asm/dma-mapping.h
> +++ b/arch/arm/include/asm/dma-mapping.h
> @@ -151,18 +151,18 @@ static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size)
>  	u64 limit, mask;
>  
>  	if (!dev->dma_mask)
> -		return 0;
> +		return false;
>  
>  	mask = *dev->dma_mask;
>  
>  	limit = (mask + 1) & ~mask;
>  	if (limit && size > limit)
> -		return 0;
> +		return false;
>  
>  	if ((addr | (addr + size - 1)) & ~mask)
> -		return 0;
> +		return false;
>  
> -	return 1;
> +	return true;
>  }
>  
>  static inline void dma_mark_clean(void *addr, size_t size) { }
> diff --git a/arch/arm/include/asm/kvm_emulate.h b/arch/arm/include/asm/kvm_emulate.h
> index a9c80a2..ad200a0 100644
> --- a/arch/arm/include/asm/kvm_emulate.h
> +++ b/arch/arm/include/asm/kvm_emulate.h
> @@ -51,7 +51,7 @@ static inline void vcpu_set_hcr(struct kvm_vcpu *vcpu, unsigned long hcr)
>  
>  static inline bool vcpu_mode_is_32bit(struct kvm_vcpu *vcpu)
>  {
> -	return 1;
> +	return true;
>  }
>  
>  static inline unsigned long *vcpu_pc(struct kvm_vcpu *vcpu)
> diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
> index 78af6d8..897f9fb 100644
> --- a/arch/arm/mach-omap2/powerdomain.c
> +++ b/arch/arm/mach-omap2/powerdomain.c
> @@ -950,7 +950,7 @@ int pwrdm_disable_hdwr_sar(struct powerdomain *pwrdm)
>   */
>  bool pwrdm_has_hdwr_sar(struct powerdomain *pwrdm)
>  {
> -	return (pwrdm && pwrdm->flags & PWRDM_HAS_HDWR_SAR) ? 1 : 0;
> +	return pwrdm && (pwrdm->flags & PWRDM_HAS_HDWR_SAR);
>  }
>  
>  int pwrdm_state_switch_nolock(struct powerdomain *pwrdm)
> @@ -1185,24 +1185,24 @@ bool pwrdm_can_ever_lose_context(struct powerdomain *pwrdm)
>  	if (!pwrdm) {
>  		pr_debug("powerdomain: %s: invalid powerdomain pointer\n",
>  			 __func__);
> -		return 1;
> +		return true;
>  	}
>  
>  	if (pwrdm->pwrsts & PWRSTS_OFF)
> -		return 1;
> +		return true;
>  
>  	if (pwrdm->pwrsts & PWRSTS_RET) {
>  		if (pwrdm->pwrsts_logic_ret & PWRSTS_OFF)
> -			return 1;
> +			return true;
>  
>  		for (i = 0; i < pwrdm->banks; i++)
>  			if (pwrdm->pwrsts_mem_ret[i] & PWRSTS_OFF)
> -				return 1;
> +				return true;
>  	}
>  
>  	for (i = 0; i < pwrdm->banks; i++)
>  		if (pwrdm->pwrsts_mem_on[i] & PWRSTS_OFF)
> -			return 1;
> +			return true;
>  
> -	return 0;
> +	return false;
>  }
> -- 
> 2.1.2
> 

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

* Re: [PATCH 01/25] arm: Use bool function return values of true/false not 1/0
  2015-03-30 23:45 ` [PATCH 01/25] arm: " Joe Perches
  2015-03-31 15:54   ` Tony Lindgren
@ 2015-03-31 15:58   ` Paolo Bonzini
  2015-03-31 16:05     ` Marc Zyngier
  1 sibling, 1 reply; 12+ messages in thread
From: Paolo Bonzini @ 2015-03-31 15:58 UTC (permalink / raw)
  To: Joe Perches, linux-kernel, Christoffer Dall, Marc Zyngier,
	Gleb Natapov, Tony Lindgren
  Cc: Russell King, linux-arm-kernel, kvmarm, kvm, linux-omap

On 31/03/2015 01:45, Joe Perches wrote:
> Use the normal return values for bool functions
> 
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  arch/arm/include/asm/dma-mapping.h |  8 ++++----
>  arch/arm/include/asm/kvm_emulate.h |  2 +-
>  arch/arm/mach-omap2/powerdomain.c  | 14 +++++++-------
>  3 files changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/arch/arm/include/asm/dma-mapping.h b/arch/arm/include/asm/dma-mapping.h
> index b52101d..166e1e1 100644
> --- a/arch/arm/include/asm/dma-mapping.h
> +++ b/arch/arm/include/asm/dma-mapping.h
> @@ -151,18 +151,18 @@ static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size)
>  	u64 limit, mask;
>  
>  	if (!dev->dma_mask)
> -		return 0;
> +		return false;
>  
>  	mask = *dev->dma_mask;
>  
>  	limit = (mask + 1) & ~mask;
>  	if (limit && size > limit)
> -		return 0;
> +		return false;
>  
>  	if ((addr | (addr + size - 1)) & ~mask)
> -		return 0;
> +		return false;
>  
> -	return 1;
> +	return true;
>  }
>  
>  static inline void dma_mark_clean(void *addr, size_t size) { }
> diff --git a/arch/arm/include/asm/kvm_emulate.h b/arch/arm/include/asm/kvm_emulate.h
> index a9c80a2..ad200a0 100644
> --- a/arch/arm/include/asm/kvm_emulate.h
> +++ b/arch/arm/include/asm/kvm_emulate.h
> @@ -51,7 +51,7 @@ static inline void vcpu_set_hcr(struct kvm_vcpu *vcpu, unsigned long hcr)
>  
>  static inline bool vcpu_mode_is_32bit(struct kvm_vcpu *vcpu)
>  {
> -	return 1;
> +	return true;
>  }
>  
>  static inline unsigned long *vcpu_pc(struct kvm_vcpu *vcpu)
> diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
> index 78af6d8..897f9fb 100644
> --- a/arch/arm/mach-omap2/powerdomain.c
> +++ b/arch/arm/mach-omap2/powerdomain.c
> @@ -950,7 +950,7 @@ int pwrdm_disable_hdwr_sar(struct powerdomain *pwrdm)
>   */
>  bool pwrdm_has_hdwr_sar(struct powerdomain *pwrdm)
>  {
> -	return (pwrdm && pwrdm->flags & PWRDM_HAS_HDWR_SAR) ? 1 : 0;
> +	return pwrdm && (pwrdm->flags & PWRDM_HAS_HDWR_SAR);
>  }
>  
>  int pwrdm_state_switch_nolock(struct powerdomain *pwrdm)
> @@ -1185,24 +1185,24 @@ bool pwrdm_can_ever_lose_context(struct powerdomain *pwrdm)
>  	if (!pwrdm) {
>  		pr_debug("powerdomain: %s: invalid powerdomain pointer\n",
>  			 __func__);
> -		return 1;
> +		return true;
>  	}
>  
>  	if (pwrdm->pwrsts & PWRSTS_OFF)
> -		return 1;
> +		return true;
>  
>  	if (pwrdm->pwrsts & PWRSTS_RET) {
>  		if (pwrdm->pwrsts_logic_ret & PWRSTS_OFF)
> -			return 1;
> +			return true;
>  
>  		for (i = 0; i < pwrdm->banks; i++)
>  			if (pwrdm->pwrsts_mem_ret[i] & PWRSTS_OFF)
> -				return 1;
> +				return true;
>  	}
>  
>  	for (i = 0; i < pwrdm->banks; i++)
>  		if (pwrdm->pwrsts_mem_on[i] & PWRSTS_OFF)
> -			return 1;
> +			return true;
>  
> -	return 0;
> +	return false;
>  }
> 

Marc/Christoffer, please pick this up yourself.

Paolo

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

* Re: [PATCH 01/25] arm: Use bool function return values of true/false not 1/0
  2015-03-31 15:58   ` Paolo Bonzini
@ 2015-03-31 16:05     ` Marc Zyngier
  0 siblings, 0 replies; 12+ messages in thread
From: Marc Zyngier @ 2015-03-31 16:05 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Russell King, kvm@vger.kernel.org, Gleb Natapov,
	linux-kernel@vger.kernel.org, Tony Lindgren,
	linux-arm-kernel@lists.infradead.org, Joe Perches,
	linux-omap@vger.kernel.org, kvmarm@lists.cs.columbia.edu

On Tue, 31 Mar 2015 16:58:28 +0100
Paolo Bonzini <pbonzini@redhat.com> wrote:

> On 31/03/2015 01:45, Joe Perches wrote:
> > Use the normal return values for bool functions
> > 
> > Signed-off-by: Joe Perches <joe@perches.com>
> > ---
> >  arch/arm/include/asm/dma-mapping.h |  8 ++++----
> >  arch/arm/include/asm/kvm_emulate.h |  2 +-
> >  arch/arm/mach-omap2/powerdomain.c  | 14 +++++++-------
> >  3 files changed, 12 insertions(+), 12 deletions(-)
> > 
> > diff --git a/arch/arm/include/asm/dma-mapping.h b/arch/arm/include/asm/dma-mapping.h
> > index b52101d..166e1e1 100644
> > --- a/arch/arm/include/asm/dma-mapping.h
> > +++ b/arch/arm/include/asm/dma-mapping.h
> > @@ -151,18 +151,18 @@ static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size)
> >  	u64 limit, mask;
> >  
> >  	if (!dev->dma_mask)
> > -		return 0;
> > +		return false;
> >  
> >  	mask = *dev->dma_mask;
> >  
> >  	limit = (mask + 1) & ~mask;
> >  	if (limit && size > limit)
> > -		return 0;
> > +		return false;
> >  
> >  	if ((addr | (addr + size - 1)) & ~mask)
> > -		return 0;
> > +		return false;
> >  
> > -	return 1;
> > +	return true;
> >  }
> >  
> >  static inline void dma_mark_clean(void *addr, size_t size) { }
> > diff --git a/arch/arm/include/asm/kvm_emulate.h b/arch/arm/include/asm/kvm_emulate.h
> > index a9c80a2..ad200a0 100644
> > --- a/arch/arm/include/asm/kvm_emulate.h
> > +++ b/arch/arm/include/asm/kvm_emulate.h
> > @@ -51,7 +51,7 @@ static inline void vcpu_set_hcr(struct kvm_vcpu *vcpu, unsigned long hcr)
> >  
> >  static inline bool vcpu_mode_is_32bit(struct kvm_vcpu *vcpu)
> >  {
> > -	return 1;
> > +	return true;
> >  }
> >  
> >  static inline unsigned long *vcpu_pc(struct kvm_vcpu *vcpu)
> > diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
> > index 78af6d8..897f9fb 100644
> > --- a/arch/arm/mach-omap2/powerdomain.c
> > +++ b/arch/arm/mach-omap2/powerdomain.c
> > @@ -950,7 +950,7 @@ int pwrdm_disable_hdwr_sar(struct powerdomain *pwrdm)
> >   */
> >  bool pwrdm_has_hdwr_sar(struct powerdomain *pwrdm)
> >  {
> > -	return (pwrdm && pwrdm->flags & PWRDM_HAS_HDWR_SAR) ? 1 : 0;
> > +	return pwrdm && (pwrdm->flags & PWRDM_HAS_HDWR_SAR);
> >  }
> >  
> >  int pwrdm_state_switch_nolock(struct powerdomain *pwrdm)
> > @@ -1185,24 +1185,24 @@ bool pwrdm_can_ever_lose_context(struct powerdomain *pwrdm)
> >  	if (!pwrdm) {
> >  		pr_debug("powerdomain: %s: invalid powerdomain pointer\n",
> >  			 __func__);
> > -		return 1;
> > +		return true;
> >  	}
> >  
> >  	if (pwrdm->pwrsts & PWRSTS_OFF)
> > -		return 1;
> > +		return true;
> >  
> >  	if (pwrdm->pwrsts & PWRSTS_RET) {
> >  		if (pwrdm->pwrsts_logic_ret & PWRSTS_OFF)
> > -			return 1;
> > +			return true;
> >  
> >  		for (i = 0; i < pwrdm->banks; i++)
> >  			if (pwrdm->pwrsts_mem_ret[i] & PWRSTS_OFF)
> > -				return 1;
> > +				return true;
> >  	}
> >  
> >  	for (i = 0; i < pwrdm->banks; i++)
> >  		if (pwrdm->pwrsts_mem_on[i] & PWRSTS_OFF)
> > -			return 1;
> > +			return true;
> >  
> > -	return 0;
> > +	return false;
> >  }
> > 
> 
> Marc/Christoffer, please pick this up yourself.

Given that it touches a range of completely unrelated files, for the
KVM part:

Acked-by: Marc Zyngier <marc.zyngier@arm.com>

	M.
-- 
Jazz is not dead. It just smells funny.

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

* Re: [PATCH 11/25] x86: Use bool function return values of true/false not 1/0
  2015-03-30 23:46 ` [PATCH 11/25] x86: " Joe Perches
@ 2015-03-31 16:05   ` Paolo Bonzini
  0 siblings, 0 replies; 12+ messages in thread
From: Paolo Bonzini @ 2015-03-31 16:05 UTC (permalink / raw)
  To: Joe Perches, linux-kernel, Gleb Natapov
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, kvm



On 31/03/2015 01:46, Joe Perches wrote:
> Use the normal return values for bool functions
> 
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  arch/x86/include/asm/archrandom.h  |  2 +-
>  arch/x86/include/asm/dma-mapping.h |  2 +-
>  arch/x86/include/asm/kvm_para.h    |  2 +-
>  arch/x86/kvm/cpuid.h               |  2 +-
>  arch/x86/kvm/vmx.c                 | 72 +++++++++++++++++++-------------------
>  5 files changed, 40 insertions(+), 40 deletions(-)

Applied arch/x86/include/asm/kvm_para.h and arch/x86/kvm/* parts, thanks.

Paolo

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

end of thread, other threads:[~2015-03-31 16:05 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-30 23:45 [PATCH 00/25] treewide: Use bool function return values of true/false not 1/0 Joe Perches
2015-03-30 23:45 ` [PATCH 01/25] arm: " Joe Perches
2015-03-31 15:54   ` Tony Lindgren
2015-03-31 15:58   ` Paolo Bonzini
2015-03-31 16:05     ` Marc Zyngier
2015-03-30 23:46 ` [PATCH 06/25] powerpc: " Joe Perches
2015-03-31  1:49   ` Benjamin Herrenschmidt
2015-03-31  1:57     ` Joe Perches
2015-03-30 23:46 ` [PATCH 11/25] x86: " Joe Perches
2015-03-31 16:05   ` Paolo Bonzini
2015-03-31  0:07 ` [PATCH 00/25] treewide: " Casey Schaufler
2015-03-31  0:14   ` Joe Perches

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