chengshan / rpms / kernel

Forked from rpms/kernel 2 years ago
Clone
b37f23
From 5265f6ea5a6643c5b2aa13e8e4664962251b37ea Mon Sep 17 00:00:00 2001
b37f23
From: Chad Dupuis <chad.dupuis@qlogic.com>
b37f23
Date: Thu, 13 Mar 2014 14:16:40 -0400
b37f23
Subject: [PATCH] qla2xxx: Fix build errors related to invalid print fields on
b37f23
 some architectures.
b37f23
b37f23
Fixes some build warnings such as:
b37f23
drivers/scsi/qla2xxx/qla_attr.c:162:6: warning: format '%lx' expects argument of
b37f23
type 'long unsigned int', but argument 6 has type 'size_t'"
b37f23
and
b37f23
drivers/scsi/qla2xxx/qla_init.c:5198:7: warning: format '%lx' expects argument
b37f23
of type 'long unsigned int', but argument 5 has type 'uint32_t' [-Wformat]
b37f23
b37f23
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
b37f23
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
b37f23
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
b37f23
---
b37f23
 drivers/scsi/qla2xxx/qla_attr.c |  6 +++---
b37f23
 drivers/scsi/qla2xxx/qla_init.c | 12 ++++++------
b37f23
 2 files changed, 9 insertions(+), 9 deletions(-)
b37f23
b37f23
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
b37f23
index da5ae11..1a976c0 100644
b37f23
--- a/drivers/scsi/qla2xxx/qla_attr.c
b37f23
+++ b/drivers/scsi/qla2xxx/qla_attr.c
b37f23
@@ -159,7 +159,7 @@ qla2x00_sysfs_read_fw_dump_template(struct file *filp, struct kobject *kobj,
b37f23
 		return 0;
b37f23
 
b37f23
 	ql_dbg(ql_dbg_user, vha, 0x70e2,
b37f23
-	    "chunk <- off=%llx count=%lx\n", off, count);
b37f23
+	    "chunk <- off=%llx count=%zx\n", off, count);
b37f23
 	return memory_read_from_buffer(buf, count, &off,
b37f23
 	    ha->fw_dump_template, ha->fw_dump_template_len);
b37f23
 }
b37f23
@@ -200,11 +200,11 @@ qla2x00_sysfs_write_fw_dump_template(struct file *filp, struct kobject *kobj,
b37f23
 	if (off + count > ha->fw_dump_template_len) {
b37f23
 		count = ha->fw_dump_template_len - off;
b37f23
 		ql_dbg(ql_dbg_user, vha, 0x70d3,
b37f23
-		    "chunk -> truncating to %lx bytes.\n", count);
b37f23
+		    "chunk -> truncating to %zx bytes.\n", count);
b37f23
 	}
b37f23
 
b37f23
 	ql_dbg(ql_dbg_user, vha, 0x70d4,
b37f23
-	    "chunk -> off=%llx count=%lx\n", off, count);
b37f23
+	    "chunk -> off=%llx count=%zx\n", off, count);
b37f23
 	memcpy(ha->fw_dump_template + off, buf, count);
b37f23
 
b37f23
 	if (off + count == ha->fw_dump_template_len) {
b37f23
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
b37f23
index c64ee86..462836c 100644
b37f23
--- a/drivers/scsi/qla2xxx/qla_init.c
b37f23
+++ b/drivers/scsi/qla2xxx/qla_init.c
b37f23
@@ -5452,8 +5452,8 @@ qla24xx_load_risc_flash(scsi_qla_host_t *vha, uint32_t *srisc_addr,
b37f23
 	    "-> template size %x bytes\n", dlen);
b37f23
 	if (dlen > risc_size * sizeof(*dcode)) {
b37f23
 		ql_log(ql_log_warn, vha, 0x0167,
b37f23
-		    "Failed fwdump template exceeds array by %lx bytes\n",
b37f23
-		    dlen - risc_size * sizeof(*dcode));
b37f23
+		    "Failed fwdump template exceeds array by %x bytes\n",
b37f23
+		    (uint32_t)(dlen - risc_size * sizeof(*dcode)));
b37f23
 		goto default_template;
b37f23
 	}
b37f23
 	ha->fw_dump_template_len = dlen;
b37f23
@@ -5719,8 +5719,8 @@ qla24xx_load_risc_blob(scsi_qla_host_t *vha, uint32_t *srisc_addr)
b37f23
 	ha->fw_dump_template_len = 0;
b37f23
 
b37f23
 	ql_dbg(ql_dbg_init, vha, 0x171,
b37f23
-	    "Loading fwdump template from %lx\n",
b37f23
-	    (void *)fwcode - (void *)blob->fw->data);
b37f23
+	    "Loading fwdump template from %x\n",
b37f23
+	    (uint32_t)((void *)fwcode - (void *)blob->fw->data));
b37f23
 	risc_size = be32_to_cpu(fwcode[2]);
b37f23
 	ql_dbg(ql_dbg_init, vha, 0x172,
b37f23
 	    "-> array size %x dwords\n", risc_size);
b37f23
@@ -5754,8 +5754,8 @@ qla24xx_load_risc_blob(scsi_qla_host_t *vha, uint32_t *srisc_addr)
b37f23
 	    "-> template size %x bytes\n", dlen);
b37f23
 	if (dlen > risc_size * sizeof(*fwcode)) {
b37f23
 		ql_log(ql_log_warn, vha, 0x0177,
b37f23
-		    "Failed fwdump template exceeds array by %lx bytes\n",
b37f23
-		    dlen - risc_size * sizeof(*fwcode));
b37f23
+		    "Failed fwdump template exceeds array by %x bytes\n",
b37f23
+		    (uint32_t)(dlen - risc_size * sizeof(*fwcode)));
b37f23
 		goto default_template;
b37f23
 	}
b37f23
 	ha->fw_dump_template_len = dlen;
b37f23
-- 
b37f23
1.8.3.1
b37f23
b37f23
From b9469523631bd376a5f877d4e816f3a81c12b790 Mon Sep 17 00:00:00 2001
b37f23
From: Paul Bolle <pebolle@tiscali.nl>
b37f23
Date: Mon, 30 Jun 2014 16:32:29 +0200
b37f23
Subject: [PATCH] x86: Remove unused variable "polling"
b37f23
b37f23
Compile tested. "polling" is unused since commit f80c5b39b80a
b37f23
("sched/idle, x86: Switch from TS_POLLING to TIF_POLLING_NRFLAG").
b37f23
b37f23
Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
b37f23
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
b37f23
Cc: Jiri Kosina <jkosina@suse.cz>
b37f23
Link: http://lkml.kernel.org/r/1404138749.2978.6.camel@x41
b37f23
Signed-off-by: Ingo Molnar <mingo@kernel.org>
b37f23
---
b37f23
 arch/x86/kernel/apm_32.c | 1 -
b37f23
 1 file changed, 1 deletion(-)
b37f23
b37f23
diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c
b37f23
index 8fdcec6..66d3b1f 100644
b37f23
--- a/arch/x86/kernel/apm_32.c
b37f23
+++ b/arch/x86/kernel/apm_32.c
b37f23
@@ -841,7 +841,6 @@ static int apm_do_idle(void)
b37f23
 	u32 eax;
b37f23
 	u8 ret = 0;
b37f23
 	int idled = 0;
b37f23
-	int polling;
b37f23
 	int err = 0;
b37f23
 
b37f23
 	if (!need_resched()) {
b37f23
-- 
b37f23
1.8.3.1
b37f23
b37f23
From 75c2e0e53d2fb5df66b8fe162d71930348ac0b96 Mon Sep 17 00:00:00 2001
b37f23
From: John Stultz <john.stultz@linaro.org>
b37f23
Date: Wed, 16 Jul 2014 21:03:56 +0000
b37f23
Subject: [PATCH] ktime: Change ktime_set() to take 64bit seconds value
b37f23
b37f23
In order to support dates past 2038 on 32bit systems, ktime_set()
b37f23
needs to handle 64bit second values.
b37f23
b37f23
[ tglx: Removed the BITS_PER_LONG check ]
b37f23
b37f23
Signed-off-by: John Stultz <john.stultz@linaro.org>
b37f23
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
b37f23
Signed-off-by: John Stultz <john.stultz@linaro.org>
b37f23
---
b37f23
 include/linux/ktime.h | 7 +++----
b37f23
 1 file changed, 3 insertions(+), 4 deletions(-)
b37f23
b37f23
diff --git a/include/linux/ktime.h b/include/linux/ktime.h
b37f23
index e4e9a9f..6950c96 100644
b37f23
--- a/include/linux/ktime.h
b37f23
+++ b/include/linux/ktime.h
b37f23
@@ -71,13 +71,12 @@ typedef union ktime ktime_t;		/* Kill this */
b37f23
  *
b37f23
  * Return the ktime_t representation of the value
b37f23
  */
b37f23
-static inline ktime_t ktime_set(const long secs, const unsigned long nsecs)
b37f23
+static inline ktime_t ktime_set(const s64 secs, const unsigned long nsecs)
b37f23
 {
b37f23
-#if (BITS_PER_LONG == 64)
b37f23
 	if (unlikely(secs >= KTIME_SEC_MAX))
b37f23
 		return (ktime_t){ .tv64 = KTIME_MAX };
b37f23
-#endif
b37f23
-	return (ktime_t) { .tv64 = (s64)secs * NSEC_PER_SEC + (s64)nsecs };
b37f23
+
b37f23
+	return (ktime_t) { .tv64 = secs * NSEC_PER_SEC + (s64)nsecs };
b37f23
 }
b37f23
 
b37f23
 /* Subtract two ktime_t variables. rem = lhs -rhs: */
b37f23
-- 
b37f23
1.8.3.1
b37f23
b37f23
From 80a667f7ab1beee42b31e263ba4681fdfe00a0b6 Mon Sep 17 00:00:00 2001
b37f23
From: Florian Westphal <fw@strlen.de>
b37f23
Date: Wed, 17 Jun 2015 23:58:28 +0200
b37f23
Subject: [PATCH] netfilter: xtables: fix warnings on 32bit platforms
b37f23
b37f23
On 32bit archs gcc complains due to cast from void* to u64.
b37f23
Add intermediate casts to long to silence these warnings.
b37f23
b37f23
include/linux/netfilter/x_tables.h:376:10: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
b37f23
include/linux/netfilter/x_tables.h:384:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
b37f23
include/linux/netfilter/x_tables.h:391:23: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
b37f23
include/linux/netfilter/x_tables.h:400:22: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
b37f23
b37f23
Fixes: 71ae0dff02d756e ("netfilter: xtables: use percpu rule counters")
b37f23
Reported-by: kbuild test robot <fengguang.wu@intel.com>
b37f23
Signed-off-by: Florian Westphal <fw@strlen.de>
b37f23
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
b37f23
---
b37f23
 include/linux/netfilter/x_tables.h | 8 ++++----
b37f23
 1 file changed, 4 insertions(+), 4 deletions(-)
b37f23
b37f23
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h
b37f23
index d08f0ed..781b6fe 100644
b37f23
--- a/include/linux/netfilter/x_tables.h
b37f23
+++ b/include/linux/netfilter/x_tables.h
b37f23
@@ -390,7 +390,7 @@ static inline u64 xt_percpu_counter_alloc(void)
b37f23
 		if (res == NULL)
b37f23
 			return (u64) -ENOMEM;
b37f23
 
b37f23
-		return (__force u64) res;
b37f23
+		return (u64) (__force unsigned long) res;
b37f23
 	}
b37f23
 
b37f23
 	return 0;
b37f23
@@ -398,14 +398,14 @@ static inline u64 xt_percpu_counter_alloc(void)
b37f23
 static inline void xt_percpu_counter_free(u64 pcnt)
b37f23
 {
b37f23
 	if (nr_cpu_ids > 1)
b37f23
-		free_percpu((void __percpu *) pcnt);
b37f23
+		free_percpu((void __percpu *) (unsigned long) pcnt);
b37f23
 }
b37f23
 
b37f23
 static inline struct xt_counters *
b37f23
 xt_get_this_cpu_counter(struct xt_counters *cnt)
b37f23
 {
b37f23
 	if (nr_cpu_ids > 1)
b37f23
-		return this_cpu_ptr((void __percpu *) cnt->pcnt);
b37f23
+		return this_cpu_ptr((void __percpu *) (unsigned long) cnt->pcnt);
b37f23
 
b37f23
 	return cnt;
b37f23
 }
b37f23
@@ -414,7 +414,7 @@ static inline struct xt_counters *
b37f23
 xt_get_per_cpu_counter(struct xt_counters *cnt, unsigned int cpu)
b37f23
 {
b37f23
 	if (nr_cpu_ids > 1)
b37f23
-		return per_cpu_ptr((void __percpu *) cnt->pcnt, cpu);
b37f23
+		return per_cpu_ptr((void __percpu *) (unsigned long) cnt->pcnt, cpu);
b37f23
 
b37f23
 	return cnt;
b37f23
 }
b37f23
-- 
b37f23
1.8.3.1
b37f23