Re: [PATCH] vhost: replace % with & on data path

2015-11-30 Thread Joe Perches
On Mon, 2015-11-30 at 10:34 +0200, Michael S. Tsirkin wrote:
> We know vring num is a power of 2, so use &
> to mask the high bits.
[]
> diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
[]
> @@ -1366,10 +1366,12 @@ int vhost_get_vq_desc(struct vhost_virtqueue *vq,
>   /* Only get avail ring entries after they have been exposed by guest. */
>   smp_rmb();
>  
> + }

?

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch] vfio: make an array larger

2015-11-04 Thread Joe Perches
On Wed, 2015-11-04 at 16:26 +0300, Dan Carpenter wrote:
> Smatch complains about a possible out of bounds error:
> 
>   drivers/vfio/pci/vfio_pci_config.c:1241 vfio_cap_init()
>   error: buffer overflow 'pci_cap_length' 20 <= 20
> 
> Fix this by making the array larger.
> 
> Signed-off-by: Dan Carpenter 
> 
> diff --git a/drivers/vfio/pci/vfio_pci_config.c 
> b/drivers/vfio/pci/vfio_pci_config.c
[]
> @@ -46,7 +46,7 @@
>   *   0: Removed from the user visible capability list
>   *   FF: Variable length
>   */
> -static u8 pci_cap_length[] = {
> +static u8 pci_cap_length[PCI_CAP_ID_MAX + 1] = {
>   [PCI_CAP_ID_BASIC]  = PCI_STD_HEADER_SIZEOF, /* pci config header */
>   [PCI_CAP_ID_PM] = PCI_PM_SIZEOF,
>   [PCI_CAP_ID_AGP]= PCI_AGP_SIZEOF,

Doesn't the same thing happen with pci_ext_cap_length?
Both array declarations might be better as const.

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V2 1/3] kvm: use kmalloc() instead of kzalloc() during iodev register/unregister

2015-08-25 Thread Joe Perches
On Tue, 2015-08-25 at 15:47 +0800, Jason Wang wrote:
 All fields of kvm_io_range were initialized or copied explicitly
 afterwards. So switch to use kmalloc().

Is there any compiler added alignment padding
in either structure?  If so, those padding
areas would now be uninitialized and may leak
kernel data if copied to user-space.

 diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
[]
 @@ -3248,7 +3248,7 @@ int kvm_io_bus_register_dev(struct kvm *kvm, enum 
 kvm_bus bus_idx, gpa_t addr,
   if (bus-dev_count - bus-ioeventfd_count  NR_IOBUS_DEVS - 1)
   return -ENOSPC;
  
 - new_bus = kzalloc(sizeof(*bus) + ((bus-dev_count + 1) *
 + new_bus = kmalloc(sizeof(*bus) + ((bus-dev_count + 1) *
 sizeof(struct kvm_io_range)), GFP_KERNEL);
   if (!new_bus)
   return -ENOMEM;
 @@ -3280,7 +3280,7 @@ int kvm_io_bus_unregister_dev(struct kvm *kvm, enum 
 kvm_bus bus_idx,
   if (r)
   return r;
  
 - new_bus = kzalloc(sizeof(*bus) + ((bus-dev_count - 1) *
 + new_bus = kmalloc(sizeof(*bus) + ((bus-dev_count - 1) *
 sizeof(struct kvm_io_range)), GFP_KERNEL);
   if (!new_bus)
   return -ENOMEM;



--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V2 1/3] kvm: use kmalloc() instead of kzalloc() during iodev register/unregister

2015-08-25 Thread Joe Perches
On Wed, 2015-08-26 at 13:39 +0800, Jason Wang wrote:
 
 On 08/25/2015 11:29 PM, Joe Perches wrote:
  On Tue, 2015-08-25 at 15:47 +0800, Jason Wang wrote:
   All fields of kvm_io_range were initialized or copied explicitly
   afterwards. So switch to use kmalloc().
  Is there any compiler added alignment padding
  in either structure?  If so, those padding
  areas would now be uninitialized and may leak
  kernel data if copied to user-space.
 
 I get your concern, but I don't a way to copy them to userspace, did you?

I didn't look.

I just wanted you to be aware there's a difference
and a reason why kzalloc might be used even though
all structure members are initialized.


--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 00/25] treewide: Use bool function return values of true/false not 1/0

2015-03-30 Thread 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 ++--
 net/netfilter/ipset/ip_set_hash_netport.c|  8 ++--
 net/netfilter/ipset/ip_set_hash_netportnet.c |  8 ++--
 net/netfilter/xt_connlimit.c |  2 +-
 net/netfilter/xt_hashlimit.c |  2 +-
 net/netfilter/xt_ipcomp.c|  2 +-
 security/apparmor/file.c |  8 ++--
 security/apparmor/policy.c   | 10 ++--
 sound/soc/codecs/wm5100-tables.c | 12 ++---
 55 files changed, 178 insertions(+), 176 deletions(-)

-- 
2.1.2

--
To unsubscribe from this list: send the line unsubscribe kvm-ppc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

2015-03-30 Thread Joe Perches
Use the normal return values for bool functions

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

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

--
To unsubscribe from this list: send the line unsubscribe kvm-ppc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 00/25] treewide: Use bool function return values of true/false not 1/0

2015-03-30 Thread 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 ++--
 net/netfilter/ipset/ip_set_hash_netport.c|  8 ++--
 net/netfilter/ipset/ip_set_hash_netportnet.c |  8 ++--
 net/netfilter/xt_connlimit.c |  2 +-
 net/netfilter/xt_hashlimit.c |  2 +-
 net/netfilter/xt_ipcomp.c|  2 +-
 security/apparmor/file.c |  8 ++--
 security/apparmor/policy.c   | 10 ++--
 sound/soc/codecs/wm5100-tables.c | 12 ++---
 55 files changed, 178 insertions(+), 176 deletions(-)

-- 
2.1.2

--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

2015-03-30 Thread Joe Perches
Use the normal return values for bool functions

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

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

--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

2015-03-30 Thread Joe Perches
Use the normal return values for bool functions

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

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

--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

2015-03-30 Thread Joe Perches
Use the normal return values for bool functions

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

diff --git a/arch/x86/include/asm/archrandom.h 
b/arch/x86/include/asm/archrandom.h
index 69f1366..7abcd71 100644
--- a/arch/x86/include/asm/archrandom.h
+++ b/arch/x86/include/asm/archrandom.h
@@ -126,7 +126,7 @@ static inline int rdrand_long(unsigned long *v)
 
 static inline bool rdseed_long(unsigned long *v)
 {
-   return 0;
+   return false;
 }
 
 #endif  /* CONFIG_ARCH_RANDOM */
diff --git a/arch/x86/include/asm/dma-mapping.h 
b/arch/x86/include/asm/dma-mapping.h
index 808dae6..efac032 100644
--- a/arch/x86/include/asm/dma-mapping.h
+++ b/arch/x86/include/asm/dma-mapping.h
@@ -77,7 +77,7 @@ extern phys_addr_t dma_to_phys(struct device *dev, dma_addr_t 
daddr);
 static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t 
size)
 {
if (!dev-dma_mask)
-   return 0;
+   return false;
 
return addr + size - 1 = *dev-dma_mask;
 }
diff --git a/arch/x86/include/asm/kvm_para.h b/arch/x86/include/asm/kvm_para.h
index e62cf89..c1adf33 100644
--- a/arch/x86/include/asm/kvm_para.h
+++ b/arch/x86/include/asm/kvm_para.h
@@ -115,7 +115,7 @@ static inline void kvm_spinlock_init(void)
 
 static inline bool kvm_para_available(void)
 {
-   return 0;
+   return false;
 }
 
 static inline unsigned int kvm_arch_para_features(void)
diff --git a/arch/x86/kvm/cpuid.h b/arch/x86/kvm/cpuid.h
index 4452eed..2622846 100644
--- a/arch/x86/kvm/cpuid.h
+++ b/arch/x86/kvm/cpuid.h
@@ -26,7 +26,7 @@ static inline bool guest_cpuid_has_xsave(struct kvm_vcpu 
*vcpu)
struct kvm_cpuid_entry2 *best;
 
if (!static_cpu_has(X86_FEATURE_XSAVE))
-   return 0;
+   return false;
 
best = kvm_find_cpuid_entry(vcpu, 1, 0);
return best  (best-ecx  bit(X86_FEATURE_XSAVE));
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index ae4f6d3..ab121db 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -7318,21 +7318,21 @@ static bool nested_vmx_exit_handled_io(struct kvm_vcpu 
*vcpu,
else if (port  0x1)
bitmap = vmcs12-io_bitmap_b;
else
-   return 1;
+   return true;
bitmap += (port  0x7fff) / 8;
 
if (last_bitmap != bitmap)
if (kvm_read_guest(vcpu-kvm, bitmap, b, 1))
-   return 1;
+   return true;
if (b  (1  (port  7)))
-   return 1;
+   return true;
 
port++;
size--;
last_bitmap = bitmap;
}
 
-   return 0;
+   return false;
 }
 
 /*
@@ -7348,7 +7348,7 @@ static bool nested_vmx_exit_handled_msr(struct kvm_vcpu 
*vcpu,
gpa_t bitmap;
 
if (!nested_cpu_has(vmcs12, CPU_BASED_USE_MSR_BITMAPS))
-   return 1;
+   return true;
 
/*
 * The MSR_BITMAP page is divided into four 1024-byte bitmaps,
@@ -7367,10 +7367,10 @@ static bool nested_vmx_exit_handled_msr(struct kvm_vcpu 
*vcpu,
if (msr_index  1024*8) {
unsigned char b;
if (kvm_read_guest(vcpu-kvm, bitmap + msr_index/8, b, 1))
-   return 1;
+   return true;
return 1  (b  (msr_index  7));
} else
-   return 1; /* let L1 handle the wrong parameter */
+   return true; /* let L1 handle the wrong parameter */
 }
 
 /*
@@ -7392,7 +7392,7 @@ static bool nested_vmx_exit_handled_cr(struct kvm_vcpu 
*vcpu,
case 0:
if (vmcs12-cr0_guest_host_mask 
(val ^ vmcs12-cr0_read_shadow))
-   return 1;
+   return true;
break;
case 3:
if ((vmcs12-cr3_target_count = 1 
@@ -7403,37 +7403,37 @@ static bool nested_vmx_exit_handled_cr(struct kvm_vcpu 
*vcpu,
vmcs12-cr3_target_value2 == val) ||
(vmcs12-cr3_target_count = 4 
vmcs12-cr3_target_value3 == val))
-   return 0;
+   return false;
if (nested_cpu_has(vmcs12, CPU_BASED_CR3_LOAD_EXITING))
-   return 1;
+   return true;
break;
case 4:
if (vmcs12

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

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

Hey Ben.

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

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

cheers.  Joe

--
To unsubscribe from this list: send the line unsubscribe kvm-ppc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

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

[etc...]

 Why, and why these in particular?

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

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

(there are only a couple of those though)

These are all the remaining instances in the
kernel tree.

--
To unsubscribe from this list: send the line unsubscribe kvm-ppc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

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

[etc...]

 Why, and why these in particular?

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

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

(there are only a couple of those though)

These are all the remaining instances in the
kernel tree.

--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

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

Hey Ben.

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

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

cheers.  Joe

--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/8] KVM: x86: return bool from kvm_apic_match*()

2015-01-29 Thread Joe Perches
On Thu, 2015-01-29 at 22:48 +0100, Radim Krčmář wrote:
 And don't export the internal ones while at it.
[]
 -int kvm_apic_match_logical_addr(struct kvm_lapic *apic, u32 mda)
 +static bool kvm_apic_match_logical_addr(struct kvm_lapic *apic, u32 mda)
  {
   int result = 0;
   u32 logical_id;
 @@ -626,7 +626,7 @@ int kvm_apic_match_logical_addr(struct kvm_lapic *apic, 
 u32 mda)
   return result;
  }
  
 -int kvm_apic_match_dest(struct kvm_vcpu *vcpu, struct kvm_lapic *source,
 +bool kvm_apic_match_dest(struct kvm_vcpu *vcpu, struct kvm_lapic *source,
  int short_hand, unsigned int dest, int dest_mode)
  {
   int result = 0;

Perhaps these result variables should be bool.


--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] vhost-scsi: Depend on NET for memcpy_fromiovec

2013-05-15 Thread Joe Perches
On Thu, 2013-05-16 at 13:04 +0930, Rusty Russell wrote:
 Asias He as...@redhat.com writes:
  On Wed, May 15, 2013 at 02:47:53PM +0930, Rusty Russell wrote:
[]
  Other users are using memcpy_fromiovec and friends outside net. It seems
  a good idea to put it in a util library. e.g.  crypto/algif_skcipher.c
  which also depends on NET for it.

[]
 Subject: Hoist memcpy_fromiovec into lib/

You'll need the friends memcpy_toiovec too.

$ git grep -E \bmemcpy\w+iovec\w*
crypto/algif_hash.c:err = memcpy_toiovec(msg-msg_iov, ctx-result, len);
crypto/algif_skcipher.c:err = 
memcpy_fromiovec(page_address(sg_page(sg)) +
crypto/algif_skcipher.c:err = 
memcpy_fromiovec(page_address(sg_page(sg + i)),
drivers/dma/iovlock.c:#include net/tcp.h /* for memcpy_toiovec */
drivers/dma/iovlock.c:  return memcpy_toiovec(iov, kdata, len);
drivers/dma/iovlock.c:  err = memcpy_toiovec(iov, vaddr + offset, len);
drivers/isdn/mISDN/socket.c:if (memcpy_fromiovec(skb_put(skb, len), 
msg-msg_iov, len)) {
drivers/misc/vmw_vmci/vmci_queue_pair.c:err = 
memcpy_fromiovec((u8 *)va + page_o
drivers/misc/vmw_vmci/vmci_queue_pair.c:err = 
memcpy_toiovec(iov, (u8 *)va + pag


--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH next] kvm: Use pr_level

2012-06-27 Thread Joe Perches
On Wed, 2012-06-27 at 21:44 -0300, Marcelo Tosatti wrote:
 The advantage is the added prefix?

All messages are automatically prefixed.
For instance:

  -   printk(KERN_WARNING Fail to find correlated MSI-X entry!\n);
  +   pr_warn(Fail to find correlated MSI-X entry!\n);

Now has a prefix that describes the module from which
the message originates.

 $ grep limit Documentation/CodingStyle 
 The limit on the length of lines is 80 columns and this is a strongly
 preferred limit.

Read further:

However, never break user-visible strings such as
printk messages, because that breaks the ability to grep for them.

cheers, Joe


--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH next] kvm: Use pr_level

2012-06-13 Thread Joe Perches
Use a more current logging style.

Convert printks to pr_level.
Add pr_fmt.

All logging messages are now prefixed with
kvm: , kvm_intel:  or kvm_amd: 

Coalesce formats, align arguments.
Add a few missing newlines.

Signed-off-by: Joe Perches j...@perches.com
---
 arch/x86/kvm/cpuid.c   |4 +-
 arch/x86/kvm/lapic.c   |   16 
 arch/x86/kvm/mmu.c |   95 +--
 arch/x86/kvm/mmu_audit.c   |   35 
 arch/x86/kvm/paging_tmpl.h |   13 +++---
 arch/x86/kvm/svm.c |   27 ++--
 arch/x86/kvm/vmx.c |   75 +++---
 arch/x86/kvm/x86.c |   31 +++---
 virt/kvm/assigned-dev.c|   31 +++---
 virt/kvm/ioapic.c  |   25 +++
 virt/kvm/ioapic.h  |4 +-
 virt/kvm/iommu.c   |   36 
 virt/kvm/irq_comm.c|8 ++-
 virt/kvm/kvm_main.c|   17 
 14 files changed, 215 insertions(+), 202 deletions(-)

diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
index 7df1c6d..1323ffd 100644
--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86/kvm/cpuid.c
@@ -12,6 +12,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME :  fmt
+
 #include linux/kvm_host.h
 #include linux/module.h
 #include linux/vmalloc.h
@@ -72,7 +74,7 @@ static void cpuid_fix_nx_cap(struct kvm_vcpu *vcpu)
}
if (entry  (entry-edx  (1  20))  !is_efer_nx()) {
entry-edx = ~(1  20);
-   printk(KERN_INFO kvm: guest NX capability removed\n);
+   pr_info(guest NX capability removed\n);
}
 }
 
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 93c1574..0b3264f 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -18,6 +18,8 @@
  * the COPYING file in the top-level directory.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME :  fmt
+
 #include linux/kvm_host.h
 #include linux/kvm.h
 #include linux/mm.h
@@ -53,7 +55,7 @@
 
 #define APIC_BUS_CYCLE_NS 1
 
-/* #define apic_debug(fmt,arg...) printk(KERN_WARNING fmt,##arg) */
+/* #define apic_debug(fmt,arg...) pr_warn(fmt,##arg) */
 #define apic_debug(fmt, arg...)
 
 #define APIC_LVT_NUM   6
@@ -470,8 +472,7 @@ static int __apic_accept_irq(struct kvm_lapic *apic, int 
delivery_mode,
break;
 
default:
-   printk(KERN_ERR TODO: unsupported delivery mode %x\n,
-  delivery_mode);
+   pr_err(TODO: unsupported delivery mode %x\n, delivery_mode);
break;
}
return result;
@@ -648,8 +649,8 @@ static int apic_reg_read(struct kvm_lapic *apic, u32 
offset, int len,
memcpy(data, (char *)result + alignment, len);
break;
default:
-   printk(KERN_ERR Local APIC read with len = %x, 
-  should be 1,2, or 4 instead\n, len);
+   pr_err(Local APIC read with len = %x, should be 1,2, or 4 
instead\n,
+  len);
break;
}
return 0;
@@ -712,8 +713,7 @@ static void start_apic_timer(struct kvm_lapic *apic)
 
if (apic-lapic_timer.period  min_period) {
pr_info_ratelimited(
-   kvm: vcpu %i: requested %lld ns 
-   lapic timer period limited to %lld ns\n,
+   vcpu %i: requested %lld ns lapic timer 
period limited to %lld ns\n,
apic-vcpu-vcpu_id,
apic-lapic_timer.period, min_period);
apic-lapic_timer.period = min_period;
@@ -1175,7 +1175,7 @@ int kvm_create_lapic(struct kvm_vcpu *vcpu)
 
apic-regs = (void *)get_zeroed_page(GFP_KERNEL);
if (!apic-regs) {
-   printk(KERN_ERR malloc apic regs error for vcpu %x\n,
+   pr_err(malloc apic regs error for vcpu %x\n,
   vcpu-vcpu_id);
goto nomem_free_apic;
}
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 24dd43d..ab0dbfd 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -18,6 +18,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME :  fmt
+
 #include irq.h
 #include mmu.h
 #include x86.h
@@ -63,13 +65,31 @@ enum {
 
 #ifdef MMU_DEBUG
 
-#define pgprintk(x...) do { if (dbg) printk(x); } while (0)
-#define rmap_printk(x...) do { if (dbg) printk(x); } while (0)
+#define DEBUG
+
+#define pg_dbg(fmt, ...)   \
+do {   \
+   if (dbg)\
+   pr_debug(%s:  fmt, __func__, ##__VA_ARGS__);  \
+} while (0)
+#define rmap_dbg(fmt, ...) \
+do {   \
+   if (dbg

Re: [PATCH 8/8] arch/x86: use printk_ratelimited instead of printk_ratelimit

2011-06-06 Thread Joe Perches
On Tue, 2011-06-07 at 12:41 +0930, Rusty Russell wrote:
 On Mon, 6 Jun 2011 10:11:53 +0200, richard -rw- weinberger 
 richard.weinber...@gmail.com wrote:
  printk_ratelimited() needs DEFINE_RATELIMIT_STATE() which is defined
  in ratelimit.h.
 Yech.  I'm assuming that making printk.h include ratelimit.h makes a
 nasty mess?

Yup.

I proposed moving the foo_ratelimited dclarations to
ratelimited.h without any comment.

http://lkml.org/lkml/2010/2/18/377

--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/4] treewide: Remove asmlinkage from printk

2011-05-25 Thread Joe Perches
Remove the now unnecessary asmlinkage attribute from the various
printk prototypes and uses.

Signed-off-by: Joe Perches j...@perches.com
---
 arch/arm/kernel/early_printk.c |2 +-
 arch/ia64/kvm/vmm.c|2 +-
 arch/x86/kernel/early_printk.c |2 +-
 include/linux/printk.h |6 +++---
 kernel/printk.c|6 +++---
 5 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/arch/arm/kernel/early_printk.c b/arch/arm/kernel/early_printk.c
index 85aa2b2..46798d5 100644
--- a/arch/arm/kernel/early_printk.c
+++ b/arch/arm/kernel/early_printk.c
@@ -36,7 +36,7 @@ static struct console early_console = {
.index =-1,
 };
 
-asmlinkage void early_printk(const char *fmt, ...)
+void early_printk(const char *fmt, ...)
 {
char buf[512];
int n;
diff --git a/arch/ia64/kvm/vmm.c b/arch/ia64/kvm/vmm.c
index f0b9cac..40331ac 100644
--- a/arch/ia64/kvm/vmm.c
+++ b/arch/ia64/kvm/vmm.c
@@ -81,7 +81,7 @@ static void vcpu_debug_exit(struct kvm_vcpu *vcpu)
local_irq_restore(psr);
 }
 
-asmlinkage int printk(const char *fmt, ...)
+int printk(const char *fmt, ...)
 {
struct kvm_vcpu *vcpu = current_vcpu;
va_list args;
diff --git a/arch/x86/kernel/early_printk.c b/arch/x86/kernel/early_printk.c
index cd28a35..b9b323a 100644
--- a/arch/x86/kernel/early_printk.c
+++ b/arch/x86/kernel/early_printk.c
@@ -173,7 +173,7 @@ static struct console early_serial_console = {
 static struct console *early_console = early_vga_console;
 static int __initdata early_console_initialized;
 
-asmlinkage void early_printk(const char *fmt, ...)
+void early_printk(const char *fmt, ...)
 {
char buf[512];
int n;
diff --git a/include/linux/printk.h b/include/linux/printk.h
index 3736545..e52bc4b 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -90,16 +90,16 @@ int no_printk(const char *fmt, ...)
return 0;
 }
 
-extern asmlinkage __attribute__ ((format (printf, 1, 2)))
+extern __attribute__ ((format (printf, 1, 2)))
 void early_printk(const char *fmt, ...);
 
 extern int printk_needs_cpu(int cpu);
 extern void printk_tick(void);
 
 #ifdef CONFIG_PRINTK
-asmlinkage __attribute__ ((format (printf, 1, 0)))
+__attribute__ ((format (printf, 1, 0)))
 int vprintk(const char *fmt, va_list args);
-asmlinkage __attribute__ ((format (printf, 1, 2))) __cold
+__attribute__ ((format (printf, 1, 2))) __cold
 int printk(const char *fmt, ...);
 
 /*
diff --git a/kernel/printk.c b/kernel/printk.c
index da8ca81..735056c 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -46,7 +46,7 @@
 /*
  * Architectures can override it:
  */
-void asmlinkage __attribute__((weak)) early_printk(const char *fmt, ...)
+void __attribute__((weak)) early_printk(const char *fmt, ...)
 {
 }
 
@@ -704,7 +704,7 @@ static int have_callable_console(void)
  * See the vsnprintf() documentation for format string extensions over C99.
  */
 
-asmlinkage int printk(const char *fmt, ...)
+int printk(const char *fmt, ...)
 {
va_list args;
int r;
@@ -794,7 +794,7 @@ static inline void printk_delay(void)
}
 }
 
-asmlinkage int vprintk(const char *fmt, va_list args)
+int vprintk(const char *fmt, va_list args)
 {
int printed_len = 0;
int current_log_level = default_message_loglevel;
-- 
1.7.4.rc3

--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/4] printk: cleanups of direct includes

2011-05-25 Thread Joe Perches
printk.h is a subfile of kernel.h, do not allow it to
be included directly.

Joe Perches (4):
  treewide: Remove direct includes of printk.h
  staging: Remove direct includes of printk.h
  printk: Don't allow direct inclusion
  treewide: Remove asmlinkage from printk

 arch/arm/kernel/early_printk.c|2 +-
 arch/ia64/kvm/vmm.c   |2 +-
 arch/x86/kernel/early_printk.c|2 +-
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c |1 -
 drivers/staging/brcm80211/util/bcmutils.c |1 -
 drivers/staging/usbip/usbip_common.h  |2 +-
 fs/ext4/inode.c   |1 -
 include/linux/oprofile.h  |2 +-
 include/linux/printk.h|   10 +++---
 kernel/printk.c   |6 +++---
 kernel/sysctl.c   |3 +--
 11 files changed, 16 insertions(+), 16 deletions(-)

-- 
1.7.4.rc3

--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] KVM: SVM: Make dump_vmcb static, reduce text

2011-04-24 Thread Joe Perches
dump_vmcb isn't used outside this module, make it static.
Shrink text and object by ~1% by standardizing formats.

$ size arch/x86/kvm/svm.o*
   textdata bss dec hex filename
  52910 580   10072   63562f84a arch/x86/kvm/svm.o.new
  53563 580   10072   64215fad7 arch/x86/kvm/svm.o.old

Signed-off-by: Joe Perches j...@perches.com
---
 arch/x86/kvm/svm.c |  176 
 1 files changed, 94 insertions(+), 82 deletions(-)

diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index a6bf2ad..1b9f67e 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -3188,97 +3188,109 @@ static int (*svm_exit_handlers[])(struct vcpu_svm 
*svm) = {
[SVM_EXIT_NPF]  = pf_interception,
 };
 
-void dump_vmcb(struct kvm_vcpu *vcpu)
+static void dump_vmcb(struct kvm_vcpu *vcpu)
 {
struct vcpu_svm *svm = to_svm(vcpu);
struct vmcb_control_area *control = svm-vmcb-control;
struct vmcb_save_area *save = svm-vmcb-save;
 
pr_err(VMCB Control Area:\n);
-   pr_err(cr_read:%04x\n, control-intercept_cr  0x);
-   pr_err(cr_write:   %04x\n, control-intercept_cr  16);
-   pr_err(dr_read:%04x\n, control-intercept_dr  0x);
-   pr_err(dr_write:   %04x\n, control-intercept_dr  16);
-   pr_err(exceptions: %08x\n, control-intercept_exceptions);
-   pr_err(intercepts: %016llx\n, control-intercept);
-   pr_err(pause filter count: %d\n, control-pause_filter_count);
-   pr_err(iopm_base_pa:   %016llx\n, control-iopm_base_pa);
-   pr_err(msrpm_base_pa:  %016llx\n, control-msrpm_base_pa);
-   pr_err(tsc_offset: %016llx\n, control-tsc_offset);
-   pr_err(asid:   %d\n, control-asid);
-   pr_err(tlb_ctl:%d\n, control-tlb_ctl);
-   pr_err(int_ctl:%08x\n, control-int_ctl);
-   pr_err(int_vector: %08x\n, control-int_vector);
-   pr_err(int_state:  %08x\n, control-int_state);
-   pr_err(exit_code:  %08x\n, control-exit_code);
-   pr_err(exit_info1: %016llx\n, control-exit_info_1);
-   pr_err(exit_info2: %016llx\n, control-exit_info_2);
-   pr_err(exit_int_info:  %08x\n, control-exit_int_info);
-   pr_err(exit_int_info_err:  %08x\n, control-exit_int_info_err);
-   pr_err(nested_ctl: %lld\n, control-nested_ctl);
-   pr_err(nested_cr3: %016llx\n, control-nested_cr3);
-   pr_err(event_inj:  %08x\n, control-event_inj);
-   pr_err(event_inj_err:  %08x\n, control-event_inj_err);
-   pr_err(lbr_ctl:%lld\n, control-lbr_ctl);
-   pr_err(next_rip:   %016llx\n, control-next_rip);
+   pr_err(%-20s%04x\n, cr_read:, control-intercept_cr  0x);
+   pr_err(%-20s%04x\n, cr_write:, control-intercept_cr  16);
+   pr_err(%-20s%04x\n, dr_read:, control-intercept_dr  0x);
+   pr_err(%-20s%04x\n, dr_write:, control-intercept_dr  16);
+   pr_err(%-20s%08x\n, exceptions:, control-intercept_exceptions);
+   pr_err(%-20s%016llx\n, intercepts:, control-intercept);
+   pr_err(%-20s%d\n, pause filter count:, control-pause_filter_count);
+   pr_err(%-20s%016llx\n, iopm_base_pa:, control-iopm_base_pa);
+   pr_err(%-20s%016llx\n, msrpm_base_pa:, control-msrpm_base_pa);
+   pr_err(%-20s%016llx\n, tsc_offset:, control-tsc_offset);
+   pr_err(%-20s%d\n, asid:, control-asid);
+   pr_err(%-20s%d\n, tlb_ctl:, control-tlb_ctl);
+   pr_err(%-20s%08x\n, int_ctl:, control-int_ctl);
+   pr_err(%-20s%08x\n, int_vector:, control-int_vector);
+   pr_err(%-20s%08x\n, int_state:, control-int_state);
+   pr_err(%-20s%08x\n, exit_code:, control-exit_code);
+   pr_err(%-20s%016llx\n, exit_info1:, control-exit_info_1);
+   pr_err(%-20s%016llx\n, exit_info2:, control-exit_info_2);
+   pr_err(%-20s%08x\n, exit_int_info:, control-exit_int_info);
+   pr_err(%-20s%08x\n, exit_int_info_err:, control-exit_int_info_err);
+   pr_err(%-20s%lld\n, nested_ctl:, control-nested_ctl);
+   pr_err(%-20s%016llx\n, nested_cr3:, control-nested_cr3);
+   pr_err(%-20s%08x\n, event_inj:, control-event_inj);
+   pr_err(%-20s%08x\n, event_inj_err:, control-event_inj_err);
+   pr_err(%-20s%lld\n, lbr_ctl:, control-lbr_ctl);
+   pr_err(%-20s%016llx\n, next_rip:, control-next_rip);
pr_err(VMCB State Save Area:\n);
-   pr_err(es:   s: %04x a: %04x l: %08x b: %016llx\n,
-   save-es.selector, save-es.attrib,
-   save-es.limit, save-es.base);
-   pr_err(cs:   s: %04x a: %04x l: %08x b: %016llx\n,
-   save-cs.selector, save-cs.attrib,
-   save-cs.limit, save-cs.base);
-   pr_err(ss:   s: %04x a: %04x l: %08x b: %016llx\n,
-   save-ss.selector, save-ss.attrib,
-   save-ss.limit, save-ss.base

[PATCH 49/49] virt/kvm/kvm_main.c: Use vzalloc

2010-11-04 Thread Joe Perches
Signed-off-by: Joe Perches j...@perches.com
---
 virt/kvm/kvm_main.c |   13 +++--
 1 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 5225052..c2a08e6e 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -604,13 +604,10 @@ int __kvm_set_memory_region(struct kvm *kvm,
/* Allocate if a slot is being created */
 #ifndef CONFIG_S390
if (npages  !new.rmap) {
-   new.rmap = vmalloc(npages * sizeof(*new.rmap));
-
+   new.rmap = vzalloc(npages * sizeof(*new.rmap));
if (!new.rmap)
goto out_free;
 
-   memset(new.rmap, 0, npages * sizeof(*new.rmap));
-
new.user_alloc = user_alloc;
new.userspace_addr = mem-userspace_addr;
}
@@ -633,14 +630,11 @@ int __kvm_set_memory_region(struct kvm *kvm,
  KVM_HPAGE_GFN_SHIFT(level));
lpages -= base_gfn  KVM_HPAGE_GFN_SHIFT(level);
 
-   new.lpage_info[i] = vmalloc(lpages * 
sizeof(*new.lpage_info[i]));
+   new.lpage_info[i] = vzalloc(lpages * 
sizeof(*new.lpage_info[i]));
 
if (!new.lpage_info[i])
goto out_free;
 
-   memset(new.lpage_info[i], 0,
-  lpages * sizeof(*new.lpage_info[i]));
-
if (base_gfn  (KVM_PAGES_PER_HPAGE(level) - 1))
new.lpage_info[i][0].write_count = 1;
if ((base_gfn+npages)  (KVM_PAGES_PER_HPAGE(level) - 1))
@@ -663,10 +657,9 @@ skip_lpage:
if ((new.flags  KVM_MEM_LOG_DIRTY_PAGES)  !new.dirty_bitmap) {
unsigned long dirty_bytes = kvm_dirty_bitmap_bytes(new);
 
-   new.dirty_bitmap = vmalloc(dirty_bytes);
+   new.dirty_bitmap = vzalloc(dirty_bytes);
if (!new.dirty_bitmap)
goto out_free;
-   memset(new.dirty_bitmap, 0, dirty_bytes);
/* destroy any largepage mappings for dirty tracking */
if (old.npages)
flush_shadow = 1;
-- 
1.7.3.1.g432b3.dirty

--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 05/49] arch/x86: Use vzalloc

2010-11-04 Thread Joe Perches
Signed-off-by: Joe Perches j...@perches.com
---
 arch/x86/kernel/microcode_amd.c |3 +--
 arch/x86/kvm/x86.c  |3 +--
 arch/x86/mm/pageattr-test.c |3 +--
 3 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/arch/x86/kernel/microcode_amd.c b/arch/x86/kernel/microcode_amd.c
index e1af7c0..d46e805 100644
--- a/arch/x86/kernel/microcode_amd.c
+++ b/arch/x86/kernel/microcode_amd.c
@@ -183,9 +183,8 @@ get_next_ucode(const u8 *buf, unsigned int size, unsigned 
int *mc_size)
return NULL;
}
 
-   mc = vmalloc(UCODE_MAX_SIZE);
+   mc = vzalloc(UCODE_MAX_SIZE);
if (mc) {
-   memset(mc, 0, UCODE_MAX_SIZE);
if (get_ucode_data(mc, buf + UCODE_CONTAINER_SECTION_HDR,
   total_size)) {
vfree(mc);
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 2288ad8..624d4da 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -3174,10 +3174,9 @@ int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm,
spin_unlock(kvm-mmu_lock);
 
r = -ENOMEM;
-   dirty_bitmap = vmalloc(n);
+   dirty_bitmap = vzalloc(n);
if (!dirty_bitmap)
goto out;
-   memset(dirty_bitmap, 0, n);
 
r = -ENOMEM;
slots = kzalloc(sizeof(struct kvm_memslots), GFP_KERNEL);
diff --git a/arch/x86/mm/pageattr-test.c b/arch/x86/mm/pageattr-test.c
index e1d1069..b008656 100644
--- a/arch/x86/mm/pageattr-test.c
+++ b/arch/x86/mm/pageattr-test.c
@@ -123,12 +123,11 @@ static int pageattr_test(void)
if (print)
printk(KERN_INFO CPA self-test:\n);
 
-   bm = vmalloc((max_pfn_mapped + 7) / 8);
+   bm = vzalloc((max_pfn_mapped + 7) / 8);
if (!bm) {
printk(KERN_ERR CPA Cannot vmalloc bitmap\n);
return -ENOMEM;
}
-   memset(bm, 0, (max_pfn_mapped + 7) / 8);
 
failed += print_split(sa);
srandom32(100);
-- 
1.7.3.1.g432b3.dirty

--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 03/49] arch/powerpc: Use vzalloc

2010-11-04 Thread Joe Perches
Signed-off-by: Joe Perches j...@perches.com
---
 arch/powerpc/kvm/book3s.c   |6 ++
 arch/powerpc/platforms/cell/spufs/lscsa_alloc.c |3 +--
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c
index e316847..4275463 100644
--- a/arch/powerpc/kvm/book3s.c
+++ b/arch/powerpc/kvm/book3s.c
@@ -1307,13 +1307,11 @@ struct kvm_vcpu *kvmppc_core_vcpu_create(struct kvm 
*kvm, unsigned int id)
int err = -ENOMEM;
unsigned long p;
 
-   vcpu_book3s = vmalloc(sizeof(struct kvmppc_vcpu_book3s));
+   vcpu_book3s = vzalloc(sizeof(struct kvmppc_vcpu_book3s));
if (!vcpu_book3s)
goto out;
 
-   memset(vcpu_book3s, 0, sizeof(struct kvmppc_vcpu_book3s));
-
-   vcpu_book3s-shadow_vcpu = (struct kvmppc_book3s_shadow_vcpu *)
+   vcpu_book3s-shadow_vcpu =
kzalloc(sizeof(*vcpu_book3s-shadow_vcpu), GFP_KERNEL);
if (!vcpu_book3s-shadow_vcpu)
goto free_vcpu;
diff --git a/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c 
b/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c
index a101abf..3b894f5 100644
--- a/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c
+++ b/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c
@@ -36,10 +36,9 @@ static int spu_alloc_lscsa_std(struct spu_state *csa)
struct spu_lscsa *lscsa;
unsigned char *p;
 
-   lscsa = vmalloc(sizeof(struct spu_lscsa));
+   lscsa = vzalloc(sizeof(struct spu_lscsa));
if (!lscsa)
return -ENOMEM;
-   memset(lscsa, 0, sizeof(struct spu_lscsa));
csa-lscsa = lscsa;
 
/* Set LS pages reserved to allow for user-space mapping. */
-- 
1.7.3.1.g432b3.dirty

--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 49/49] virt/kvm/kvm_main.c: Use vzalloc

2010-11-04 Thread Joe Perches
On Fri, 2010-11-05 at 13:25 +0900, Takuya Yoshikawa wrote:
 (2010/11/05 12:08), Joe Perches wrote:
  Signed-off-by: Joe Perchesj...@perches.com
  ---
virt/kvm/kvm_main.c |   13 +++--
1 files changed, 3 insertions(+), 10 deletions(-)
  
  diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
 
 Already changed to vzalloc(), see kvm.git.

Thanks.  No worries.

fyi: the kvm git isn't in MAINTAINERS.

Perhaps something like this is appropriate
---
 MAINTAINERS |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index ec7e4a4..73bfe4f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3443,6 +3443,7 @@ M:Avi Kivity a...@redhat.com
 M: Marcelo Tosatti mtosa...@redhat.com
 L: kvm@vger.kernel.org
 W: http://kvm.qumranet.com
+T: git git://git.kernel.org/pub/scm/virt/kvm/kvm.git
 S: Supported
 F: Documentation/*/kvm.txt
 F: arch/*/kvm/


--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 03/49] arch/powerpc: Use vzalloc

2010-11-04 Thread Joe Perches
Signed-off-by: Joe Perches j...@perches.com
---
 arch/powerpc/kvm/book3s.c   |6 ++
 arch/powerpc/platforms/cell/spufs/lscsa_alloc.c |3 +--
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c
index e316847..4275463 100644
--- a/arch/powerpc/kvm/book3s.c
+++ b/arch/powerpc/kvm/book3s.c
@@ -1307,13 +1307,11 @@ struct kvm_vcpu *kvmppc_core_vcpu_create(struct kvm 
*kvm, unsigned int id)
int err = -ENOMEM;
unsigned long p;
 
-   vcpu_book3s = vmalloc(sizeof(struct kvmppc_vcpu_book3s));
+   vcpu_book3s = vzalloc(sizeof(struct kvmppc_vcpu_book3s));
if (!vcpu_book3s)
goto out;
 
-   memset(vcpu_book3s, 0, sizeof(struct kvmppc_vcpu_book3s));
-
-   vcpu_book3s-shadow_vcpu = (struct kvmppc_book3s_shadow_vcpu *)
+   vcpu_book3s-shadow_vcpu =
kzalloc(sizeof(*vcpu_book3s-shadow_vcpu), GFP_KERNEL);
if (!vcpu_book3s-shadow_vcpu)
goto free_vcpu;
diff --git a/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c 
b/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c
index a101abf..3b894f5 100644
--- a/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c
+++ b/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c
@@ -36,10 +36,9 @@ static int spu_alloc_lscsa_std(struct spu_state *csa)
struct spu_lscsa *lscsa;
unsigned char *p;
 
-   lscsa = vmalloc(sizeof(struct spu_lscsa));
+   lscsa = vzalloc(sizeof(struct spu_lscsa));
if (!lscsa)
return -ENOMEM;
-   memset(lscsa, 0, sizeof(struct spu_lscsa));
csa-lscsa = lscsa;
 
/* Set LS pages reserved to allow for user-space mapping. */
-- 
1.7.3.1.g432b3.dirty

--
To unsubscribe from this list: send the line unsubscribe kvm-ppc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH next 00/16] treewide: Use static const char * const where possible

2010-09-13 Thread Joe Perches
Convert the uses that should be const of
char *foo[] = {bar, baz};
to
const char * const foo[] = {bar, baz};
or
static const char * const foo[] = {bar, baz};

Joe Perches (16):
  arch/alpha: Use static const char * const where possible
  arch/ia64: Use static const char * const where possible
  arch/microblaze: Use static const char * const where possible
  arch/x86: Use static const char * const where possible
  drivers/gpu: Use static const char * const where possible
  drivers/isdn: Use static const char * const where possible
  drivers/net: Use static const char * const where possible
  drivers/net/pcmcia: Use static const char * const where possible
  drivers/net/wireless: Use static const char * const where possible
  drivers/scsi: Use static const char * const where possible
  drivers/staging: Use static const char * const where possible
  drivers/usb: Use static const char * const where possible
  drivers/watchdog: Use static const char * const where possible
  fs: Use static const char * const where possible
  net/irda: Use static const char * const where possible
  sound: Use static const char * const where possible

 arch/alpha/kernel/err_ev6.c  |   12 +---
 arch/alpha/kernel/err_marvel.c   |   33 
 arch/alpha/kernel/err_titan.c|   35 ++---
 arch/alpha/kernel/osf_sys.c  |4 +-
 arch/ia64/kernel/palinfo.c   |2 +-
 arch/microblaze/kernel/heartbeat.c   |   10 +++---
 arch/microblaze/kernel/timer.c   |   12 
 arch/x86/kernel/smpboot.c|2 +-
 arch/x86/kvm/mmu.c   |2 +-
 drivers/gpu/drm/ttm/ttm_page_alloc.c |4 ++-
 drivers/isdn/pcbit/edss1.c   |2 +-
 drivers/isdn/pcbit/edss1.h   |2 +-
 drivers/net/3c515.c  |4 ++-
 drivers/net/eth16i.c |4 ++-
 drivers/net/pcmcia/3c589_cs.c|2 +-
 drivers/net/wireless/rt2x00/rt2x00debug.c|2 +-
 drivers/scsi/bfa/rport.c |4 ++-
 drivers/scsi/pcmcia/nsp_debug.c  |2 +-
 drivers/scsi/qla2xxx/qla_nx.c|4 +-
 drivers/scsi/qla4xxx/ql4_nx.c|2 +-
 drivers/staging/ath6kl/os/linux/ar6000_drv.c |   14 +-
 drivers/staging/bcm/Debug.c  |5 ++-
 drivers/usb/host/oxu210hp-hcd.c  |2 +-
 drivers/watchdog/machzwd.c   |2 +-
 fs/binfmt_flat.c |4 ++-
 include/net/irda/irlan_event.h   |2 +-
 net/irda/irlan/irlan_event.c |2 +-
 sound/core/misc.c|5 +---
 sound/core/pcm_native.c  |2 +-
 29 files changed, 99 insertions(+), 83 deletions(-)

-- 
1.7.3.rc1

--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH next 04/16] arch/x86: Use static const char * const where possible

2010-09-13 Thread Joe Perches
Signed-off-by: Joe Perches j...@perches.com
---
 arch/x86/kernel/smpboot.c |2 +-
 arch/x86/kvm/mmu.c|2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 63a1a55..b745b30 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -498,7 +498,7 @@ static void impress_friends(void)
 void __inquire_remote_apic(int apicid)
 {
unsigned i, regs[] = { APIC_ID  4, APIC_LVR  4, APIC_SPIV  4 };
-   char *names[] = { ID, VERSION, SPIV };
+   const char * const names[] = { ID, VERSION, SPIV };
int timeout;
u32 status;
 
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index d2dad65..2a7d567 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -56,7 +56,7 @@ enum {
AUDIT_POST_PTE_WRITE
 };
 
-char *audit_point_name[] = {
+const char * const audit_point_name[] = {
pre page fault,
post page fault,
pre pte write,
-- 
1.7.3.rc1

--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 05/11] arch/powerpc: Remove pr_level uses of KERN_level

2010-09-11 Thread Joe Perches
Signed-off-by: Joe Perches j...@perches.com
---
 arch/powerpc/kvm/emulate.c |4 ++--
 arch/powerpc/sysdev/pmi.c  |2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/kvm/emulate.c b/arch/powerpc/kvm/emulate.c
index 4568ec3..b83ba58 100644
--- a/arch/powerpc/kvm/emulate.c
+++ b/arch/powerpc/kvm/emulate.c
@@ -145,7 +145,7 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct 
kvm_vcpu *vcpu)
/* this default type might be overwritten by subcategories */
kvmppc_set_exit_type(vcpu, EMULATED_INST_EXITS);
 
-   pr_debug(KERN_INFO Emulating opcode %d / %d\n, get_op(inst), 
get_xop(inst));
+   pr_debug(Emulating opcode %d / %d\n, get_op(inst), get_xop(inst));
 
switch (get_op(inst)) {
case OP_TRAP:
@@ -275,7 +275,7 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct 
kvm_vcpu *vcpu)
{
u64 jd = get_tb() - vcpu-arch.dec_jiffies;
kvmppc_set_gpr(vcpu, rt, vcpu-arch.dec - jd);
-   pr_debug(KERN_INFO mfDEC: %x - %llx = %lx\n,
+   pr_debug(mfDEC: %x - %llx = %lx\n,
 vcpu-arch.dec, jd,
 kvmppc_get_gpr(vcpu, rt));
break;
diff --git a/arch/powerpc/sysdev/pmi.c b/arch/powerpc/sysdev/pmi.c
index 24a0bb9..4260f36 100644
--- a/arch/powerpc/sysdev/pmi.c
+++ b/arch/powerpc/sysdev/pmi.c
@@ -114,7 +114,7 @@ static void pmi_notify_handlers(struct work_struct *work)
 
spin_lock(data-handler_spinlock);
list_for_each_entry(handler, data-handler, node) {
-   pr_debug(KERN_INFO pmi: notifying handler %p\n, handler);
+   pr_debug(pmi: notifying handler %p\n, handler);
if (handler-type == data-msg.type)
handler-handle_pmi_message(data-msg);
}
-- 
1.7.3.rc1

--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 05/11] arch/powerpc: Remove pr_level uses of KERN_level

2010-09-11 Thread Joe Perches
Signed-off-by: Joe Perches j...@perches.com
---
 arch/powerpc/kvm/emulate.c |4 ++--
 arch/powerpc/sysdev/pmi.c  |2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/kvm/emulate.c b/arch/powerpc/kvm/emulate.c
index 4568ec3..b83ba58 100644
--- a/arch/powerpc/kvm/emulate.c
+++ b/arch/powerpc/kvm/emulate.c
@@ -145,7 +145,7 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct 
kvm_vcpu *vcpu)
/* this default type might be overwritten by subcategories */
kvmppc_set_exit_type(vcpu, EMULATED_INST_EXITS);
 
-   pr_debug(KERN_INFO Emulating opcode %d / %d\n, get_op(inst), 
get_xop(inst));
+   pr_debug(Emulating opcode %d / %d\n, get_op(inst), get_xop(inst));
 
switch (get_op(inst)) {
case OP_TRAP:
@@ -275,7 +275,7 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct 
kvm_vcpu *vcpu)
{
u64 jd = get_tb() - vcpu-arch.dec_jiffies;
kvmppc_set_gpr(vcpu, rt, vcpu-arch.dec - jd);
-   pr_debug(KERN_INFO mfDEC: %x - %llx = %lx\n,
+   pr_debug(mfDEC: %x - %llx = %lx\n,
 vcpu-arch.dec, jd,
 kvmppc_get_gpr(vcpu, rt));
break;
diff --git a/arch/powerpc/sysdev/pmi.c b/arch/powerpc/sysdev/pmi.c
index 24a0bb9..4260f36 100644
--- a/arch/powerpc/sysdev/pmi.c
+++ b/arch/powerpc/sysdev/pmi.c
@@ -114,7 +114,7 @@ static void pmi_notify_handlers(struct work_struct *work)
 
spin_lock(data-handler_spinlock);
list_for_each_entry(handler, data-handler, node) {
-   pr_debug(KERN_INFO pmi: notifying handler %p\n, handler);
+   pr_debug(pmi: notifying handler %p\n, handler);
if (handler-type == data-msg.type)
handler-handle_pmi_message(data-msg);
}
-- 
1.7.3.rc1

--
To unsubscribe from this list: send the line unsubscribe kvm-ppc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 03/36] arch/powerpc: Remove unnecessary casts of private_data

2010-07-12 Thread Joe Perches
Signed-off-by: Joe Perches j...@perches.com
---
 arch/powerpc/kvm/timing.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/kvm/timing.c b/arch/powerpc/kvm/timing.c
index 7037855..46fa04f 100644
--- a/arch/powerpc/kvm/timing.c
+++ b/arch/powerpc/kvm/timing.c
@@ -182,7 +182,7 @@ static ssize_t kvmppc_exit_timing_write(struct file *file,
}
 
if (c == 'c') {
-   struct seq_file *seqf = (struct seq_file *)file-private_data;
+   struct seq_file *seqf = file-private_data;
struct kvm_vcpu *vcpu = seqf-private;
/* Write does not affect our buffers previously generated with
 * show. seq_file is locked here to prevent races of init with
-- 
1.7.1.337.g6068.dirty

--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 02/21] arch/powerpc: Remove unnecessary kmalloc casts

2010-05-31 Thread Joe Perches
Signed-off-by: Joe Perches j...@perches.com
---
 arch/powerpc/kernel/nvram_64.c |3 +--
 arch/powerpc/kvm/book3s.c  |4 ++--
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c
index 9cf197f..99c6dab 100644
--- a/arch/powerpc/kernel/nvram_64.c
+++ b/arch/powerpc/kernel/nvram_64.c
@@ -502,8 +502,7 @@ static int __init nvram_scan_partitions(void)
   detected: 0-length partition\n);
goto out;
}
-   tmp_part = (struct nvram_partition *)
-   kmalloc(sizeof(struct nvram_partition), GFP_KERNEL);
+   tmp_part = kmalloc(sizeof(struct nvram_partition), GFP_KERNEL);
err = -ENOMEM;
if (!tmp_part) {
printk(KERN_ERR nvram_scan_partitions: kmalloc 
failed\n);
diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c
index b998abf..2a8b9b6 100644
--- a/arch/powerpc/kvm/book3s.c
+++ b/arch/powerpc/kvm/book3s.c
@@ -1248,8 +1248,8 @@ struct kvm_vcpu *kvmppc_core_vcpu_create(struct kvm *kvm, 
unsigned int id)
 
memset(vcpu_book3s, 0, sizeof(struct kvmppc_vcpu_book3s));
 
-   vcpu_book3s-shadow_vcpu = (struct kvmppc_book3s_shadow_vcpu *)
-   kzalloc(sizeof(*vcpu_book3s-shadow_vcpu), GFP_KERNEL);
+   vcpu_book3s-shadow_vcpu = kzalloc(sizeof(*vcpu_book3s-shadow_vcpu),
+  GFP_KERNEL);
if (!vcpu_book3s-shadow_vcpu)
goto free_vcpu;
 
-- 
1.7.0.3.311.g6a6955

--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 02/21] arch/powerpc: Remove unnecessary kmalloc casts

2010-05-31 Thread Joe Perches
Signed-off-by: Joe Perches j...@perches.com
---
 arch/powerpc/kernel/nvram_64.c |3 +--
 arch/powerpc/kvm/book3s.c  |4 ++--
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c
index 9cf197f..99c6dab 100644
--- a/arch/powerpc/kernel/nvram_64.c
+++ b/arch/powerpc/kernel/nvram_64.c
@@ -502,8 +502,7 @@ static int __init nvram_scan_partitions(void)
   detected: 0-length partition\n);
goto out;
}
-   tmp_part = (struct nvram_partition *)
-   kmalloc(sizeof(struct nvram_partition), GFP_KERNEL);
+   tmp_part = kmalloc(sizeof(struct nvram_partition), GFP_KERNEL);
err = -ENOMEM;
if (!tmp_part) {
printk(KERN_ERR nvram_scan_partitions: kmalloc 
failed\n);
diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c
index b998abf..2a8b9b6 100644
--- a/arch/powerpc/kvm/book3s.c
+++ b/arch/powerpc/kvm/book3s.c
@@ -1248,8 +1248,8 @@ struct kvm_vcpu *kvmppc_core_vcpu_create(struct kvm *kvm, 
unsigned int id)
 
memset(vcpu_book3s, 0, sizeof(struct kvmppc_vcpu_book3s));
 
-   vcpu_book3s-shadow_vcpu = (struct kvmppc_book3s_shadow_vcpu *)
-   kzalloc(sizeof(*vcpu_book3s-shadow_vcpu), GFP_KERNEL);
+   vcpu_book3s-shadow_vcpu = kzalloc(sizeof(*vcpu_book3s-shadow_vcpu),
+  GFP_KERNEL);
if (!vcpu_book3s-shadow_vcpu)
goto free_vcpu;
 
-- 
1.7.0.3.311.g6a6955

--
To unsubscribe from this list: send the line unsubscribe kvm-ppc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 01/10] arch/ia64: Fix continuation line formats

2010-02-01 Thread Joe Perches
String constants that are continued on subsequent lines with \
are not good.

Signed-off-by: Joe Perches j...@perches.com
---
 arch/ia64/kvm/mmio.c |4 ++--
 arch/ia64/kvm/vcpu.c |4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/ia64/kvm/mmio.c b/arch/ia64/kvm/mmio.c
index 9bf55af..fb8f9f5 100644
--- a/arch/ia64/kvm/mmio.c
+++ b/arch/ia64/kvm/mmio.c
@@ -316,8 +316,8 @@ void emulate_io_inst(struct kvm_vcpu *vcpu, u64 padr, u64 
ma)
return;
} else {
inst_type = -1;
-   panic_vm(vcpu, Unsupported MMIO access instruction! \
-   Bunld[0]=0x%lx, Bundle[1]=0x%lx\n,
+   panic_vm(vcpu, Unsupported MMIO access instruction! 
+   Bunld[0]=0x%lx, Bundle[1]=0x%lx\n,
bundle.i64[0], bundle.i64[1]);
}
 
diff --git a/arch/ia64/kvm/vcpu.c b/arch/ia64/kvm/vcpu.c
index dce75b7..958815c 100644
--- a/arch/ia64/kvm/vcpu.c
+++ b/arch/ia64/kvm/vcpu.c
@@ -1639,8 +1639,8 @@ void vcpu_set_psr(struct kvm_vcpu *vcpu, unsigned long 
val)
 * Otherwise panic
 */
if (val  (IA64_PSR_PK | IA64_PSR_IS | IA64_PSR_VM))
-   panic_vm(vcpu, Only support guests with vpsr.pk =0 \
-vpsr.is=0\n);
+   panic_vm(vcpu, Only support guests with vpsr.pk =0 
+vpsr.is=0\n);
 
/*
 * For those IA64_PSR bits: id/da/dd/ss/ed/ia
-- 
1.6.6.rc0.57.gad7a

--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] MAINTAINERS: Remove file pattern from KERNEL VIRTUAL MACHINE (KVM) FOR AMD-V

2009-12-08 Thread Joe Perches
Commit 6c8166a77c98f473eb91e96a61c3cf78ac617278 folded
this file away.

Signed-off-by: Joe Perches j...@perches.com

diff --git a/MAINTAINERS b/MAINTAINERS
index ea781c1..fda3eec 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3109,7 +3109,6 @@ L:kvm@vger.kernel.org
 W: http://kvm.qumranet.com
 S: Supported
 F: arch/x86/include/asm/svm.h
-F: arch/x86/kvm/kvm_svm.h
 F: arch/x86/kvm/svm.c
 
 KERNEL VIRTUAL MACHINE (KVM) FOR POWERPC


--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 11/21] i8254.c: Add pr_fmt(fmt)

2009-10-04 Thread Joe Perches
Add pr_fmt(fmt) pit:  fmt
Strip pit: prefixes from pr_debug

Signed-off-by: Joe Perches j...@perches.com
---
 arch/x86/kvm/i8254.c |   12 +++-
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c
index 82ad523..fa83a15 100644
--- a/arch/x86/kvm/i8254.c
+++ b/arch/x86/kvm/i8254.c
@@ -29,6 +29,8 @@
  *   Based on QEMU and Xen.
  */
 
+#define pr_fmt(fmt) pit:  fmt
+
 #include linux/kvm_host.h
 
 #include irq.h
@@ -262,7 +264,7 @@ void __kvm_migrate_pit_timer(struct kvm_vcpu *vcpu)
 
 static void destroy_pit_timer(struct kvm_timer *pt)
 {
-   pr_debug(pit: execute del timer!\n);
+   pr_debug(execute del timer!\n);
hrtimer_cancel(pt-timer);
 }
 
@@ -284,7 +286,7 @@ static void create_pit_timer(struct kvm_kpit_state *ps, u32 
val, int is_period)
 
interval = muldiv64(val, NSEC_PER_SEC, KVM_PIT_FREQ);
 
-   pr_debug(pit: create pit timer, interval is %llu nsec\n, interval);
+   pr_debug(create pit timer, interval is %llu nsec\n, interval);
 
/* TODO The new value only affected after the retriggered */
hrtimer_cancel(pt-timer);
@@ -309,7 +311,7 @@ static void pit_load_count(struct kvm *kvm, int channel, 
u32 val)
 
WARN_ON(!mutex_is_locked(ps-lock));
 
-   pr_debug(pit: load_count val is %d, channel is %d\n, val, channel);
+   pr_debug(load_count val is %d, channel is %d\n, val, channel);
 
/*
 * The largest possible initial count is 0; this is equivalent
@@ -395,8 +397,8 @@ static int pit_ioport_write(struct kvm_io_device *this,
mutex_lock(pit_state-lock);
 
if (val != 0)
-   pr_debug(pit: write addr is 0x%x, len is %d, val is 0x%x\n,
- (unsigned int)addr, len, val);
+   pr_debug(write addr is 0x%x, len is %d, val is 0x%x\n,
+(unsigned int)addr, len, val);
 
if (addr == 3) {
channel = val  6;
-- 
1.6.3.1.10.g659a0.dirty

--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 00/21] pr_dbg, pr_fmt

2009-10-04 Thread Joe Perches
One possible long term goal is to stop adding
#define pr_fmt(fmt) KBUILD_MODNAME :  fmt
to source files to prefix modulename to logging output.

It might be useful to eventually have kernel.h
use a standard #define pr_fmt which includes KBUILD_MODNAME
instead of a blank or empty define.

Perhaps over time, the source modules that use pr_level
with prefixes can be converted to use pr_fmt.

If all modules are converted, that will allow the printk
routine to add module/filename/line/offset to the logging
lines using some function similar to dynamic_debug and
substantially reduct object string use by removing the
repeated prefixes.

This patchset does not get to that result.  The patches
right now uses _more_ string space because all logging
messages have unshared prefixes but it may be a useful start.

The patchset strips prefixes from printks and adds pr_fmt to
arch/x86, crypto, kernel, and a few drivers.

It also converts printk(KERN_level to pr_level in a few files
that already had some pr_level uses.

The conversion also generally used long length format strings
in the place of multiple short strings to ease any grep/search.
 
Joe Perches (21):
  include/linux/ dynamic_debug.h kernel.h: Remove KBUILD_MODNAME from 
dynamic_pr_debug, add #define pr_dbg
  ftrace.c: Add #define pr_fmt(fmt) KBUILD_MODNAME :  fmt
  mtrr: use pr_level and pr_fmt
  microcode: use pr_level and add pr_fmt
  amd_iommu.c: use pr_level and add pr_fmt(fmt)
  es7000_32.c: use pr_level and add pr_fmt(fmt)
  arch/x86/kernel/apic/: use pr_level and add pr_fmt(fmt)
  mcheck/: use pr_level and add pr_fmt(fmt)
  arch/x86/kernel/setup_percpu.c: use pr_level and add pr_fmt(fmt)
  arch/x86/kernel/cpu/: use pr_level and add pr_fmt(fmt)
  i8254.c: Add pr_fmt(fmt)
  kmmio.c: Add and use pr_fmt(fmt)
  testmmiotrace.c: Add and use pr_fmt(fmt)
  crypto/: use pr_level and add pr_fmt(fmt)
  kernel/power/: use pr_level and add pr_fmt(fmt)
  kernel/kexec.c: use pr_level and add pr_fmt(fmt)
  crypto/async_tx/raid6test.c: use pr_level and add pr_fmt(fmt)
  arch/x86/mm/mmio-mod.c: use pr_fmt
  drivers/net/bonding/: : use pr_fmt
  drivers/net/tlan: use pr_level and add pr_fmt(fmt)
  drivers/net/tlan.h: Convert printk(KERN_DEBUG to pr_dbg(

 arch/x86/kernel/amd_iommu.c|   71 ++--
 arch/x86/kernel/apic/apic.c|   48 ++--
 arch/x86/kernel/apic/apic_flat_64.c|5 +-
 arch/x86/kernel/apic/bigsmp_32.c   |8 +-
 arch/x86/kernel/apic/es7000_32.c   |   12 +-
 arch/x86/kernel/apic/io_apic.c |  239 ++--
 arch/x86/kernel/apic/nmi.c |   29 +-
 arch/x86/kernel/apic/numaq_32.c|   53 ++--
 arch/x86/kernel/apic/probe_32.c|   18 +-
 arch/x86/kernel/apic/probe_64.c|8 +-
 arch/x86/kernel/apic/summit_32.c   |   23 +-
 arch/x86/kernel/apic/x2apic_uv_x.c |   26 +-
 arch/x86/kernel/cpu/addon_cpuid_features.c |9 +-
 arch/x86/kernel/cpu/amd.c  |   26 +-
 arch/x86/kernel/cpu/bugs.c |   23 +-
 arch/x86/kernel/cpu/bugs_64.c  |4 +-
 arch/x86/kernel/cpu/centaur.c  |   12 +-
 arch/x86/kernel/cpu/common.c   |   54 ++--
 arch/x86/kernel/cpu/cpu_debug.c|4 +-
 arch/x86/kernel/cpu/cyrix.c|   12 +-
 arch/x86/kernel/cpu/intel.c|   14 +-
 arch/x86/kernel/cpu/intel_cacheinfo.c  |   14 +-
 arch/x86/kernel/cpu/mcheck/mce-inject.c|   20 +-
 arch/x86/kernel/cpu/mcheck/mce.c   |   59 ++--
 arch/x86/kernel/cpu/mcheck/mce_intel.c |8 +-
 arch/x86/kernel/cpu/mcheck/p5.c|   21 +-
 arch/x86/kernel/cpu/mcheck/therm_throt.c   |   21 +-
 arch/x86/kernel/cpu/mcheck/threshold.c |7 +-
 arch/x86/kernel/cpu/mcheck/winchip.c   |8 +-
 arch/x86/kernel/cpu/mtrr/centaur.c |4 +-
 arch/x86/kernel/cpu/mtrr/cleanup.c |   59 ++--
 arch/x86/kernel/cpu/mtrr/generic.c |   39 +-
 arch/x86/kernel/cpu/mtrr/main.c|   32 +-
 arch/x86/kernel/cpu/perf_event.c   |   10 +-
 arch/x86/kernel/cpu/perfctr-watchdog.c |   11 +-
 arch/x86/kernel/cpu/transmeta.c|   20 +-
 arch/x86/kernel/cpu/vmware.c   |   11 +-
 arch/x86/kernel/ftrace.c   |8 +-
 arch/x86/kernel/microcode_amd.c|5 +-
 arch/x86/kernel/microcode_core.c   |   23 +-
 arch/x86/kernel/microcode_intel.c  |   47 +--
 arch/x86/kernel/setup_percpu.c |   13 +-
 arch/x86/kvm/i8254.c   |   12 +-
 arch/x86/mm/kmmio.c|   40 +-
 arch/x86/mm/mmio-mod.c |   71 ++--
 arch/x86/mm/testmmiotrace.c|   29 +-
 crypto/algapi.c|4 +-
 crypto/ansi_cprng.c|   39 +-
 crypto/async_tx/async_tx.c |5 +-
 crypto/async_tx/raid6test.c|   30 +-
 crypto/fips.c

[PATCH 02/62] arch/ia64: Remove unnecessary semicolons

2009-06-28 Thread Joe Perches
Signed-off-by: Joe Perches j...@perches.com
---
 arch/ia64/kernel/esi.c  |2 +-
 arch/ia64/kvm/process.c |6 +++---
 arch/ia64/kvm/vcpu.c|2 +-
 arch/ia64/kvm/vtlb.c|4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/ia64/kernel/esi.c b/arch/ia64/kernel/esi.c
index ebf4e98..d5764a3 100644
--- a/arch/ia64/kernel/esi.c
+++ b/arch/ia64/kernel/esi.c
@@ -65,7 +65,7 @@ static int __init esi_init (void)
}
 
if (!esi)
-   return -ENODEV;;
+   return -ENODEV;
 
systab = __va(esi);
 
diff --git a/arch/ia64/kvm/process.c b/arch/ia64/kvm/process.c
index a8f84da..bb862fb 100644
--- a/arch/ia64/kvm/process.c
+++ b/arch/ia64/kvm/process.c
@@ -130,7 +130,7 @@ static void collect_interruption(struct kvm_vcpu *vcpu)
if (vdcr  IA64_DCR_PP) {
vpsr |= IA64_PSR_PP;
} else {
-   vpsr = ~IA64_PSR_PP;;
+   vpsr = ~IA64_PSR_PP;
}
 
vcpu_set_psr(vcpu, vpsr);
@@ -594,11 +594,11 @@ static void set_pal_call_data(struct kvm_vcpu *vcpu)
p-u.pal_data.gr30 = vcpu_get_gr(vcpu, 30);
break;
case PAL_BRAND_INFO:
-   p-u.pal_data.gr29 = gr29;;
+   p-u.pal_data.gr29 = gr29;
p-u.pal_data.gr30 = kvm_trans_pal_call_args(vcpu, gr30);
break;
default:
-   p-u.pal_data.gr29 = gr29;;
+   p-u.pal_data.gr29 = gr29;
p-u.pal_data.gr30 = vcpu_get_gr(vcpu, 30);
}
p-u.pal_data.gr28 = gr28;
diff --git a/arch/ia64/kvm/vcpu.c b/arch/ia64/kvm/vcpu.c
index a2c6c15..46b02cb 100644
--- a/arch/ia64/kvm/vcpu.c
+++ b/arch/ia64/kvm/vcpu.c
@@ -406,7 +406,7 @@ void getreg(unsigned long regnum, unsigned long *val,
 * Now look at registers in [0-31] range and init correct UNAT
 */
addr = (unsigned long)regs;
-   unat = regs-eml_unat;;
+   unat = regs-eml_unat;
 
addr += gr_info[regnum];
 
diff --git a/arch/ia64/kvm/vtlb.c b/arch/ia64/kvm/vtlb.c
index 4290a42..20b3852 100644
--- a/arch/ia64/kvm/vtlb.c
+++ b/arch/ia64/kvm/vtlb.c
@@ -135,7 +135,7 @@ struct thash_data *__vtr_lookup(struct kvm_vcpu *vcpu, u64 
va, int type)
u64 rid;
 
rid = vcpu_get_rr(vcpu, va);
-   rid = rid  RR_RID_MASK;;
+   rid = rid  RR_RID_MASK;
if (type == D_TLB) {
if (vcpu_quick_region_check(vcpu-arch.dtr_regions, va)) {
for (trp = (struct thash_data *)vcpu-arch.dtrs, i = 0;
@@ -518,7 +518,7 @@ struct thash_data *vtlb_lookup(struct kvm_vcpu *v, u64 va, 
int is_data)
 
struct thash_cb *hcb = v-arch.vtlb;
 
-   cch = __vtr_lookup(v, va, is_data);;
+   cch = __vtr_lookup(v, va, is_data);
if (cch)
return cch;
 
-- 
1.6.3.1.10.g659a0.dirty

--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 07/62] arch/s390/kvm/interrupt.c: Remove unnecessary semicolons

2009-06-28 Thread Joe Perches
Signed-off-by: Joe Perches j...@perches.com
---
 arch/s390/kvm/interrupt.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
index f04f530..dc94adb 100644
--- a/arch/s390/kvm/interrupt.c
+++ b/arch/s390/kvm/interrupt.c
@@ -484,7 +484,7 @@ int kvm_s390_inject_program_int(struct kvm_vcpu *vcpu, u16 
code)
if (!inti)
return -ENOMEM;
 
-   inti-type = KVM_S390_PROGRAM_INT;;
+   inti-type = KVM_S390_PROGRAM_INT;
inti-pgm.code = code;
 
VCPU_EVENT(vcpu, 3, inject: program check %d (from kernel), code);
-- 
1.6.3.1.10.g659a0.dirty

--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html