virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] xen: balloon: Fix checkpatch issues
@ 2010-03-11  4:00 Bruno Bigras
  2010-03-11  4:00 ` [PATCH 2/2] xen: events: " Bruno Bigras
  0 siblings, 1 reply; 2+ messages in thread
From: Bruno Bigras @ 2010-03-11  4:00 UTC (permalink / raw)
  To: jeremy; +Cc: virtualization, xen-devel, linux-kernel, Bruno Bigras

drivers/xen/balloon.c:50: WARNING: Use #include <linux/uaccess.h> instead of <asm/uaccess.h>
drivers/xen/balloon.c:158: ERROR: else should follow close brace '}'
drivers/xen/balloon.c:277: ERROR: do not use assignment in if condition
drivers/xen/balloon.c:293: ERROR: code indent should use tabs where possible
drivers/xen/balloon.c:364: ERROR: that open brace { should be on the previous line
drivers/xen/balloon.c:463: WARNING: line over 80 characters
drivers/xen/balloon.c:491: WARNING: line over 80 characters

Signed-off-by: Bruno Bigras <bigras.bruno@gmail.com>
---
 drivers/xen/balloon.c |   21 ++++++++++-----------
 1 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
index f6738d8..93538a8 100644
--- a/drivers/xen/balloon.c
+++ b/drivers/xen/balloon.c
@@ -43,11 +43,11 @@
 #include <linux/mutex.h>
 #include <linux/list.h>
 #include <linux/sysdev.h>
+#include <linux/uaccess.h>
 
 #include <asm/page.h>
 #include <asm/pgalloc.h>
 #include <asm/pgtable.h>
-#include <asm/uaccess.h>
 #include <asm/tlb.h>
 
 #include <asm/xen/hypervisor.h>
@@ -154,8 +154,7 @@ static struct page *balloon_retrieve(void)
 	if (PageHighMem(page)) {
 		balloon_stats.balloon_high--;
 		inc_totalhigh_pages();
-	}
-	else
+	} else
 		balloon_stats.balloon_low--;
 
 	totalram_pages++;
@@ -274,7 +273,8 @@ static int decrease_reservation(unsigned long nr_pages)
 		nr_pages = ARRAY_SIZE(frame_list);
 
 	for (i = 0; i < nr_pages; i++) {
-		if ((page = alloc_page(GFP_BALLOON)) == NULL) {
+		page = alloc_page(GFP_BALLOON);
+		if (!page) {
 			nr_pages = i;
 			need_sleep = 1;
 			break;
@@ -290,7 +290,7 @@ static int decrease_reservation(unsigned long nr_pages)
 				(unsigned long)__va(pfn << PAGE_SHIFT),
 				__pte_ma(0), 0);
 			BUG_ON(ret);
-                }
+		}
 
 	}
 
@@ -360,8 +360,7 @@ static void balloon_set_new_target(unsigned long target)
 	schedule_work(&balloon_worker);
 }
 
-static struct xenbus_watch target_watch =
-{
+static struct xenbus_watch target_watch = {
 	.node = "memory/target"
 };
 
@@ -460,8 +459,8 @@ BALLOON_SHOW(low_kb, "%lu\n", PAGES2KB(balloon_stats.balloon_low));
 BALLOON_SHOW(high_kb, "%lu\n", PAGES2KB(balloon_stats.balloon_high));
 BALLOON_SHOW(driver_kb, "%lu\n", PAGES2KB(balloon_stats.driver_pages));
 
-static ssize_t show_target_kb(struct sys_device *dev, struct sysdev_attribute *attr,
-			      char *buf)
+static ssize_t show_target_kb(struct sys_device *dev,
+			      struct sysdev_attribute *attr, char *buf)
 {
 	return sprintf(buf, "%lu\n", PAGES2KB(balloon_stats.target_pages));
 }
@@ -488,8 +487,8 @@ static SYSDEV_ATTR(target_kb, S_IRUGO | S_IWUSR,
 		   show_target_kb, store_target_kb);
 
 
-static ssize_t show_target(struct sys_device *dev, struct sysdev_attribute *attr,
-			      char *buf)
+static ssize_t show_target(struct sys_device *dev,
+			   struct sysdev_attribute *attr, char *buf)
 {
 	return sprintf(buf, "%llu\n",
 		       (unsigned long long)balloon_stats.target_pages
-- 
1.7.0.2

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

* [PATCH 2/2] xen: events: Fix checkpatch issues
  2010-03-11  4:00 [PATCH 1/2] xen: balloon: Fix checkpatch issues Bruno Bigras
@ 2010-03-11  4:00 ` Bruno Bigras
  0 siblings, 0 replies; 2+ messages in thread
From: Bruno Bigras @ 2010-03-11  4:00 UTC (permalink / raw)
  To: jeremy; +Cc: virtualization, xen-devel, linux-kernel, Bruno Bigras

drivers/xen/events.c:31: WARNING: Use #include <linux/ptrace.h> instead of <asm/ptrace.h>
drivers/xen/events.c:76: ERROR: open brace '{' following struct go on the same line
drivers/xen/events.c:509: WARNING: line over 80 characters
drivers/xen/events.c:581: ERROR: space required before the open parenthesis '('
drivers/xen/events.c:585: ERROR: space required before the open parenthesis '('
drivers/xen/events.c:590: ERROR: space required before the open parenthesis '('
drivers/xen/events.c:595: ERROR: space required before the open parenthesis '('
drivers/xen/events.c:625: ERROR: code indent should use tabs where possible
drivers/xen/events.c:625: WARNING: please, no space before tabs
drivers/xen/events.c:666: ERROR: space required before the open parenthesis '('
drivers/xen/events.c:802: ERROR: do not use assignment in if condition
drivers/xen/events.c:831: ERROR: do not use assignment in if condition

Signed-off-by: Bruno Bigras <bigras.bruno@gmail.com>
---
 drivers/xen/events.c |   26 ++++++++++++++------------
 1 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index 2f84137..e86841c 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -27,8 +27,8 @@
 #include <linux/module.h>
 #include <linux/string.h>
 #include <linux/bootmem.h>
+#include <linux/ptrace.h>
 
-#include <asm/ptrace.h>
 #include <asm/irq.h>
 #include <asm/idle.h>
 #include <asm/sync_bitops.h>
@@ -72,8 +72,7 @@ enum xen_irq_type {
  *    IPI - IPI vector
  *    EVTCHN -
  */
-struct irq_info
-{
+struct irq_info {
 	enum xen_irq_type type;	/* type */
 	unsigned short evtchn;	/* event channel */
 	unsigned short cpu;	/* cpu bound */
@@ -506,7 +505,8 @@ EXPORT_SYMBOL_GPL(bind_evtchn_to_irqhandler);
 
 int bind_virq_to_irqhandler(unsigned int virq, unsigned int cpu,
 			    irq_handler_t handler,
-			    unsigned long irqflags, const char *devname, void *dev_id)
+			    unsigned long irqflags, const char *devname,
+			    void *dev_id)
 {
 	unsigned int irq;
 	int retval;
@@ -578,21 +578,21 @@ irqreturn_t xen_debug_interrupt(int irq, void *dev_id)
 			v->evtchn_pending_sel);
 	}
 	printk("pending:\n   ");
-	for(i = ARRAY_SIZE(sh->evtchn_pending)-1; i >= 0; i--)
+	for (i = ARRAY_SIZE(sh->evtchn_pending)-1; i >= 0; i--)
 		printk("%08lx%s", sh->evtchn_pending[i],
 			i % 8 == 0 ? "\n   " : " ");
 	printk("\nmasks:\n   ");
-	for(i = ARRAY_SIZE(sh->evtchn_mask)-1; i >= 0; i--)
+	for (i = ARRAY_SIZE(sh->evtchn_mask)-1; i >= 0; i--)
 		printk("%08lx%s", sh->evtchn_mask[i],
 			i % 8 == 0 ? "\n   " : " ");
 
 	printk("\nunmasked:\n   ");
-	for(i = ARRAY_SIZE(sh->evtchn_mask)-1; i >= 0; i--)
+	for (i = ARRAY_SIZE(sh->evtchn_mask)-1; i >= 0; i--)
 		printk("%08lx%s", sh->evtchn_pending[i] & ~sh->evtchn_mask[i],
 			i % 8 == 0 ? "\n   " : " ");
 
 	printk("\npending list:\n");
-	for(i = 0; i < NR_EVENT_CHANNELS; i++) {
+	for (i = 0; i < NR_EVENT_CHANNELS; i++) {
 		if (sync_test_bit(i, sh->evtchn_pending)) {
 			printk("  %d: event %d -> irq %d\n",
 			       cpu_from_evtchn(i), i,
@@ -622,7 +622,7 @@ void xen_evtchn_do_upcall(struct pt_regs *regs)
 	struct pt_regs *old_regs = set_irq_regs(regs);
 	struct shared_info *s = HYPERVISOR_shared_info;
 	struct vcpu_info *vcpu_info = __get_cpu_var(xen_vcpu);
- 	unsigned count;
+	unsigned count;
 
 	exit_idle();
 	irq_enter();
@@ -663,7 +663,7 @@ void xen_evtchn_do_upcall(struct pt_regs *regs)
 
 		count = __get_cpu_var(xed_nesting_count);
 		__get_cpu_var(xed_nesting_count) = 0;
-	} while(count != 1);
+	} while (count != 1);
 
 out:
 	irq_exit();
@@ -799,7 +799,8 @@ static void restore_cpu_virqs(unsigned int cpu)
 	int virq, irq, evtchn;
 
 	for (virq = 0; virq < NR_VIRQS; virq++) {
-		if ((irq = per_cpu(virq_to_irq, cpu)[virq]) == -1)
+		irq = per_cpu(virq_to_irq, cpu)[virq];
+		if (irq == -1)
 			continue;
 
 		BUG_ON(virq_from_irq(irq) != virq);
@@ -828,7 +829,8 @@ static void restore_cpu_ipis(unsigned int cpu)
 	int ipi, irq, evtchn;
 
 	for (ipi = 0; ipi < XEN_NR_IPIS; ipi++) {
-		if ((irq = per_cpu(ipi_to_irq, cpu)[ipi]) == -1)
+		irq = per_cpu(ipi_to_irq, cpu)[ipi];
+		if (irq == -1)
 			continue;
 
 		BUG_ON(ipi_from_irq(irq) != ipi);
-- 
1.7.0.2

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

end of thread, other threads:[~2010-03-11  4:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-11  4:00 [PATCH 1/2] xen: balloon: Fix checkpatch issues Bruno Bigras
2010-03-11  4:00 ` [PATCH 2/2] xen: events: " Bruno Bigras

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).