Skip to contentSkip to conversation

treewide: Use bool function return values of true/false not 1/0

PATCH Applied Joe Perches 27 participants 74 messages Mar 30, 2015 – Apr 13, 2015

Subsystems (44)
lore
Share & tools
lore
#0 lore raw

cover treewide: Use bool function return values of true/false not 1/0

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(-)
Signature · 7 lines
2.1.2

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
#1 lore raw

PATCH 1/25 arm: Use bool function return values of true/false not 1/0

Use the normal return values for bool functions

---
 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(-)
arch/arm/include/asm/dma-mapping.h +4 -4
index b52101d..166e1e1 100644
@@ -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) { }
arch/arm/include/asm/kvm_emulate.h +1 -1
index a9c80a2..ad200a0 100644
@@ -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)
arch/arm/mach-omap2/powerdomain.c +7 -7
index 78af6d8..897f9fb 100644
@@ -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;
 }
Signature · 1 line
2.1.2
#5 lore raw

PATCH 2/25 arm64: Use bool function return values of true/false not 1/0

In reply to Joe Perches

Use the normal return values for bool functions

---
 arch/arm64/include/asm/dma-mapping.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/include/asm/dma-mapping.h +1 -1
index 6932bb5..9437e3d 100644
@@ -97,7 +97,7 @@ static inline int dma_set_mask(struct device *dev, u64 mask)
 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;
 }
Signature · 1 line
2.1.2
#7 lore raw

PATCH 3/25 hexagon: Use bool function return values of true/false not 1/0

In reply to Joe Perches

Use the normal return values for bool functions

---
 arch/hexagon/include/asm/dma-mapping.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/hexagon/include/asm/dma-mapping.h +1 -1
index 1696542..8d22ba5 100644
@@ -56,7 +56,7 @@ extern void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
 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;
 }
 
Signature · 1 line
2.1.2
#8 lore raw

PATCH 4/25 ia64: Use bool function return values of true/false not 1/0

In reply to Joe Perches

Use the normal return values for bool functions

---
 arch/ia64/include/asm/dma-mapping.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/ia64/include/asm/dma-mapping.h +1 -1
index cf3ab7e..1b0b192 100644
@@ -80,7 +80,7 @@ dma_set_mask (struct device *dev, u64 mask)
 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;
 }
Signature · 1 line
2.1.2
#10 lore raw

PATCH 6/25 powerpc: Use bool function return values of true/false not 1/0

In reply to Joe Perches

Use the normal return values for bool functions

---
 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(-)
arch/powerpc/include/asm/dcr-native.h +1 -1
index 7d2e623..4efc11d 100644
@@ -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) \
arch/powerpc/include/asm/dma-mapping.h +2 -2
index 894d538..9103687 100644
@@ -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;
 }
arch/powerpc/include/asm/kvm_book3s_64.h +2 -2
index 2d81e20..2a244bf 100644
@@ -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);
 }
 
arch/powerpc/sysdev/dcr.c +1 -1
index 2d8a101..121e26f 100644
@@ -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);
 
Signature · 1 line
2.1.2
#13 lore raw

PATCH 7/25 s390: Use bool function return values of true/false not 1/0

In reply to Joe Perches

Use the normal return values for bool functions

---
 arch/s390/include/asm/dma-mapping.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/s390/include/asm/dma-mapping.h +1 -1
index 709955d..9d39596 100644
@@ -42,7 +42,7 @@ static inline int dma_supported(struct device *dev, u64 mask)
 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;
 }
 
Signature · 1 line
2.1.2
#15 lore raw

PATCH 8/25 sparc: Use bool function return values of true/false not 1/0

In reply to Joe Perches

Use the normal return values for bool functions

---
 arch/sparc/mm/init_64.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
arch/sparc/mm/init_64.c +4 -4
index 4ca0d6b..f7c4832 100644
@@ -1389,25 +1389,25 @@ bool kern_addr_valid(unsigned long addr)
 
 	pgd = pgd_offset_k(addr);
 	if (pgd_none(*pgd))
-		return 0;
+		return false;
 
 	pud = pud_offset(pgd, addr);
 	if (pud_none(*pud))
-		return 0;
+		return false;
 
 	if (pud_large(*pud))
 		return pfn_valid(pud_pfn(*pud));
 
 	pmd = pmd_offset(pud, addr);
 	if (pmd_none(*pmd))
-		return 0;
+		return false;
 
 	if (pmd_large(*pmd))
 		return pfn_valid(pmd_pfn(*pmd));
 
 	pte = pte_offset_kernel(pmd, addr);
 	if (pte_none(*pte))
-		return 0;
+		return false;
 
 	return pfn_valid(pte_pfn(*pte));
 }
Signature · 1 line
2.1.2
#18 lore raw

PATCH 11/25 x86: Use bool function return values of true/false not 1/0

In reply to Joe Perches

Use the normal return values for bool functions

---
 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(-)
arch/x86/include/asm/archrandom.h +1 -1
index 69f1366..7abcd71 100644
@@ -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 */
arch/x86/include/asm/dma-mapping.h +1 -1
index 808dae6..efac032 100644
@@ -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;
 }
arch/x86/include/asm/kvm_para.h +1 -1
index e62cf89..c1adf33 100644
@@ -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)
arch/x86/kvm/cpuid.h +1 -1
index 4452eed..2622846 100644
@@ -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));
arch/x86/kvm/vmx.c +36 -36

228 lines not on this page · raw message

Signature · 1 line
2.1.2
#20 lore raw

PATCH 12/25 virtio_console: Use bool function return values of true/false not 1/0

In reply to Joe Perches

Use the normal return values for bool functions

---
 drivers/char/virtio_console.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/virtio_console.c +1 -1
index 72d7028..50754d20 100644
@@ -355,7 +355,7 @@ static inline bool use_multiport(struct ports_device *portdev)
 	 * early_init
 	 */
 	if (!portdev->vdev)
-		return 0;
+		return false;
 	return __virtio_test_bit(portdev->vdev, VIRTIO_CONSOLE_F_MULTIPORT);
 }
 
Signature · 1 line
2.1.2
#23 lore raw

PATCH 13/25 csiostor: Use bool function return values of true/false not 1/0

In reply to Joe Perches

Use the normal return values for bool functions

---
 drivers/scsi/csiostor/csio_scsi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/csiostor/csio_scsi.c +2 -2
index 2c4562d..5754fb6 100644
@@ -147,9 +147,9 @@ csio_scsi_itnexus_loss_error(uint16_t error)
 	case FW_ERR_RDEV_LOST:
 	case FW_ERR_RDEV_LOGO:
 	case FW_ERR_RDEV_IMPL_LOGO:
-		return 1;
+		return true;
 	}
-	return 0;
+	return false;
 }
 
 /*
Signature · 1 line
2.1.2
#24 lore raw

PATCH 14/25 dcache: Use bool function return values of true/false not 1/0

In reply to Joe Perches

Use the normal return values for bool functions

---
 fs/dcache.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
fs/dcache.c +6 -6
index d99736a..44b19a4 100644
@@ -629,16 +629,16 @@ static inline bool fast_dput(struct dentry *dentry)
 		if (dentry->d_lockref.count > 1) {
 			dentry->d_lockref.count--;
 			spin_unlock(&dentry->d_lock);
-			return 1;
+			return true;
 		}
-		return 0;
+		return false;
 	}
 
 	/*
 	 * If we weren't the last ref, we're done.
 	 */
 	if (ret)
-		return 1;
+		return true;
 
 	/*
 	 * Careful, careful. The reference count went down
@@ -667,7 +667,7 @@ static inline bool fast_dput(struct dentry *dentry)
 
 	/* Nothing to do? Dropping the reference was all we needed? */
 	if (d_flags == (DCACHE_REFERENCED | DCACHE_LRU_LIST) && !d_unhashed(dentry))
-		return 1;
+		return true;
 
 	/*
 	 * Not the fast normal case? Get the lock. We've already decremented
@@ -684,7 +684,7 @@ static inline bool fast_dput(struct dentry *dentry)
 	 */
 	if (dentry->d_lockref.count) {
 		spin_unlock(&dentry->d_lock);
-		return 1;
+		return true;
 	}
 
 	/*
@@ -693,7 +693,7 @@ static inline bool fast_dput(struct dentry *dentry)
 	 * set it to 1.
 	 */
 	dentry->d_lockref.count = 1;
-	return 0;
+	return false;
 }
 
 
Signature · 1 line
2.1.2
#26 lore raw

PATCH 16/25 include/linux: Use bool function return values of true/false not 1/0

In reply to Joe Perches

Use the normal return values for bool functions

---
 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 ++++++++--------
 8 files changed, 18 insertions(+), 18 deletions(-)
include/linux/blkdev.h +1 -1
index 5d93a66..eced869 100644
@@ -1591,7 +1591,7 @@ static inline bool blk_integrity_merge_bio(struct request_queue *rq,
 }
 static inline bool blk_integrity_is_initialized(struct gendisk *g)
 {
-	return 0;
+	return false;
 }
 
 #endif /* CONFIG_BLK_DEV_INTEGRITY */
include/linux/ide.h +1 -1
index 93b5ca7..1ba07db 100644
@@ -1411,7 +1411,7 @@ void ide_acpi_port_init_devices(ide_hwif_t *);
 extern void ide_acpi_set_state(ide_hwif_t *hwif, int on);
 #else
 static inline int ide_acpi_init(void) { return 0; }
-static inline bool ide_port_acpi(ide_hwif_t *hwif) { return 0; }
+static inline bool ide_port_acpi(ide_hwif_t *hwif) { return false; }
 static inline int ide_acpi_exec_tfs(ide_drive_t *drive) { return 0; }
 static inline void ide_acpi_get_timing(ide_hwif_t *hwif) { ; }
 static inline void ide_acpi_push_timing(ide_hwif_t *hwif) { ; }
include/linux/kgdb.h +1 -1
index e465bb1..840f494 100644
@@ -292,7 +292,7 @@ extern bool kgdb_nmi_poll_knock(void);
 #else
 static inline int kgdb_register_nmi_console(void) { return 0; }
 static inline int kgdb_unregister_nmi_console(void) { return 0; }
-static inline bool kgdb_nmi_poll_knock(void) { return 1; }
+static inline bool kgdb_nmi_poll_knock(void) { return true; }
 #endif
 
 extern int kgdb_register_io_module(struct kgdb_io *local_kgdb_io_ops);
include/linux/mfd/db8500-prcmu.h +1 -1
index 0bd6944..3b06175 100644
@@ -744,7 +744,7 @@ static inline int db8500_prcmu_load_a9wdog(u8 id, u32 val)
 
 static inline bool db8500_prcmu_is_ac_wake_requested(void)
 {
-	return 0;
+	return false;
 }
 
 static inline int db8500_prcmu_set_arm_opp(u8 opp)
include/linux/mm.h +1 -1
index 4a3a385..164108c 100644
@@ -819,7 +819,7 @@ static inline int cpu_pid_to_cpupid(int nid, int pid)
 
 static inline bool cpupid_pid_unset(int cpupid)
 {
-	return 1;
+	return true;
 }
 
 static inline void page_cpupid_reset_last(struct page *page)
include/linux/power_supply.h +4 -4
index 75a1dd8..b0b45c7 100644
@@ -350,12 +350,12 @@ static inline bool power_supply_is_amp_property(enum power_supply_property psp)
 	case POWER_SUPPLY_PROP_CURRENT_NOW:
 	case POWER_SUPPLY_PROP_CURRENT_AVG:
 	case POWER_SUPPLY_PROP_CURRENT_BOOT:
-		return 1;
+		return true;
 	default:
 		break;
 	}
 
-	return 0;
+	return false;
 }
 
 static inline bool power_supply_is_watt_property(enum power_supply_property psp)
@@ -378,12 +378,12 @@ static inline bool power_supply_is_watt_property(enum power_supply_property psp)
 	case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE:
 	case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX:
 	case POWER_SUPPLY_PROP_POWER_NOW:
-		return 1;
+		return true;
 	default:
 		break;
 	}
 
-	return 0;
+	return false;
 }
 
 #endif /* __LINUX_POWER_SUPPLY_H__ */
include/linux/ssb/ssb_driver_extif.h +1 -1
index a410e84..5766b6f 100644
@@ -198,7 +198,7 @@ struct ssb_extif {
 
 static inline bool ssb_extif_available(struct ssb_extif *extif)
 {
-	return 0;
+	return false;
 }
 
 static inline
include/linux/ssb/ssb_driver_gige.h +8 -8
index 0688472..65f7740 100644
@@ -75,7 +75,7 @@ static inline bool ssb_gige_have_roboswitch(struct pci_dev *pdev)
 	if (dev)
 		return !!(dev->dev->bus->sprom.boardflags_lo &
 			  SSB_GIGE_BFL_ROBOSWITCH);
-	return 0;
+	return false;
 }
 
 /* Returns whether we can only do one DMA at once. */
@@ -85,7 +85,7 @@ static inline bool ssb_gige_one_dma_at_once(struct pci_dev *pdev)
 	if (dev)
 		return ((dev->dev->bus->chip_id == 0x4785) &&
 			(dev->dev->bus->chip_rev < 2));
-	return 0;
+	return false;
 }
 
 /* Returns whether we must flush posted writes. */
@@ -94,7 +94,7 @@ static inline bool ssb_gige_must_flush_posted_writes(struct pci_dev *pdev)
 	struct ssb_gige *dev = pdev_to_ssb_gige(pdev);
 	if (dev)
 		return (dev->dev->bus->chip_id == 0x4785);
-	return 0;
+	return false;
 }
 
 /* Get the device MAC address */
@@ -158,7 +158,7 @@ static inline void ssb_gige_exit(void)
 
 static inline bool pdev_is_ssb_gige_core(struct pci_dev *pdev)
 {
-	return 0;
+	return false;
 }
 static inline struct ssb_gige * pdev_to_ssb_gige(struct pci_dev *pdev)
 {
@@ -166,19 +166,19 @@ static inline struct ssb_gige * pdev_to_ssb_gige(struct pci_dev *pdev)
 }
 static inline bool ssb_gige_is_rgmii(struct pci_dev *pdev)
 {
-	return 0;
+	return false;
 }
 static inline bool ssb_gige_have_roboswitch(struct pci_dev *pdev)
 {
-	return 0;
+	return false;
 }
 static inline bool ssb_gige_one_dma_at_once(struct pci_dev *pdev)
 {
-	return 0;
+	return false;
 }
 static inline bool ssb_gige_must_flush_posted_writes(struct pci_dev *pdev)
 {
-	return 0;
+	return false;
 }
 static inline int ssb_gige_get_macaddr(struct pci_dev *pdev, u8 *macaddr)
 {
Signature · 7 lines
2.1.2

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
#29 lore raw

PATCH 17/25 sound: Use bool function return values of true/false not 1/0

In reply to Joe Perches

Use the normal return values for bool functions

---
 include/sound/soc.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/sound/soc.h +2 -2
index fcb312b..5ca7ec0 100644
@@ -1418,13 +1418,13 @@ static inline void snd_soc_initialize_card_lists(struct snd_soc_card *card)
 static inline bool snd_soc_volsw_is_stereo(struct soc_mixer_control *mc)
 {
 	if (mc->reg == mc->rreg && mc->shift == mc->rshift)
-		return 0;
+		return false;
 	/*
 	 * mc->reg == mc->rreg && mc->shift != mc->rshift, or
 	 * mc->reg != mc->rreg means that the control is
 	 * stereo (bits in one register or in two registers)
 	 */
-	return 1;
+	return true;
 }
 
 static inline unsigned int snd_soc_enum_val_to_item(struct soc_enum *e,
Signature · 1 line
2.1.2
#63 lore raw

PATCH 22/25 bridge: Use bool function return values of true/false not 1/0

In reply to Joe Perches

Use the normal return values for bool functions

---
 net/bridge/br_private.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/bridge/br_private.h +1 -1
index b46fa0c..5aba35e 100644
@@ -574,7 +574,7 @@ static inline void br_multicast_forward(struct net_bridge_mdb_entry *mdst,
 }
 static inline bool br_multicast_is_router(struct net_bridge *br)
 {
-	return 0;
+	return false;
 }
 static inline bool br_multicast_querier_exists(struct net_bridge *br,
 					       struct ethhdr *eth)
Signature · 1 line
2.1.2
#64 lore raw

PATCH 23/25 netfilter: Use bool function return values of true/false not 1/0

In reply to Joe Perches

Use the normal return values for bool functions

---
 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 +-
 13 files changed, 40 insertions(+), 40 deletions(-)
net/ipv4/netfilter/ipt_ah.c +1 -1
index 14a2aa8..756c004 100644
@@ -47,7 +47,7 @@ static bool ah_mt(const struct sk_buff *skb, struct xt_action_param *par)
 		 */
 		pr_debug("Dropping evil AH tinygram.\n");
 		par->hotdrop = true;
-		return 0;
+		return false;
 	}
 
 	return spi_match(ahinfo->spis[0], ahinfo->spis[1],
net/netfilter/ipset/ip_set_hash_ip.c +4 -4
index 76959d7..a7d6262 100644
@@ -61,10 +61,10 @@ hash_ip4_data_list(struct sk_buff *skb, const struct hash_ip4_elem *e)
 {
 	if (nla_put_ipaddr4(skb, IPSET_ATTR_IP, e->ip))
 		goto nla_put_failure;
-	return 0;
+	return false;
 
 nla_put_failure:
-	return 1;
+	return true;
 }
 
 static inline void
@@ -196,10 +196,10 @@ hash_ip6_data_list(struct sk_buff *skb, const struct hash_ip6_elem *e)
 {
 	if (nla_put_ipaddr6(skb, IPSET_ATTR_IP, &e->ip.in6))
 		goto nla_put_failure;
-	return 0;
+	return false;
 
 nla_put_failure:
-	return 1;
+	return true;
 }
 
 static inline void
net/netfilter/ipset/ip_set_hash_ipmark.c +4 -4
index 7abf978..327b331 100644
@@ -63,10 +63,10 @@ hash_ipmark4_data_list(struct sk_buff *skb,
 	if (nla_put_ipaddr4(skb, IPSET_ATTR_IP, data->ip) ||
 	    nla_put_net32(skb, IPSET_ATTR_MARK, htonl(data->mark)))
 		goto nla_put_failure;
-	return 0;
+	return false;
 
 nla_put_failure:
-	return 1;
+	return true;
 }
 
 static inline void
@@ -191,10 +191,10 @@ hash_ipmark6_data_list(struct sk_buff *skb,
 	if (nla_put_ipaddr6(skb, IPSET_ATTR_IP, &data->ip.in6) ||
 	    nla_put_net32(skb, IPSET_ATTR_MARK, htonl(data->mark)))
 		goto nla_put_failure;
-	return 0;
+	return false;
 
 nla_put_failure:
-	return 1;
+	return true;
 }
 
 static inline void
net/netfilter/ipset/ip_set_hash_ipport.c +4 -4
index dcbcceb..b4748e9 100644
@@ -69,10 +69,10 @@ hash_ipport4_data_list(struct sk_buff *skb,
 	    nla_put_net16(skb, IPSET_ATTR_PORT, data->port) ||
 	    nla_put_u8(skb, IPSET_ATTR_PROTO, data->proto))
 		goto nla_put_failure;
-	return 0;
+	return false;
 
 nla_put_failure:
-	return 1;
+	return true;
 }
 
 static inline void
@@ -231,10 +231,10 @@ hash_ipport6_data_list(struct sk_buff *skb,
 	    nla_put_net16(skb, IPSET_ATTR_PORT, data->port) ||
 	    nla_put_u8(skb, IPSET_ATTR_PROTO, data->proto))
 		goto nla_put_failure;
-	return 0;
+	return false;
 
 nla_put_failure:
-	return 1;
+	return true;
 }
 
 static inline void
net/netfilter/ipset/ip_set_hash_ipportip.c +4 -4
index 7ef93fc..607461b 100644
@@ -70,10 +70,10 @@ hash_ipportip4_data_list(struct sk_buff *skb,
 	    nla_put_net16(skb, IPSET_ATTR_PORT, data->port) ||
 	    nla_put_u8(skb, IPSET_ATTR_PROTO, data->proto))
 		goto nla_put_failure;
-	return 0;
+	return false;
 
 nla_put_failure:
-	return 1;
+	return true;
 }
 
 static inline void
@@ -240,10 +240,10 @@ hash_ipportip6_data_list(struct sk_buff *skb,
 	    nla_put_net16(skb, IPSET_ATTR_PORT, data->port) ||
 	    nla_put_u8(skb, IPSET_ATTR_PROTO, data->proto))
 		goto nla_put_failure;
-	return 0;
+	return false;
 
 nla_put_failure:
-	return 1;
+	return true;
 }
 
 static inline void
net/netfilter/ipset/ip_set_hash_ipportnet.c +4 -4
index b6012ad..f607ec9 100644
@@ -114,10 +114,10 @@ hash_ipportnet4_data_list(struct sk_buff *skb,
 	    (flags &&
 	     nla_put_net32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags))))
 		goto nla_put_failure;
-	return 0;
+	return false;
 
 nla_put_failure:
-	return 1;
+	return true;
 }
 
 static inline void
@@ -367,10 +367,10 @@ hash_ipportnet6_data_list(struct sk_buff *skb,
 	    (flags &&
 	     nla_put_net32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags))))
 		goto nla_put_failure;
-	return 0;
+	return false;
 
 nla_put_failure:
-	return 1;
+	return true;
 }
 
 static inline void
net/netfilter/ipset/ip_set_hash_net.c +4 -4
index 6b3ac10..8bb8cd4 100644
@@ -95,10 +95,10 @@ hash_net4_data_list(struct sk_buff *skb, const struct hash_net4_elem *data)
 	    (flags &&
 	     nla_put_net32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags))))
 		goto nla_put_failure;
-	return 0;
+	return false;
 
 nla_put_failure:
-	return 1;
+	return true;
 }
 
 static inline void
@@ -264,10 +264,10 @@ hash_net6_data_list(struct sk_buff *skb, const struct hash_net6_elem *data)
 	    (flags &&
 	     nla_put_net32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags))))
 		goto nla_put_failure;
-	return 0;
+	return false;
 
 nla_put_failure:
-	return 1;
+	return true;
 }
 
 static inline void
net/netfilter/ipset/ip_set_hash_netiface.c +4 -4
index 758b002..5a37ede 100644
@@ -192,10 +192,10 @@ hash_netiface4_data_list(struct sk_buff *skb,
 	    (flags &&
 	     nla_put_net32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags))))
 		goto nla_put_failure;
-	return 0;
+	return false;
 
 nla_put_failure:
-	return 1;
+	return true;
 }
 
 static inline void
@@ -428,10 +428,10 @@ hash_netiface6_data_list(struct sk_buff *skb,
 	    (flags &&
 	     nla_put_net32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags))))
 		goto nla_put_failure;
-	return 0;
+	return false;
 
 nla_put_failure:
-	return 1;
+	return true;
 }
 
 static inline void
net/netfilter/ipset/ip_set_hash_netport.c +4 -4
index c0ddb58..65abe45 100644
@@ -110,10 +110,10 @@ hash_netport4_data_list(struct sk_buff *skb,
 	    (flags &&
 	     nla_put_net32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags))))
 		goto nla_put_failure;
-	return 0;
+	return false;
 
 nla_put_failure:
-	return 1;
+	return true;
 }
 
 static inline void
@@ -326,10 +326,10 @@ hash_netport6_data_list(struct sk_buff *skb,
 	    (flags &&
 	     nla_put_net32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags))))
 		goto nla_put_failure;
-	return 0;
+	return false;
 
 nla_put_failure:
-	return 1;
+	return true;
 }
 
 static inline void
net/netfilter/ipset/ip_set_hash_netportnet.c +4 -4
index bfaa94c..8c80e84 100644
@@ -124,10 +124,10 @@ hash_netportnet4_data_list(struct sk_buff *skb,
 	    (flags &&
 	     nla_put_net32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags))))
 		goto nla_put_failure;
-	return 0;
+	return false;
 
 nla_put_failure:
-	return 1;
+	return true;
 }
 
 static inline void
@@ -397,10 +397,10 @@ hash_netportnet6_data_list(struct sk_buff *skb,
 	    (flags &&
 	     nla_put_net32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags))))
 		goto nla_put_failure;
-	return 0;
+	return false;
 
 nla_put_failure:
-	return 1;
+	return true;
 }
 
 static inline void
net/netfilter/xt_connlimit.c +1 -1
index 29ba621..548537c 100644
@@ -92,7 +92,7 @@ static inline bool already_closed(const struct nf_conn *conn)
 		return conn->proto.tcp.state == TCP_CONNTRACK_TIME_WAIT ||
 		       conn->proto.tcp.state == TCP_CONNTRACK_CLOSE;
 	else
-		return 0;
+		return false;
 }
 
 static int
net/netfilter/xt_hashlimit.c +1 -1
index 1786968..09c3446 100644
@@ -285,7 +285,7 @@ static int htable_create(struct net *net, struct xt_hashlimit_mtinfo1 *minfo,
 static bool select_all(const struct xt_hashlimit_htable *ht,
 		       const struct dsthash_ent *he)
 {
-	return 1;
+	return true;
 }
 
 static bool select_gc(const struct xt_hashlimit_htable *ht,
net/netfilter/xt_ipcomp.c +1 -1
index 89d5310..85b6a9d 100644
@@ -56,7 +56,7 @@ static bool comp_mt(const struct sk_buff *skb, struct xt_action_param *par)
 		 */
 		pr_debug("Dropping evil IPComp tinygram.\n");
 		par->hotdrop = true;
-		return 0;
+		return false;
 	}
 
 	return spi_match(compinfo->spis[0], compinfo->spis[1],
Signature · 1 line
2.1.2
#68 lore raw

PATCH 25/25 sound: wm5100-tables: Use bool function return values of true/false not 1/0

In reply to Joe Perches

Use the normal return values for bool functions

---
 sound/soc/codecs/wm5100-tables.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
sound/soc/codecs/wm5100-tables.c +6 -6
index e239f4b..9e987cf 100644
@@ -30,7 +30,7 @@ bool wm5100_volatile_register(struct device *dev, unsigned int reg)
 	case WM5100_OUTPUT_STATUS_2:
 	case WM5100_INPUT_ENABLES_STATUS:
 	case WM5100_MIC_DETECT_3:
-		return 1;
+		return true;
 	default:
 		if ((reg >= WM5100_DSP1_PM_0 && reg <= WM5100_DSP1_PM_1535) ||
 		    (reg >= WM5100_DSP1_ZM_0 && reg <= WM5100_DSP1_ZM_2047) ||
@@ -41,9 +41,9 @@ bool wm5100_volatile_register(struct device *dev, unsigned int reg)
 		    (reg >= WM5100_DSP3_PM_0 && reg <= WM5100_DSP3_PM_1535) ||
 		    (reg >= WM5100_DSP3_ZM_0 && reg <= WM5100_DSP3_ZM_2047) ||
 		    (reg >= WM5100_DSP3_DM_0 && reg <= WM5100_DSP3_DM_511))
-			return 1;
+			return true;
 		else
-			return 0;
+			return false;
 	}
 }
 
@@ -798,7 +798,7 @@ bool wm5100_readable_register(struct device *dev, unsigned int reg)
 	case WM5100_DSP3_CONTROL_28:
 	case WM5100_DSP3_CONTROL_29:
 	case WM5100_DSP3_CONTROL_30:
-		return 1;
+		return true;
 	default:
 		if ((reg >= WM5100_DSP1_PM_0 && reg <= WM5100_DSP1_PM_1535) ||
 		    (reg >= WM5100_DSP1_ZM_0 && reg <= WM5100_DSP1_ZM_2047) ||
@@ -809,9 +809,9 @@ bool wm5100_readable_register(struct device *dev, unsigned int reg)
 		    (reg >= WM5100_DSP3_PM_0 && reg <= WM5100_DSP3_PM_1535) ||
 		    (reg >= WM5100_DSP3_ZM_0 && reg <= WM5100_DSP3_ZM_2047) ||
 		    (reg >= WM5100_DSP3_DM_0 && reg <= WM5100_DSP3_DM_511))
-			return 1;
+			return true;
 		else
-			return 0;
+			return false;
 	}
 }
 
Signature · 1 line
2.1.2
#9 lore raw

PATCH 5/25 mips: Use bool function return values of true/false not 1/0

In reply to Joe Perches

Use the normal return values for bool functions

---
 arch/mips/include/asm/dma-mapping.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/include/asm/dma-mapping.h +1 -1
index 06412aa..fd1b4a1 100644
@@ -23,7 +23,7 @@ static inline struct dma_map_ops *get_dma_ops(struct device *dev)
 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 <= *dev->dma_mask;
 }
Signature · 1 line
2.1.2
#21 lore raw

PATCH 12/25 virtio_console: Use bool function return values of true/false not 1/0

In reply to Joe Perches

Use the normal return values for bool functions

---
 drivers/char/virtio_console.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/virtio_console.c +1 -1
index 72d7028..50754d20 100644
@@ -355,7 +355,7 @@ static inline bool use_multiport(struct ports_device *portdev)
 	 * early_init
 	 */
 	if (!portdev->vdev)
-		return 0;
+		return false;
 	return __virtio_test_bit(portdev->vdev, VIRTIO_CONSOLE_F_MULTIPORT);
 }
 
Signature · 1 line
2.1.2
#25 lore raw

PATCH 15/25 nfsd: nfs4state: Use bool function return values of true/false not 1/0

In reply to Joe Perches

Use the normal return values for bool functions

---
 fs/nfsd/nfs4state.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfsd/nfs4state.c +1 -1
index 26e9baa..fbb8dcb 100644
@@ -2603,7 +2603,7 @@ out_no_session:
 static bool nfsd4_compound_in_session(struct nfsd4_session *session, struct nfs4_sessionid *sid)
 {
 	if (!session)
-		return 0;
+		return false;
 	return !memcmp(sid, &session->se_sessionid, sizeof(*sid));
 }
 
Signature · 1 line
2.1.2
#61 lore raw

PATCH 21/25 slub: Use bool function return values of true/false not 1/0

In reply to Joe Perches

Use the normal return values for bool functions

---
 mm/slub.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
mm/slub.c +6 -6
index 90227ad..520354d 100644
@@ -376,7 +376,7 @@ static inline bool __cmpxchg_double_slab(struct kmem_cache *s, struct page *page
 		if (cmpxchg_double(&page->freelist, &page->counters,
 				   freelist_old, counters_old,
 				   freelist_new, counters_new))
-			return 1;
+			return true;
 	} else
 #endif
 	{
@@ -386,7 +386,7 @@ static inline bool __cmpxchg_double_slab(struct kmem_cache *s, struct page *page
 			page->freelist = freelist_new;
 			set_page_slub_counters(page, counters_new);
 			slab_unlock(page);
-			return 1;
+			return true;
 		}
 		slab_unlock(page);
 	}
@@ -398,7 +398,7 @@ static inline bool __cmpxchg_double_slab(struct kmem_cache *s, struct page *page
 	pr_info("%s %s: cmpxchg double redo ", n, s->name);
 #endif
 
-	return 0;
+	return false;
 }
 
 static inline bool cmpxchg_double_slab(struct kmem_cache *s, struct page *page,
@@ -412,7 +412,7 @@ static inline bool cmpxchg_double_slab(struct kmem_cache *s, struct page *page,
 		if (cmpxchg_double(&page->freelist, &page->counters,
 				   freelist_old, counters_old,
 				   freelist_new, counters_new))
-			return 1;
+			return true;
 	} else
 #endif
 	{
@@ -426,7 +426,7 @@ static inline bool cmpxchg_double_slab(struct kmem_cache *s, struct page *page,
 			set_page_slub_counters(page, counters_new);
 			slab_unlock(page);
 			local_irq_restore(flags);
-			return 1;
+			return true;
 		}
 		slab_unlock(page);
 		local_irq_restore(flags);
@@ -439,7 +439,7 @@ static inline bool cmpxchg_double_slab(struct kmem_cache *s, struct page *page,
 	pr_info("%s %s: cmpxchg double redo ", n, s->name);
 #endif
 
-	return 0;
+	return false;
 }
 
 #ifdef CONFIG_SLUB_DEBUG
Signature · 7 lines
2.1.2

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
#60 lore raw

PATCH 20/25 ftrace: Use bool function return values of true/false not 1/0

In reply to Joe Perches

Use the normal return values for bool functions

---
 kernel/trace/ftrace.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
kernel/trace/ftrace.c +5 -5
index 5a2e0b5..650043b 100644
@@ -2755,22 +2755,22 @@ ops_references_rec(struct ftrace_ops *ops, struct dyn_ftrace *rec)
 {
 	/* If ops isn't enabled, ignore it */
 	if (!(ops->flags & FTRACE_OPS_FL_ENABLED))
-		return 0;
+		return false;
 
 	/* If ops traces all mods, we already accounted for it */
 	if (ops_traces_mod(ops))
-		return 0;
+		return false;
 
 	/* The function must be in the filter */
 	if (!ftrace_hash_empty(ops->func_hash->filter_hash) &&
 	    !ftrace_lookup_ip(ops->func_hash->filter_hash, rec->ip))
-		return 0;
+		return false;
 
 	/* If in notrace hash, we ignore it too */
 	if (ftrace_lookup_ip(ops->func_hash->notrace_hash, rec->ip))
-		return 0;
+		return false;
 
-	return 1;
+	return true;
 }
 
 static int referenced_filters(struct dyn_ftrace *rec)
Signature · 1 line
2.1.2
#66 lore raw

PATCH 24/25 security: Use bool function return values of true/false not 1/0

In reply to Joe Perches

Use the normal return values for bool functions

---
 security/apparmor/file.c   |  8 ++++----
 security/apparmor/policy.c | 10 +++++-----
 2 files changed, 9 insertions(+), 9 deletions(-)
security/apparmor/file.c +4 -4
index fdaa50c..bd804d4 100644
@@ -260,8 +260,8 @@ unsigned int aa_str_perms(struct aa_dfa *dfa, unsigned int start,
 static inline bool is_deleted(struct dentry *dentry)
 {
 	if (d_unlinked(dentry) && dentry->d_inode->i_nlink == 0)
-		return 1;
-	return 0;
+		return true;
+	return false;
 }
 
 /**
@@ -322,9 +322,9 @@ static inline bool xindex_is_subset(u32 link, u32 target)
 {
 	if (((link & ~AA_X_UNSAFE) != (target & ~AA_X_UNSAFE)) ||
 	    ((link & AA_X_UNSAFE) && !(target & AA_X_UNSAFE)))
-		return 0;
+		return false;
 
-	return 1;
+	return true;
 }
 
 /**
security/apparmor/policy.c +5 -5
index 705c287..a8e0177 100644
@@ -137,13 +137,13 @@ static bool policy_init(struct aa_policy *policy, const char *prefix,
 	} else
 		policy->hname = kstrdup(name, GFP_KERNEL);
 	if (!policy->hname)
-		return 0;
+		return false;
 	/* base.name is a substring of fqname */
 	policy->name = (char *)hname_tail(policy->hname);
 	INIT_LIST_HEAD(&policy->list);
 	INIT_LIST_HEAD(&policy->profiles);
 
-	return 1;
+	return true;
 }
 
 /**
@@ -927,15 +927,15 @@ bool aa_may_manage_policy(int op)
 	/* check if loading policy is locked out */
 	if (aa_g_lock_policy) {
 		audit_policy(op, GFP_KERNEL, NULL, "policy_locked", -EACCES);
-		return 0;
+		return false;
 	}
 
 	if (!capable(CAP_MAC_ADMIN)) {
 		audit_policy(op, GFP_KERNEL, NULL, "not policy admin", -EACCES);
-		return 0;
+		return false;
 	}
 
-	return 1;
+	return true;
 }
 
 static struct aa_profile *__list_lookup_parent(struct list_head *lh,
Signature · 1 line
2.1.2
#32 lore raw

PATCH 19/25 sched: Use bool function return values of true/false not 1/0

In reply to Joe Perches

Use the normal return values for bool functions

Update the other sets of ret in try_wait_for_completion.

---
 kernel/sched/auto_group.h |  2 +-
 kernel/sched/completion.c | 16 +++++++++-------
 2 files changed, 10 insertions(+), 8 deletions(-)
kernel/sched/auto_group.h +1 -1
index 8bd0471..309b6f2 100644
@@ -45,7 +45,7 @@ static inline void autogroup_init(struct task_struct *init_task) {  }
 static inline void autogroup_free(struct task_group *tg) { }
 static inline bool task_group_is_autogroup(struct task_group *tg)
 {
-	return 0;
+	return false;
 }
 
 static inline struct task_group *
kernel/sched/completion.c +9 -7
index 8d0f35d..cbccaa0 100644
@@ -255,8 +255,8 @@ EXPORT_SYMBOL(wait_for_completion_killable_timeout);
  *	try_wait_for_completion - try to decrement a completion without blocking
  *	@x:	completion structure
  *
- *	Return: 0 if a decrement cannot be done without blocking
- *		 1 if a decrement succeeded.
+ *	Return: true if a decrement cannot be done without blocking
+ *		false if a decrement succeeded.
  *
  *	If a completion is being used as a counting completion,
  *	attempt to decrement the counter without blocking. This
@@ -266,7 +266,7 @@ EXPORT_SYMBOL(wait_for_completion_killable_timeout);
 bool try_wait_for_completion(struct completion *x)
 {
 	unsigned long flags;
-	int ret = 1;
+	bool ret;
 
 	/*
 	 * Since x->done will need to be locked only
@@ -275,13 +275,15 @@ bool try_wait_for_completion(struct completion *x)
 	 * return early in the blocking case.
 	 */
 	if (!READ_ONCE(x->done))
-		return 0;
+		return false;
 
 	spin_lock_irqsave(&x->wait.lock, flags);
-	if (!x->done)
-		ret = 0;
-	else
+	if (!x->done) {
+		ret = false;
+	} else {
 		x->done--;
+		ret = true;
+	}
 	spin_unlock_irqrestore(&x->wait.lock, flags);
 	return ret;
 }
Signature · 1 line
2.1.2
#31 lore raw

PATCH 18/25 rcu: tree_plugin: Use bool function return values of true/false not 1/0

In reply to Joe Perches

Use the normal return values for bool functions

---
 kernel/rcu/tree_plugin.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/rcu/tree_plugin.h +2 -2
index f2af14d..ea342bb 100644
@@ -3059,9 +3059,9 @@ static bool rcu_nohz_full_cpu(struct rcu_state *rsp)
 	if (tick_nohz_full_cpu(smp_processor_id()) &&
 	    (!rcu_gp_in_progress(rsp) ||
 	     ULONG_CMP_LT(jiffies, READ_ONCE(rsp->gp_start) + HZ)))
-		return 1;
+		return true;
 #endif /* #ifdef CONFIG_NO_HZ_FULL */
-	return 0;
+	return false;
 }
 
 /*
Signature · 1 line
2.1.2
#17 lore raw

PATCH 10/25 unicore32: Use bool function return values of true/false not 1/0

In reply to Joe Perches

Use the normal return values for bool functions

---
 arch/unicore32/include/asm/dma-mapping.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/unicore32/include/asm/dma-mapping.h +1 -1
index 366460a..86f7962 100644
@@ -57,7 +57,7 @@ static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size)
 	if (dev && dev->dma_mask)
 		return addr + size - 1 <= *dev->dma_mask;
 
-	return 1;
+	return true;
 }
 
 static inline dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr)
Signature · 1 line
2.1.2
#16 lore raw

PATCH 9/25 tile: Use bool function return values of true/false not 1/0

In reply to Joe Perches

Use the normal return values for bool functions

---
 arch/tile/include/asm/dma-mapping.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/tile/include/asm/dma-mapping.h +1 -1
index 1eae359..b150111 100644
@@ -69,7 +69,7 @@ static inline void set_dma_ops(struct device *dev, struct dma_map_ops *ops)
 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;
 }
Signature · 1 line
2.1.2
#70 lore raw
In reply to Joe Perches
Quoted 74 lines · Joe Perches

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 ++--
Quoted 8 lines
 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?

Quoted 2 lines
 55 files changed, 178 insertions(+), 176 deletions(-)
#73 lore raw
In reply to Joe Perches
Quoted 74 lines · Joe Perches

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 ++--
Quoted 8 lines
 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?

Quoted 2 lines
 55 files changed, 178 insertions(+), 176 deletions(-)
#71 lore raw
In reply to Casey Schaufler
Quoted 3 lines · Casey Schaufler
Quoted 2 lines · Joe Perches

Joe Perches (25):
arm: Use bool function return values of true/false not 1/0

[etc...]

Quoted 1 line

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 [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#72 lore raw
In reply to Casey Schaufler
Quoted 3 lines · Casey Schaufler
Quoted 2 lines · Joe Perches

Joe Perches (25):
arm: Use bool function return values of true/false not 1/0

[etc...]

Quoted 1 line

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.

Acked-by on v1 6/25
#11 lore raw

Re: [PATCH 06/25] powerpc: Use bool function return values of true/false not 1/0

In reply to Joe Perches
Quoted 1 line · Joe Perches

Use the normal return values for bool functions

Should we merge it or will you ?

Cheers,
Ben.

Quoted 66 lines
---
 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(-)
arch/powerpc/include/asm/dcr-native.h +1 -1
index 7d2e623..4efc11d 100644
@@ -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) \
arch/powerpc/include/asm/dma-mapping.h +2 -2
index 894d538..9103687 100644
@@ -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;
 }
arch/powerpc/include/asm/kvm_book3s_64.h +2 -2
index 2d81e20..2a244bf 100644
@@ -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);
 }
 
arch/powerpc/sysdev/dcr.c +0 -0
index 2d8a101..121e26f 100644

arch/powerpc/sysdev/dcr.c bool dcr_map_ok_generic(dcr_host_t host) · line 60

Quoted 8 lines
arch/powerpc/sysdev/dcr.c +1 -1
@@ -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
[email protected]
https://lists.ozlabs.org/listinfo/linuxppc-dev

#12 lore raw

Re: [PATCH 06/25] powerpc: Use bool function return values of true/false not 1/0

Quoted 6 lines · Benjamin Herrenschmidt
Quoted 1 line · Joe Perches

Use the normal return values for bool functions

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

Reviewed-by on v1 12/25
#22 lore raw

Re: [PATCH 12/25] virtio_console: Use bool function return values of true/false not 1/0

In reply to Joe Perches
Quoted 12 lines · Joe Perches

Use the normal return values for bool functions

---
 drivers/char/virtio_console.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/virtio_console.c +0 -0
index 72d7028..50754d20 100644

drivers/char/virtio_console.c static inline bool use_multiport(struct ports_device *portdev) · line 358

Quoted 5 lines
drivers/char/virtio_console.c +1 -1
@@ -355,7 +355,7 @@ static inline bool use_multiport(struct ports_device *portdev)
 	 * early_init
 	 */
 	if (!portdev->vdev)
-		return 0;
+		return false;

Amit

maintainer Acked-by on v1 24/25
#67 lore raw

Re: [PATCH 24/25] security: Use bool function return values of true/false not 1/0

In reply to Joe Perches
Quoted 3 lines · Joe Perches

Use the normal return values for bool functions

Joe, I'll pull this into my tree and send it up with a couple of other patches I have pending

Quoted 72 lines
---
 security/apparmor/file.c   |  8 ++++----
 security/apparmor/policy.c | 10 +++++-----
 2 files changed, 9 insertions(+), 9 deletions(-)
security/apparmor/file.c +4 -4
index fdaa50c..bd804d4 100644
@@ -260,8 +260,8 @@ unsigned int aa_str_perms(struct aa_dfa *dfa, unsigned int start,
 static inline bool is_deleted(struct dentry *dentry)
 {
 	if (d_unlinked(dentry) && dentry->d_inode->i_nlink == 0)
-		return 1;
-	return 0;
+		return true;
+	return false;
 }
 
 /**
@@ -322,9 +322,9 @@ static inline bool xindex_is_subset(u32 link, u32 target)
 {
 	if (((link & ~AA_X_UNSAFE) != (target & ~AA_X_UNSAFE)) ||
 	    ((link & AA_X_UNSAFE) && !(target & AA_X_UNSAFE)))
-		return 0;
+		return false;
 
-	return 1;
+	return true;
 }
 
 /**
security/apparmor/policy.c +5 -5
index 705c287..a8e0177 100644
@@ -137,13 +137,13 @@ static bool policy_init(struct aa_policy *policy, const char *prefix,
 	} else
 		policy->hname = kstrdup(name, GFP_KERNEL);
 	if (!policy->hname)
-		return 0;
+		return false;
 	/* base.name is a substring of fqname */
 	policy->name = (char *)hname_tail(policy->hname);
 	INIT_LIST_HEAD(&policy->list);
 	INIT_LIST_HEAD(&policy->profiles);
 
-	return 1;
+	return true;
 }
 
 /**
@@ -927,15 +927,15 @@ bool aa_may_manage_policy(int op)
 	/* check if loading policy is locked out */
 	if (aa_g_lock_policy) {
 		audit_policy(op, GFP_KERNEL, NULL, "policy_locked", -EACCES);
-		return 0;
+		return false;
 	}
 
 	if (!capable(CAP_MAC_ADMIN)) {
 		audit_policy(op, GFP_KERNEL, NULL, "not policy admin", -EACCES);
-		return 0;
+		return false;
 	}
 
-	return 1;
+	return true;
 }
 
 static struct aa_profile *__list_lookup_parent(struct list_head *lh,
maintainer
#30 lore raw

Re: [PATCH 17/25] sound: Use bool function return values of true/false not 1/0

In reply to Joe Perches
Quoted 1 line · Joe Perches

Use the normal return values for bool functions

Joe, as has been *repeatedly* requested you should use subject lines matching the style for the subsystem.

Please also remember to CC people on the cover letters for serieses so they know if there's dependencies (if the series is actually a bunch of separate patches consider sending that way).

#14 lore raw

Re: [PATCH 07/25] s390: Use bool function return values of true/false not 1/0

In reply to Joe Perches
Quoted 12 lines · Joe Perches

Use the normal return values for bool functions

---
 arch/s390/include/asm/dma-mapping.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/s390/include/asm/dma-mapping.h +0 -0
index 709955d..9d39596 100644

arch/s390/include/asm/dma-mapping.h static inline int dma_supported(struct device *dev, u64 mask) · line 47

Quoted 7 lines
arch/s390/include/asm/dma-mapping.h +1 -1
@@ -42,7 +42,7 @@ static inline int dma_supported(struct device *dev, u64 mask)
 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;
 }

Applied, thanks!

Acked-by on v1 16/25
#27 lore raw

Re: [PATCH 16/25] include/linux: Use bool function return values of true/false not 1/0

In reply to Joe Perches
Quoted 8 lines · Joe Perches

Use the normal return values for bool functions

---
 include/linux/blkdev.h               |  2 +-
 include/linux/ide.h                  |  2 +-
 include/linux/kgdb.h                 |  2 +-
 include/linux/mfd/db8500-prcmu.h     |  2 +-
Quoted 182 lines
 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 ++++++++--------
 8 files changed, 18 insertions(+), 18 deletions(-)
include/linux/blkdev.h +1 -1
index 5d93a66..eced869 100644
@@ -1591,7 +1591,7 @@ static inline bool blk_integrity_merge_bio(struct request_queue *rq,
 }
 static inline bool blk_integrity_is_initialized(struct gendisk *g)
 {
-	return 0;
+	return false;
 }
 
 #endif /* CONFIG_BLK_DEV_INTEGRITY */
include/linux/ide.h +1 -1
index 93b5ca7..1ba07db 100644
@@ -1411,7 +1411,7 @@ void ide_acpi_port_init_devices(ide_hwif_t *);
 extern void ide_acpi_set_state(ide_hwif_t *hwif, int on);
 #else
 static inline int ide_acpi_init(void) { return 0; }
-static inline bool ide_port_acpi(ide_hwif_t *hwif) { return 0; }
+static inline bool ide_port_acpi(ide_hwif_t *hwif) { return false; }
 static inline int ide_acpi_exec_tfs(ide_drive_t *drive) { return 0; }
 static inline void ide_acpi_get_timing(ide_hwif_t *hwif) { ; }
 static inline void ide_acpi_push_timing(ide_hwif_t *hwif) { ; }
include/linux/kgdb.h +1 -1
index e465bb1..840f494 100644
@@ -292,7 +292,7 @@ extern bool kgdb_nmi_poll_knock(void);
 #else
 static inline int kgdb_register_nmi_console(void) { return 0; }
 static inline int kgdb_unregister_nmi_console(void) { return 0; }
-static inline bool kgdb_nmi_poll_knock(void) { return 1; }
+static inline bool kgdb_nmi_poll_knock(void) { return true; }
 #endif
 
 extern int kgdb_register_io_module(struct kgdb_io *local_kgdb_io_ops);
include/linux/mfd/db8500-prcmu.h +1 -1
index 0bd6944..3b06175 100644
@@ -744,7 +744,7 @@ static inline int db8500_prcmu_load_a9wdog(u8 id, u32 val)
 
 static inline bool db8500_prcmu_is_ac_wake_requested(void)
 {
-	return 0;
+	return false;
 }
 
 static inline int db8500_prcmu_set_arm_opp(u8 opp)
include/linux/mm.h +1 -1
index 4a3a385..164108c 100644
@@ -819,7 +819,7 @@ static inline int cpu_pid_to_cpupid(int nid, int pid)
 
 static inline bool cpupid_pid_unset(int cpupid)
 {
-	return 1;
+	return true;
 }
 
 static inline void page_cpupid_reset_last(struct page *page)
include/linux/power_supply.h +4 -4
index 75a1dd8..b0b45c7 100644
@@ -350,12 +350,12 @@ static inline bool power_supply_is_amp_property(enum power_supply_property psp)
 	case POWER_SUPPLY_PROP_CURRENT_NOW:
 	case POWER_SUPPLY_PROP_CURRENT_AVG:
 	case POWER_SUPPLY_PROP_CURRENT_BOOT:
-		return 1;
+		return true;
 	default:
 		break;
 	}
 
-	return 0;
+	return false;
 }
 
 static inline bool power_supply_is_watt_property(enum power_supply_property psp)
@@ -378,12 +378,12 @@ static inline bool power_supply_is_watt_property(enum power_supply_property psp)
 	case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE:
 	case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX:
 	case POWER_SUPPLY_PROP_POWER_NOW:
-		return 1;
+		return true;
 	default:
 		break;
 	}
 
-	return 0;
+	return false;
 }
 
 #endif /* __LINUX_POWER_SUPPLY_H__ */
include/linux/ssb/ssb_driver_extif.h +1 -1
index a410e84..5766b6f 100644
@@ -198,7 +198,7 @@ struct ssb_extif {
 
 static inline bool ssb_extif_available(struct ssb_extif *extif)
 {
-	return 0;
+	return false;
 }
 
 static inline
include/linux/ssb/ssb_driver_gige.h +8 -8
index 0688472..65f7740 100644
@@ -75,7 +75,7 @@ static inline bool ssb_gige_have_roboswitch(struct pci_dev *pdev)
 	if (dev)
 		return !!(dev->dev->bus->sprom.boardflags_lo &
 			  SSB_GIGE_BFL_ROBOSWITCH);
-	return 0;
+	return false;
 }
 
 /* Returns whether we can only do one DMA at once. */
@@ -85,7 +85,7 @@ static inline bool ssb_gige_one_dma_at_once(struct pci_dev *pdev)
 	if (dev)
 		return ((dev->dev->bus->chip_id == 0x4785) &&
 			(dev->dev->bus->chip_rev < 2));
-	return 0;
+	return false;
 }
 
 /* Returns whether we must flush posted writes. */
@@ -94,7 +94,7 @@ static inline bool ssb_gige_must_flush_posted_writes(struct pci_dev *pdev)
 	struct ssb_gige *dev = pdev_to_ssb_gige(pdev);
 	if (dev)
 		return (dev->dev->bus->chip_id == 0x4785);
-	return 0;
+	return false;
 }
 
 /* Get the device MAC address */
@@ -158,7 +158,7 @@ static inline void ssb_gige_exit(void)
 
 static inline bool pdev_is_ssb_gige_core(struct pci_dev *pdev)
 {
-	return 0;
+	return false;
 }
 static inline struct ssb_gige * pdev_to_ssb_gige(struct pci_dev *pdev)
 {
@@ -166,19 +166,19 @@ static inline struct ssb_gige * pdev_to_ssb_gige(struct pci_dev *pdev)
 }
 static inline bool ssb_gige_is_rgmii(struct pci_dev *pdev)
 {
-	return 0;
+	return false;
 }
 static inline bool ssb_gige_have_roboswitch(struct pci_dev *pdev)
 {
-	return 0;
+	return false;
 }
 static inline bool ssb_gige_one_dma_at_once(struct pci_dev *pdev)
 {
-	return 0;
+	return false;
 }
 static inline bool ssb_gige_must_flush_posted_writes(struct pci_dev *pdev)
 {
-	return 0;
+	return false;
 }
 static inline int ssb_gige_get_macaddr(struct pci_dev *pdev, u8 *macaddr)
 {
Signature · 10 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
maintainer
#33 lore raw

Re: [PATCH 19/25] sched: Use bool function return values of true/false not 1/0

In reply to Joe Perches
Quoted 3 lines · Joe Perches

Use the normal return values for bool functions

Update the other sets of ret in try_wait_for_completion.

I'm missing a why; why are you doing this?

#34 lore raw

Re: [PATCH 19/25] sched: Use bool function return values of true/false not 1/0

Quoted 6 lines · Peter Zijlstra
Quoted 3 lines · Joe Perches

Use the normal return values for bool functions

Update the other sets of ret in try_wait_for_completion.

I'm missing a why; why are you doing this?

Let me guess: Joe Perches is suffering from 'trivialititis': a sickness that prevents a non-newbie kernel developer from raising beyond churning out a flood of trivial patches and creating unnecessary churn for other developers with these borderline useless patches?

Linux is a meritocracy, not a bureaucracy.

Thanks,

Ingo

#57 lore raw

Re: [PATCH 19/25] sched: Use bool function return values of true/false not 1/0

In reply to Peter Zijlstra
Quoted 6 lines · Peter Zijlstra
Quoted 3 lines · Joe Perches

Use the normal return values for bool fsnctions

Update the other sets of ret in try_wait_for_completion.

I'm missing a why; why are you doing this?

It's just a trivial little consistency patch to make bool functions return bool values instead of 1 or 0 (even though of course 1 and 0 are the values for true and false)

There's something like 13000 uses of return true or return false in the tree vs these 180 or so uses of 1 and 0.

#6 lore raw

Re: [PATCH 02/25] arm64: Use bool function return values of true/false not 1/0

In reply to Joe Perches
Quoted 22 lines · Joe Perches

Use the normal return values for bool functions

---
 arch/arm64/include/asm/dma-mapping.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/include/asm/dma-mapping.h +1 -1
index 6932bb5..9437e3d 100644
@@ -97,7 +97,7 @@ static inline int dma_set_mask(struct device *dev, u64 mask)
 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;
 }
Signature · 1 line
2.1.2

Looks simple enough, I'll pick it up for 4.1.

Will

maintainer Acked-by on v1 1/25
#2 lore raw

Re: [PATCH 01/25] arm: Use bool function return values of true/false not 1/0

In reply to Joe Perches
Quoted 3 lines · Joe Perches

Use the normal return values for bool functions

Quoted 93 lines
---
 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(-)
arch/arm/include/asm/dma-mapping.h +4 -4
index b52101d..166e1e1 100644
@@ -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) { }
arch/arm/include/asm/kvm_emulate.h +1 -1
index a9c80a2..ad200a0 100644
@@ -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)
arch/arm/mach-omap2/powerdomain.c +7 -7
index 78af6d8..897f9fb 100644
@@ -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;
 }
Signature · 1 line
2.1.2
maintainer
#3 lore raw

Re: [PATCH 01/25] arm: Use bool function return values of true/false not 1/0

In reply to Joe Perches
Quoted 84 lines · Joe Perches

Use the normal return values for bool functions

---
 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(-)
arch/arm/include/asm/dma-mapping.h +4 -4
index b52101d..166e1e1 100644
@@ -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) { }
arch/arm/include/asm/kvm_emulate.h +1 -1
index a9c80a2..ad200a0 100644
@@ -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)
arch/arm/mach-omap2/powerdomain.c +5 -5
index 78af6d8..897f9fb 100644
@@ -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;

arch/arm/mach-omap2/powerdomain.c bool pwrdm_can_ever_lose_context(struct powerdomain *pwrdm) · line 1208

Quoted 10 lines
arch/arm/mach-omap2/powerdomain.c +2 -2
 	}
 
 	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

Acked-by
#4 lore raw

Re: [PATCH 01/25] arm: Use bool function return values of true/false not 1/0

Quoted 91 lines · On Tue, 31 Mar 2015 16:58:28 +0100 Paolo Bonzini <[email protected]> wrote:
Quoted 90 lines · Joe Perches

Use the normal return values for bool functions

---
 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(-)
arch/arm/include/asm/dma-mapping.h +4 -4
index b52101d..166e1e1 100644
@@ -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) { }
arch/arm/include/asm/kvm_emulate.h +1 -1
index a9c80a2..ad200a0 100644
@@ -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)
arch/arm/mach-omap2/powerdomain.c +6 -6
index 78af6d8..897f9fb 100644
@@ -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;
 
Quoted 6 lines

arch/arm/mach-omap2/powerdomain.c bool pwrdm_can_ever_lose_context(struct powerdomain *pwrdm) · line 1208

Quoted 4 lines
arch/arm/mach-omap2/powerdomain.c +1 -1
-	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:

	M.
Signature · 1 line
Jazz is not dead. It just smells funny.
maintainer
#19 lore raw

Re: [PATCH 11/25] x86: Use bool function return values of true/false not 1/0

In reply to Joe Perches
Quoted 10 lines · Joe Perches

Use the normal return values for bool functions

---
 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

#35 lore raw

Re: [PATCH 19/25] sched: Use bool function return values of true/false not 1/0

In reply to Ingo Molnar
Quoted 6 lines · Ingo Molnar
Quoted 5 lines · Peter Zijlstra
Quoted 3 lines · Joe Perches

Use the normal return values for bool functions

Update the other sets of ret in try_wait_for_completion.

Quoted 7 lines
Quoted 1 line

I'm missing a why; why are you doing this?

Let me guess: Joe Perches is suffering from 'trivialititis': a sickness that prevents a non-newbie kernel developer from raising beyond churning out a flood of trivial patches and creating unnecessary churn for other developers with these borderline useless patches?

Good morning Ingo.

As you are a signer of that "code of conflict" patch, I'll be mildly amused, but not surprised, if you are among the first participants.

Perhaps you can search for your own name here.
http://lwn.net/Articles/637037/

cheers, Joe

reviewer Acked-by on v1 21/25
#62 lore raw

Re: [PATCH 21/25] slub: Use bool function return values of true/false not 1/0

In reply to Joe Perches
Quoted 3 lines · Joe Perches

Use the normal return values for bool functions

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

#58 lore raw

Re: [PATCH 19/25] sched: Use bool function return values of true/false not 1/0

In reply to Joe Perches
Quoted 7 lines · Joe Perches

* try_wait_for_completion - try to decrement a completion without blocking
* @x: completion structure
*
- * Return: 0 if a decrement cannot be done without blocking
- * 1 if a decrement succeeded.
+ * Return: true if a decrement cannot be done without blocking
+ * false if a decrement succeeded.

Hi Joe,

The boolean logic was reversed in this comment. The function should be returning false if a decrement cannot be done without blocking, and true if a decrement succeeded.

#59 lore raw

PATCH v2 19/25 sched: Use bool function return values of true/false not 1/0

Use the normal return values for bool functions

Update the other sets of ret in try_wait_for_completion.

---

Quoted 9 lines · Jason Low
Quoted 7 lines · Joe Perches

* try_wait_for_completion - try to decrement a completion without blocking
* @x: completion structure
*
- * Return: 0 if a decrement cannot be done without blocking
- * 1 if a decrement succeeded.
+ * Return: true if a decrement cannot be done without blocking
+ * false if a decrement succeeded.

Quoted 3 lines

The boolean logic was reversed in this comment. The function should be returning false if a decrement cannot be done without blocking, and true if a decrement succeeded.

Hi Jason, right, my typo, thanks for noticing.

 kernel/sched/auto_group.h |  2 +-
 kernel/sched/completion.c | 16 +++++++++-------
 2 files changed, 10 insertions(+), 8 deletions(-)
kernel/sched/auto_group.h +1 -1
index 8bd0471..309b6f2 100644
@@ -45,7 +45,7 @@ static inline void autogroup_init(struct task_struct *init_task) {  }
 static inline void autogroup_free(struct task_group *tg) { }
 static inline bool task_group_is_autogroup(struct task_group *tg)
 {
-	return 0;
+	return false;
 }
 
 static inline struct task_group *
kernel/sched/completion.c +9 -7
index 8d0f35d..cbccaa0 100644
@@ -255,8 +255,8 @@ EXPORT_SYMBOL(wait_for_completion_killable_timeout);
  *	try_wait_for_completion - try to decrement a completion without blocking
  *	@x:	completion structure
  *
- *	Return: 0 if a decrement cannot be done without blocking
- *		 1 if a decrement succeeded.
+ *	Return: false if a decrement cannot be done without blocking
+ *		true if a decrement succeeded.
  *
  *	If a completion is being used as a counting completion,
  *	attempt to decrement the counter without blocking. This
@@ -266,7 +266,7 @@ EXPORT_SYMBOL(wait_for_completion_killable_timeout);
 bool try_wait_for_completion(struct completion *x)
 {
 	unsigned long flags;
-	int ret = 1;
+	bool ret;
 
 	/*
 	 * Since x->done will need to be locked only
@@ -275,13 +275,15 @@ bool try_wait_for_completion(struct completion *x)
 	 * return early in the blocking case.
 	 */
 	if (!READ_ONCE(x->done))
-		return 0;
+		return false;
 
 	spin_lock_irqsave(&x->wait.lock, flags);
-	if (!x->done)
-		ret = 0;
-	else
+	if (!x->done) {
+		ret = false;
+	} else {
 		x->done--;
+		ret = true;
+	}
 	spin_unlock_irqrestore(&x->wait.lock, flags);
 	return ret;
 }
maintainer
#36 lore raw

Re: [PATCH 19/25] sched: Use bool function return values of true/false not 1/0

In reply to Joe Perches
Quoted 15 lines · Joe Perches
Quoted 6 lines · Ingo Molnar
Quoted 5 lines · Peter Zijlstra
Quoted 3 lines · Joe Perches

Use the normal return values for bool functions

Update the other sets of ret in try_wait_for_completion.

Quoted 7 lines
Quoted 1 line

I'm missing a why; why are you doing this?

Let me guess: Joe Perches is suffering from 'trivialititis': a sickness that prevents a non-newbie kernel developer from raising beyond churning out a flood of trivial patches and creating unnecessary churn for other developers with these borderline useless patches?

Quoted 5 lines

Good morning Ingo.

As you are a signer of that "code of conflict" patch, I'll be mildly amused, but not surprised, if you are among the first participants.

OMFG, exactly the kind of f'king nonsense I was afraid of. PC brigade gone rampant. Get a live people. An Joe please go do something useful.

#37 lore raw

about the flood of trivial patches and the Code of Conduct (was: Re: [PATCH 19/25] sched: Use bool function return values of true/false not 1/0)

In reply to Joe Perches
Quoted 15 lines · Joe Perches
Quoted 14 lines · Ingo Molnar
Quoted 6 lines · Peter Zijlstra
Quoted 3 lines · Joe Perches

Use the normal return values for bool functions

Update the other sets of ret in try_wait_for_completion.

I'm missing a why; why are you doing this?

Let me guess: Joe Perches is suffering from 'trivialititis': a sickness that prevents a non-newbie kernel developer from raising beyond churning out a flood of trivial patches and creating unnecessary churn for other developers with these borderline useless patches?

Quoted 7 lines
Quoted 1 line

Linux is a meritocracy, not a bureaucracy.

Good morning Ingo.

As you are a signer of that "code of conflict" patch, I'll be mildly amused, but not surprised, if you are among the first participants.

So as a reply to my joke directed against your (costly: see below) flood of trivial and somewhat bureaucratic patches that PeterZ complained about, which reply of mine aimed at getting you to change from your many years old pattern of producing trivial patches towards producing more substantial patches, causes you to issue a threat of bureaucratic action against me?

Wow.

I'd also like to stress that I don't think you have answered PeterZ's legitimate technical question adequately: what are the technological justifications for doing this 25 patches series - returning 0/1 or true/false is clearly a matter of taste unless mixed within the same function. In fact what are your technological justifications for doing so many trivial patches in general?

Please don't bother producing and sending me such trivial patches unless they:

- fix a real bug (in which case they are not trivial patches anymore)

- or are part of a larger (non-trivial!) series that does some real, substantial work on this code that tries to:

- fix existing code

- speed up existing code

- or expand upon existing code with new code

- turn totally unreadable code into something readable (for example in drivers/staging/)

The reason I'm not applying your patch is that trivial patches, even if they seem borderline useful, with no substance following them up, often have more costs than benefits:

- they lead to pointless churn:

- they take up Git space (and bandwidth) for no good reason

- they slow down bisection of real changes

- they take up (valuable!) reviewer bandwidth

- they take up maintainer bandwidth

there's literally a million borderline pointless cleanup patches that could be done on the kernel, and we really don't want to add a million commits to the kernel tree...

I don't think your 25 patches long trivial series is defensible from a kernel contributor who has thousands of commits in the mainline kernel
already: you are clearly not a kernel newbie anymore who needs to learn the ropes through simple patches and whose initially trivial patches maintainers will nurture in the hope of gaining a future contributor who will be a net benefit in the future...

I also think you are beginning to abuse the openness of kernel maintainers to apply trivial patches, and I don't think it's useful to point out such abuse before it gets worse.

My (repeated) advice to you is that you should try to raise beyond newbie patches and write something more substantial that helps Linux:

- take a look at the many bugs on bugzilla.kernel.org and try to analyze, reproduce or fix them

- go read kernel code, understand it and try to find real bugs.

- go test the latest kernels and find bugs in it. The fresher the code, the more likely it is that it has bugs.

- go read kernel code and try to expand upon it

Fortunately it's not hard to contribute to the kernel once you are beyond the 'newbie' status: there's literally an infinite amount of work to be done on the kernel, and I welcome productive contributions
- but churning out trivial patches with no substantial patches following them up is not productive and in fact (as pointed out above) they are harmful once you are not a totally fresh newbie kernel developer anymore...

Pointing out this truth and protecting against such abusive flood of trivial patches is not against the code of conduct I signed.

Thanks,

Ingo

#38 lore raw

Re: about the flood of trivial patches and the Code of Conduct (was: Re: [PATCH 19/25] sched: Use bool function return values of true/false not 1/0)

Quoted 65 lines · Ingo Molnar
Quoted 15 lines · Joe Perches
Quoted 14 lines · Ingo Molnar
Quoted 6 lines · Peter Zijlstra
Quoted 3 lines · Joe Perches

Use the normal return values for bool functions

Update the other sets of ret in try_wait_for_completion.

I'm missing a why; why are you doing this?

Let me guess: Joe Perches is suffering from 'trivialititis': a sickness that prevents a non-newbie kernel developer from raising beyond churning out a flood of trivial patches and creating unnecessary churn for other developers with these borderline useless patches?

Quoted 7 lines
Quoted 1 line

Linux is a meritocracy, not a bureaucracy.

Good morning Ingo.

As you are a signer of that "code of conflict" patch, I'll be mildly amused, but not surprised, if you are among the first participants.

So as a reply to my joke directed against your (costly: see below) flood of trivial and somewhat bureaucratic patches that PeterZ complained about, which reply of mine aimed at getting you to change from your many years old pattern of producing trivial patches towards producing more substantial patches, causes you to issue a threat of bureaucratic action against me?

Wow.

I'd also like to stress that I don't think you have answered PeterZ's legitimate technical question adequately: what are the technological justifications for doing this 25 patches series - returning 0/1 or true/false is clearly a matter of taste unless mixed within the same function. In fact what are your technological justifications for doing so many trivial patches in general?

Please don't bother producing and sending me such trivial patches unless they:

- fix a real bug (in which case they are not trivial patches anymore)

- or are part of a larger (non-trivial!) series that does some real, substantial work on this code that tries to:

- fix existing code

- speed up existing code

- or expand upon existing code with new code

- turn totally unreadable code into something readable (for example in drivers/staging/)

The reason I'm not applying your patch is that trivial patches, even if they seem borderline useful, with no substance following them up, often have more costs than benefits:

- they lead to pointless churn:

Quoted 7 lines

- they take up Git space (and bandwidth) for no good reason

- they slow down bisection of real changes

- they take up (valuable!) reviewer bandwidth

- they take up maintainer bandwidth

Not to mention that one of your trivial patches in this series actually introduced a bug:

lkml.kernel.org/r/[email protected]

Which additional risk adds to the cost side of the equation as well.

Thanks,

Ingo

#39 lore raw

Re: about the flood of trivial patches and the Code of Conflict (was: Re: [PATCH 19/25] sched: Use bool function return values of true/false not 1/0)

In reply to Ingo Molnar

s/Conduct/Conflict

Quoted 115 lines · Ingo Molnar
Quoted 15 lines · Joe Perches
Quoted 14 lines · Ingo Molnar
Quoted 6 lines · Peter Zijlstra
Quoted 3 lines · Joe Perches

Use the normal return values for bool functions

Update the other sets of ret in try_wait_for_completion.

I'm missing a why; why are you doing this?

Let me guess: Joe Perches is suffering from 'trivialititis': a sickness that prevents a non-newbie kernel developer from raising beyond churning out a flood of trivial patches and creating unnecessary churn for other developers with these borderline useless patches?

Quoted 7 lines
Quoted 1 line

Linux is a meritocracy, not a bureaucracy.

Good morning Ingo.

As you are a signer of that "code of conflict" patch, I'll be mildly amused, but not surprised, if you are among the first participants.

So as a reply to my joke directed against your (costly: see below) flood of trivial and somewhat bureaucratic patches that PeterZ complained about, which reply of mine aimed at getting you to change from your many years old pattern of producing trivial patches towards producing more substantial patches, causes you to issue a threat of bureaucratic action against me?

Wow.

I'd also like to stress that I don't think you have answered PeterZ's legitimate technical question adequately: what are the technological justifications for doing this 25 patches series - returning 0/1 or true/false is clearly a matter of taste unless mixed within the same function. In fact what are your technological justifications for doing so many trivial patches in general?

Please don't bother producing and sending me such trivial patches unless they:

- fix a real bug (in which case they are not trivial patches anymore)

- or are part of a larger (non-trivial!) series that does some real, substantial work on this code that tries to:

- fix existing code

- speed up existing code

- or expand upon existing code with new code

- turn totally unreadable code into something readable (for example in drivers/staging/)

The reason I'm not applying your patch is that trivial patches, even if they seem borderline useful, with no substance following them up, often have more costs than benefits:

- they lead to pointless churn:

- they take up Git space (and bandwidth) for no good reason

- they slow down bisection of real changes

- they take up (valuable!) reviewer bandwidth

- they take up maintainer bandwidth

there's literally a million borderline pointless cleanup patches that could be done on the kernel, and we really don't want to add a million commits to the kernel tree...

I don't think your 25 patches long trivial series is defensible from a kernel contributor who has thousands of commits in the mainline kernel
already: you are clearly not a kernel newbie anymore who needs to learn the ropes through simple patches and whose initially trivial patches maintainers will nurture in the hope of gaining a future contributor who will be a net benefit in the future...

I also think you are beginning to abuse the openness of kernel maintainers to apply trivial patches, and I don't think it's useful to point out such abuse before it gets worse.

My (repeated) advice to you is that you should try to raise beyond newbie patches and write something more substantial that helps Linux:

- take a look at the many bugs on bugzilla.kernel.org and try to analyze, reproduce or fix them

- go read kernel code, understand it and try to find real bugs.

- go test the latest kernels and find bugs in it. The fresher the code, the more likely it is that it has bugs.

- go read kernel code and try to expand upon it

Fortunately it's not hard to contribute to the kernel once you are beyond the 'newbie' status: there's literally an infinite amount of work to be done on the kernel, and I welcome productive contributions
- but churning out trivial patches with no substantial patches following them up is not productive and in fact (as pointed out above) they are harmful once you are not a totally fresh newbie kernel developer anymore...

Pointing out this truth and protecting against such abusive flood of trivial patches is not against the 'Code of Conflict' I signed.

Thanks,

Ingo

#40 lore raw

Re: about the flood of trivial patches and the Code of Conflict (was: Re: [PATCH 19/25] sched: Use bool function return values of true/false not 1/0)

Quoted 3 lines · Ingo Molnar
Quoted 3 lines

I also think you are beginning to abuse the openness of kernel maintainers to apply trivial patches, and I don't think it's useful to point out such abuse before it gets worse.

and this should read:

Quoted 3 lines
Quoted 3 lines

I also think you are beginning to abuse the openness of kernel maintainers to apply trivial patches, and I don't think it's harmful to point out such abuse before it gets worse.

Thanks,

Ingo

#41 lore raw

Re: about the flood of trivial patches and the Code of Conduct (was: Re: [PATCH 19/25] sched: Use bool function return values of true/false not 1/0)

In reply to Ingo Molnar
Quoted 2 lines · Ingo Molnar

Pointing out this truth and protecting against such abusive flood of trivial patches is not against the code of conduct I signed.

I totally agree, it's not "against" the code of conflict that I helped write.

Joe, you know better than to send trivial stuff to maintainers who don't want it. Send it through the trivial maintainer for subsystems that have expressed annoyance at this, it's not the first time this has happened.

Some maintainers, like me, are fine with your types of patches, I'd stick to those subsystems if you like doing this type of work.

Also, don't send stuff that is broken, that's not the sign of a trivial patch :(

thanks,

greg k-h

#42 lore raw

Re: about the flood of trivial patches and the Code of Conduct (was: Re: [PATCH 19/25] sched: Use bool function return values of true/false not 1/0)

Quoted 11 lines · Greg Kroah-Hartman
Quoted 2 lines · Ingo Molnar

Pointing out this truth and protecting against such abusive flood of trivial patches is not against the code of conduct I signed.

I totally agree, it's not "against" the code of conflict that I helped write.

Joe, you know better than to send trivial stuff to maintainers who don't want it. Send it through the trivial maintainer for subsystems that have expressed annoyance at this, it's not the first time this has happened.

I argue that they should not be sent _at all_ in such cases, not even via the trivial tree: firstly because typically I'll pick up the bits from the trivial tree as well, and secondly because most of the arguments I listed against bulk trivial commits (weaker bisectability, taking up reviewer bandwidth, taking up Git space, etc.) still stand.

Frankly IMHO such a */25 series could be a net negative contribution when coming from a kernel contributor who has written 2000+ trivial patches already...

Quoted 2 lines

Some maintainers, like me, are fine with your types of patches, I'd stick to those subsystems if you like doing this type of work.

So sending trivial patches for things like totally unreadable code in say drivers/staging/ is probably OK, as they materially transform the code and make it more maintainable.

For the rest it can be more harmful than beneficial, for the reasons I outlined.

Thanks,

Ingo

maintainer
#43 lore raw

Re: about the flood of trivial patches and the Code of Conduct (was: Re: [PATCH 19/25] sched: Use bool function return values of true/false not 1/0)

Quoted 15 lines · Ingo Molnar
Quoted 11 lines · Greg Kroah-Hartman
Quoted 2 lines · Ingo Molnar

Pointing out this truth and protecting against such abusive flood of trivial patches is not against the code of conduct I signed.

I totally agree, it's not "against" the code of conflict that I helped write.

Joe, you know better than to send trivial stuff to maintainers who don't want it. Send it through the trivial maintainer for subsystems that have expressed annoyance at this, it's not the first time this has happened.

Quoted 5 lines

I argue that they should not be sent _at all_ in such cases, not even via the trivial tree: firstly because typically I'll pick up the bits from the trivial tree as well, and secondly because most of the arguments I listed against bulk trivial commits (weaker bisectability, taking up reviewer bandwidth, taking up Git space, etc.) still stand.

I agree, I do not want actual code changes to by-pass me for the subsystems I'm responsible for.

Typoes in comments I can live with, but I want to see each and every patch that changes actual code.

#45 lore raw

Re: about the flood of trivial patches and the Code of Conduct (was: Re: [PATCH 19/25] sched: Use bool function return values of true/false not 1/0)

In reply to Greg Kroah-Hartman
Quoted 7 lines · Greg Kroah-Hartman
Quoted 2 lines · Ingo Molnar

Pointing out this truth and protecting against such abusive flood of trivial patches is not against the code of conduct I signed.

I totally agree, it's not "against" the code of conflict that I helped write.

Quoted 7 lines

Joe, you know better than to send trivial stuff to maintainers who don't want it. Send it through the trivial maintainer for subsystems that have expressed annoyance at this, it's not the first time this has happened.

Some maintainers, like me, are fine with your types of patches, I'd stick to those subsystems if you like doing this type of work.

Can't we send all these kind of patches through the trivial tree? Don't get me wrong, if you are fine with these patches that's you decision. But other maintainers might think they have to take these patches and get overloaded. I'm thinking of drivers maintainers that can only work one or two hours per week on Linux.
Not everyone works full time on it like you.

I propose to send all this stuff though the trivial tree such that maintainers of other subsystems have less workload and newbies (which are supposed to send such patches) know which tree they have to work against. Let's have to well defined and ordered. :-)

Signature · 2 lines
Thanks,
//richard
maintainer
#46 lore raw

Re: about the flood of trivial patches and the Code of Conduct (was: Re: [PATCH 19/25] sched: Use bool function return values of true/false not 1/0)

Quoted 11 lines · Richard Weinberger

Can't we send all these kind of patches through the trivial tree? Don't get me wrong, if you are fine with these patches that's you decision. But other maintainers might think they have to take these patches and get overloaded. I'm thinking of drivers maintainers that can only work one or two hours per week on Linux.
Not everyone works full time on it like you.

I propose to send all this stuff though the trivial tree such that maintainers of other subsystems have less workload and newbies (which are supposed to send such patches) know which tree they have to work against. Let's have to well defined and ordered. :-)

As per the other branch of this tree; an emphatic NO to that. The trivial tree is not a backdoor to bypass maintainers. Actual code changes do not get to go through any tree but the maintainer tree unless explicitly ACKed.

#47 lore raw

Re: about the flood of trivial patches and the Code of Conduct

Am 07.04.2015 um 13:32 schrieb Peter Zijlstra:

Quoted 13 lines · Richard Weinberger
Quoted 11 lines

Can't we send all these kind of patches through the trivial tree? Don't get me wrong, if you are fine with these patches that's you decision. But other maintainers might think they have to take these patches and get overloaded. I'm thinking of drivers maintainers that can only work one or two hours per week on Linux.
Not everyone works full time on it like you.

I propose to send all this stuff though the trivial tree such that maintainers of other subsystems have less workload and newbies (which are supposed to send such patches) know which tree they have to work against. Let's have to well defined and ordered. :-)

Quoted 4 lines

As per the other branch of this tree; an emphatic NO to that. The trivial tree is not a backdoor to bypass maintainers. Actual code changes do not get to go through any tree but the maintainer tree unless explicitly ACKed.

I agree that the series in question is useless.
But if a patch is trivial it can go through the trivial tree. By trivial I really mean *trivial* in terms of typos and 80 character limit crap.
It has to be something which does not hurt and the maintainer can safely ignore.

Thanks,
//richard

#50 lore raw

Re: about the flood of trivial patches and the Code of Conduct (was: Re: [PATCH 19/25] sched: Use bool function return values of true/false not 1/0)

In reply to Peter Zijlstra
Quoted 13 lines · Peter Zijlstra
Quoted 11 lines · Richard Weinberger

Can't we send all these kind of patches through the trivial tree? Don't get me wrong, if you are fine with these patches that's you decision. But other maintainers might think they have to take these patches and get overloaded. I'm thinking of drivers maintainers that can only work one or two hours per week on Linux.
Not everyone works full time on it like you.

I propose to send all this stuff though the trivial tree such that maintainers of other subsystems have less workload and newbies (which are supposed to send such patches) know which tree they have to work against. Let's have to well defined and ordered. :-)

Quoted 4 lines

As per the other branch of this tree; an emphatic NO to that. The trivial tree is not a backdoor to bypass maintainers. Actual code changes do not get to go through any tree but the maintainer tree unless explicitly ACKed.

Well, practically speaking, that would make changes like the recent clockevents_notify() removal very difficult to carry out. Also there is some natural cross-talk between certain subsystems.

Different matter is the real value of tree-wide cleanup changes. If code is old enough it often is better to leave it alone, even though it may be doing things that we don't usually do nowadays.

Or things that new patches are not supposed to do, for that matter, so I generally don't like the "checkpatch.pl error fix" changes in the old code.

Rafael

#56 lore raw

Re: about the flood of trivial patches and the Code of Conduct (was: Re: [PATCH 19/25] sched: Use bool function return values of true/false not 1/0)

In reply to Ingo Molnar
Quoted 2 lines · Ingo Molnar

I don't think you have answered PeterZ's
legitimate technical question adequately:

As I wrote before, ~13000:180 is a big ratio.
http://www.kernelhub.org/?p=2&msg=718145

Quoted 4 lines

what are the technological
justifications for doing this 25 patches series - returning 0/1 or true/false is clearly a matter of taste unless mixed within the same function.

I presume you mean file rather than function.

21 of the 55 files modified already used "return true" or "return false" for other bool function returns.

Many of the 1/0 uses were in functions where the function return type was changed from int to bool but the return statements were unchanged.

Expectation and consistency matter.
To what degree is, as always, debatable.

Code that causes a reader to "stall" when reading is generally not good.

Patches that span subsystems, given the distribution of interest and responsibilities in the kernel, generally aren't possible to apply by any single maintainer.

It's generally necessary to split even these admittedly trivial patches by area of maintainership.

Bypassing actual maintainers by sending only to the nominal trivial maintainer isn't good.

Quoted 2 lines

In fact what are your technological justifications for doing so many trivial patches in general?

Consistency improves reading speed and can help reduce future defects.

Quoted 1 line

Please don't bother producing and sending me such trivial patches

My creation of these types of patches either singly or in a series is fairly automated.

I will sed your name and email address out of the scripts that generate the "To:" and "CC:" lists for patches in the future.

If any other person with a MAINTAINERS entry wants not to receive these types of patches from me, please let me know privately.

Quoted 2 lines

Pointing out this truth and protecting against such abusive flood of trivial patches is not against the code of conduct I signed.

Jokes are hard.
"Be excellent to each other" can be too, but shouldn't be. Manners and civility are important.
Yours, like mine, can always be improved.
We all should strive for that improvement.

cheers, Joe

maintainer
#48 lore raw

Re: about the flood of trivial patches and the Code of Conduct

In reply to Richard Weinberger
Quoted 8 lines · Richard Weinberger
Quoted 5 lines

As per the other branch of this tree; an emphatic NO to that. The trivial tree is not a backdoor to bypass maintainers. Actual code changes do not get to go through any tree but the maintainer tree unless explicitly ACKed.

I agree that the series in question is useless.
But if a patch is trivial it can go through the trivial tree.

Only if they received an Acked-by from the maintainer of the code that it touches. That way, Peter does see the code that is changing. He doesn't need to take it through his tree, but the trivial maintainer must get his Acked-by, which shows that he did actually take a look at the patch and is fine with it going through another route.

Quoted 2 lines

By trivial I really mean *trivial* in terms of typos and 80 character limit crap.

Egad no. The 80 character limit is a guideline not set in stone. There's so many times I see people break up lines to avoid that limit and make the code uglier and more difficult to read. Again, that's a trivial change that would do more harm than good.

Quoted 2 lines

It has to be something which does not hurt and the maintainer can safely ignore.

I think the only change that could probably go in without an ack from the maintainer is a change that Peter already mentioned. Typos in comments that do not touch the actual code.

-- Steve

#44 lore raw

Re: about the flood of trivial patches and the Code of Conduct

In reply to Ingo Molnar
Quoted 14 lines · Ingo Molnar
Quoted 11 lines · Greg Kroah-Hartman
Quoted 2 lines · Ingo Molnar

Pointing out this truth and protecting against such abusive flood of trivial patches is not against the code of conduct I signed.

I totally agree, it's not "against" the code of conflict that I helped write.

Joe, you know better than to send trivial stuff to maintainers who don't want it. Send it through the trivial maintainer for subsystems that have expressed annoyance at this, it's not the first time this has happened.

Quoted 5 lines

I argue that they should not be sent _at all_ in such cases, not even via the trivial tree: firstly because typically I'll pick up the bits from the trivial tree as well, and secondly because most of the arguments I listed against bulk trivial commits (weaker bisectability, taking up reviewer bandwidth, taking up Git space, etc.) still stand.

And requires backports for -stable.

Regards,
Peter Hurley

#49 lore raw

Re: about the flood of trivial patches and the Code of Conduct

In reply to Steven Rostedt

Am 07.04.2015 um 15:21 schrieb Steven Rostedt:

Quoted 17 lines · Richard Weinberger
Quoted 8 lines
Quoted 5 lines

As per the other branch of this tree; an emphatic NO to that. The trivial tree is not a backdoor to bypass maintainers. Actual code changes do not get to go through any tree but the maintainer tree unless explicitly ACKed.

I agree that the series in question is useless.
But if a patch is trivial it can go through the trivial tree.

Only if they received an Acked-by from the maintainer of the code that it touches. That way, Peter does see the code that is changing. He doesn't need to take it through his tree, but the trivial maintainer must get his Acked-by, which shows that he did actually take a look at the patch and is fine with it going through another route.

Quoted 7 lines
Quoted 2 lines

By trivial I really mean *trivial* in terms of typos and 80 character limit crap.

Egad no. The 80 character limit is a guideline not set in stone. There's so many times I see people break up lines to avoid that limit and make the code uglier and more difficult to read. Again, that's a trivial change that would do more harm than good.

That's why i named it crap. :D

Quoted 6 lines
Quoted 2 lines

It has to be something which does not hurt and the maintainer can safely ignore.

I think the only change that could probably go in without an ack from the maintainer is a change that Peter already mentioned. Typos in comments that do not touch the actual code.

Agreed.

Thanks,
//richard

maintainer
#51 lore raw

Re: about the flood of trivial patches and the Code of Conduct (was: Re: [PATCH 19/25] sched: Use bool function return values of true/false not 1/0)

In reply to Rafael J. Wysocki
Quoted 9 lines · Rafael J. Wysocki
Quoted 5 lines

As per the other branch of this tree; an emphatic NO to that. The trivial tree is not a backdoor to bypass maintainers. Actual code changes do not get to go through any tree but the maintainer tree unless explicitly ACKed.

Well, practically speaking, that would make changes like the recent clockevents_notify() removal very difficult to carry out. Also there is some natural cross-talk between certain subsystems.

I would not call the clockevents_notify() series "trivial". More advanced clean ups that are system wide, would be different, because you are changing the way the code works. The maintainers must be Cc'd, but sometimes I find those changes are very hard to get acks from everyone. But again, the change is a non trivial clean up and has other reasons for going in than just to make the code look nice.

Quoted 4 lines

Different matter is the real value of tree-wide cleanup changes. If code is old enough it often is better to leave it alone, even though it may be doing things that we don't usually do nowadays.

Or maybe it's a good time to rewrite that code such that everyone can understand it today ;-)

Quoted 4 lines

Or things that new patches are not supposed to do, for that matter, so I generally don't like the "checkpatch.pl error fix" changes in the old code.

I totally agree with that. But for non trivial clean ups, old code should be updated too.

-- Steve

#55 lore raw

Re: about the flood of trivial patches and the Code of Conduct (was: Re: [PATCH 19/25] sched: Use bool function return values of true/false not 1/0)

In reply to Peter Zijlstra
Quoted 9 lines · Peter Zijlstra
Quoted 4 lines

I propose to send all this stuff though the trivial tree such that maintainers of other subsystems have less workload and newbies (which are supposed to send such patches) know which tree they have to work against. Let's have to well defined and ordered. :-)

As per the other branch of this tree; an emphatic NO to that. The trivial tree is not a backdoor to bypass maintainers. Actual code changes do not get to go through any tree but the maintainer tree unless explicitly ACKed.

Agreed, I don't want trivial patches to ext4 either (a) polluting my inbox, or (b) sneaking in behind my back in the trivial tree.

Joe, please just stop the madness.

Thanks,

- Ted

#52 lore raw

Re: about the flood of trivial patches and the Code of Conduct (was: Re: [PATCH 19/25] sched: Use bool function return values of true/false not 1/0)

In reply to Steven Rostedt
Quoted 27 lines · Steven Rostedt
Quoted 9 lines · Rafael J. Wysocki
Quoted 5 lines

As per the other branch of this tree; an emphatic NO to that. The trivial tree is not a backdoor to bypass maintainers. Actual code changes do not get to go through any tree but the maintainer tree unless explicitly ACKed.

Well, practically speaking, that would make changes like the recent clockevents_notify() removal very difficult to carry out. Also there is some natural cross-talk between certain subsystems.

I would not call the clockevents_notify() series "trivial". More advanced clean ups that are system wide, would be different, because you are changing the way the code works. The maintainers must be Cc'd, but sometimes I find those changes are very hard to get acks from everyone. But again, the change is a non trivial clean up and has other reasons for going in than just to make the code look nice.

Quoted 4 lines

Different matter is the real value of tree-wide cleanup changes. If code is old enough it often is better to leave it alone, even though it may be doing things that we don't usually do nowadays.

Or maybe it's a good time to rewrite that code such that everyone can understand it today ;-)

Quoted 1 line
Quoted 6 lines
Quoted 3 lines

Or things that new patches are not supposed to do, for that matter, so I generally don't like the "checkpatch.pl error fix" changes in the old code.

I totally agree with that. But for non trivial clean ups, old code should be updated too.

Well, there still is some risk of introducing real bugs this way (I *have* seen "trivial cleanups" that broke things) and is it really worth it?

Besides, old code is somewhat like an ancient building. Yes, it needs to be kept in a good shape, but you won't replace bricks in it just because they are old, will you?

Rafael

#53 lore raw

Re: about the flood of trivial patches and the Code of Conduct (was: Re: [PATCH 19/25] sched: Use bool function return values of true/false not 1/0)

Quoted 3 lines · Rafael J. Wysocki

old code is somewhat like an ancient building. Yes, it needs to be kept in a good shape, but you won't replace bricks in it just because they are old, will you?

No, but you do have to replace/repoint the mortar as it ages.

Here in SoCal, we also have to do structural work on UnReinforced Masonry (URM) buildings to avoid loss of life when the ground moves underneath us.

A small story:

There's a guy a few blocks from me that wants to open a restaurant in a ~70 year old building. He's been fighting the city permitting process for over a year now because he rented a well built, but old, URM building with double courses of brick walls that had already had some structural improvements.

http://la.eater.com/2014/3/18/6260975/brixton-restaurant-going-into-the-joker-in-santa-monica

He added some windows where previously windows had been located but also had been covered and filled-in with over time. The place had been a dark, smoky dive bar.

City went into a mode where any change to the building was unacceptable unless _every_ element of the building was brought up to new construction standards.

It's a silly and expensive process for him and an overall loss for the city because of delays in creation of a tax-paying business.

Santa Monica, my home town...

Anyway, code isn't a lot like a building.

It's easy to prove that some source code change doesn't cause a change in object output.

It's not so easy in a physical structure.

#54 lore raw

Re: about the flood of trivial patches and the Code of Conduct (was: Re: [PATCH 19/25] sched: Use bool function return values of true/false not 1/0)

In reply to Rafael J. Wysocki
Quoted 3 lines

Besides, old code is somewhat like an ancient building. Yes, it needs to be kept in a good shape, but you won't replace bricks in it just because they are old, will you?

When they matter to the integrity and they are likely to be full of internal cracks and holes you do.

What concerns me more is that we now have lots of old driver code in the kernel that nobody uses, that nobody cares about in reality but which has been turd polished to the point that at casual glance it looks maintained and useful but probably hasn't been tested in years.

Alan