Hi,
This patch series fixes all the warnings I get when building a kernel for my
laptop. Plus a few style issues cleanups.
v2: comments from Daniel Walker, and Mike Frysinger
Felipe Contreras (6):
Trivial whitespace cleanups
kbuild: fix warning when domainname is not available
kbuild: mkcompile_h: trivial cleanups
acpi: fix a bunch of style issues on 'actypes.h'
acpi: fix trivial warning
acpi: fix trivial warnings caused by previous commmit
arch/x86/include/asm/string_32.h | 1 -
arch/x86/kernel/tsc.c | 2 +-
drivers/acpi/acpica/exfldio.c | 8 ++++----
drivers/acpi/acpica/tbfadt.c | 1 -
include/acpi/actypes.h | 36 ++++++++++++++++++------------------
scripts/mkcompile_h | 12 +++++++++---
6 files changed, 32 insertions(+), 28 deletions(-)
Signed-off-by: Felipe Contreras <[email protected]>
---
arch/x86/include/asm/string_32.h | 1 -
arch/x86/kernel/tsc.c | 2 +-
drivers/acpi/acpica/tbfadt.c | 1 -
3 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/arch/x86/include/asm/string_32.h b/arch/x86/include/asm/string_32.h
index c86f452..ae907e6 100644
--- a/arch/x86/include/asm/string_32.h
+++ b/arch/x86/include/asm/string_32.h
@@ -65,7 +65,6 @@ static __always_inline void *__constant_memcpy(void *to, const void *from,
case 4:
*(int *)to = *(int *)from;
return to;
-
case 3:
*(short *)to = *(short *)from;
*((char *)to + 2) = *((char *)from + 2);
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index 71f4368..8a2fc11 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -670,7 +670,7 @@ static int time_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
if ((val == CPUFREQ_PRECHANGE && freq->old < freq->new) ||
(val == CPUFREQ_POSTCHANGE && freq->old > freq->new) ||
(val == CPUFREQ_RESUMECHANGE)) {
- *lpj = cpufreq_scale(loops_per_jiffy_ref, ref_freq, freq->new);
+ *lpj = cpufreq_scale(loops_per_jiffy_ref, ref_freq, freq->new);
tsc_khz = cpufreq_scale(tsc_khz_ref, ref_freq, freq->new);
if (!(freq->flags & CPUFREQ_CONST_LOOPS))
diff --git a/drivers/acpi/acpica/tbfadt.c b/drivers/acpi/acpica/tbfadt.c
index 82b02dc..c016335 100644
--- a/drivers/acpi/acpica/tbfadt.c
+++ b/drivers/acpi/acpica/tbfadt.c
@@ -275,7 +275,6 @@ void acpi_tb_parse_fadt(u32 table_index)
void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length)
{
-
/*
* Check if the FADT is larger than the largest table that we expect
* (the ACPI 2.0/3.0 version). If so, truncate the table, and issue
--
1.6.5.rc1
Otherwise we get:
"dnsdomainname: Unknown host"
Signed-off-by: Felipe Contreras <[email protected]>
---
scripts/mkcompile_h | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/scripts/mkcompile_h b/scripts/mkcompile_h
index 6a12dd9..f060763 100755
--- a/scripts/mkcompile_h
+++ b/scripts/mkcompile_h
@@ -66,9 +66,13 @@ UTS_TRUNCATE="sed -e s/\(.\{1,$UTS_LEN\}\).*/\1/"
echo \#define LINUX_COMPILE_HOST \"`hostname | $UTS_TRUNCATE`\"
if [ -x /bin/dnsdomainname ]; then
- echo \#define LINUX_COMPILE_DOMAIN \"`dnsdomainname | $UTS_TRUNCATE`\"
+ domain=`dnsdomainname 2> /dev/null`
elif [ -x /bin/domainname ]; then
- echo \#define LINUX_COMPILE_DOMAIN \"`domainname | $UTS_TRUNCATE`\"
+ domain=`domainname 2> /dev/null`
+ fi
+
+ if [ -n "$domain" ]; then
+ echo \#define LINUX_COMPILE_DOMAIN \"`echo $domain | $UTS_TRUNCATE`\"
else
echo \#define LINUX_COMPILE_DOMAIN
fi
--
1.6.5.rc1
UTS_TRUNCATTE is simpler this way, and now editors idetify this as a
shell script.
Signed-off-by: Felipe Contreras <[email protected]>
---
scripts/mkcompile_h | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/scripts/mkcompile_h b/scripts/mkcompile_h
index f060763..bce3d0f 100755
--- a/scripts/mkcompile_h
+++ b/scripts/mkcompile_h
@@ -1,3 +1,5 @@
+#!/bin/sh
+
TARGET=$1
ARCH=$2
SMP=$3
@@ -50,7 +52,7 @@ UTS_VERSION="$UTS_VERSION $CONFIG_FLAGS $TIMESTAMP"
# Truncate to maximum length
UTS_LEN=64
-UTS_TRUNCATE="sed -e s/\(.\{1,$UTS_LEN\}\).*/\1/"
+UTS_TRUNCATE="cut -b -$UTS_LEN"
# Generate a temporary compile.h
--
1.6.5.rc1
Many still remain.
Signed-off-by: Felipe Contreras <[email protected]>
---
include/acpi/actypes.h | 36 ++++++++++++++++++------------------
1 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 37ba576..2d500fa 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -167,7 +167,7 @@ typedef u64 acpi_physical_address;
* Note: Em64_t and other X86-64 processors support misaligned transfers,
* so there is no need to define this flag.
*/
-#if defined (__IA64__) || defined (__ia64__)
+#if defined(__IA64__) || defined(__ia64__)
#define ACPI_MISALIGNMENT_NOT_SUPPORTED
#endif
@@ -242,10 +242,10 @@ typedef u32 acpi_physical_address;
* Map the OSL Mutex interfaces to binary semaphores.
*/
#define acpi_mutex acpi_semaphore
-#define acpi_os_create_mutex(out_handle) acpi_os_create_semaphore (1, 1, out_handle)
-#define acpi_os_delete_mutex(handle) (void) acpi_os_delete_semaphore (handle)
-#define acpi_os_acquire_mutex(handle,time) acpi_os_wait_semaphore (handle, 1, time)
-#define acpi_os_release_mutex(handle) (void) acpi_os_signal_semaphore (handle, 1)
+#define acpi_os_create_mutex(out_handle) acpi_os_create_semaphore(1, 1, out_handle)
+#define acpi_os_delete_mutex(handle) (void) acpi_os_delete_semaphore(handle)
+#define acpi_os_acquire_mutex(handle, time) acpi_os_wait_semaphore(handle, 1, time)
+#define acpi_os_release_mutex(handle) (void) acpi_os_signal_semaphore(handle, 1)
#endif
/* Configurable types for synchronization objects */
@@ -417,7 +417,7 @@ typedef unsigned long long acpi_integer;
/*
* Constants with special meanings
*/
-#define ACPI_ROOT_OBJECT ACPI_ADD_PTR (acpi_handle, NULL, ACPI_MAX_PTR)
+#define ACPI_ROOT_OBJECT ACPI_ADD_PTR(acpi_handle, NULL, ACPI_MAX_PTR)
#define ACPI_WAIT_FOREVER 0xFFFF /* u16, as per ACPI spec */
#define ACPI_DO_NOT_WAIT 0
@@ -438,8 +438,8 @@ typedef unsigned long long acpi_integer;
#define ACPI_SET_BIT(target,bit) ((target) |= (bit))
#define ACPI_CLEAR_BIT(target,bit) ((target) &= ~(bit))
-#define ACPI_MIN(a,b) (((a)<(b))?(a):(b))
-#define ACPI_MAX(a,b) (((a)>(b))?(a):(b))
+#define ACPI_MIN(a, b) (((a)<(b))?(a):(b))
+#define ACPI_MAX(a, b) (((a)>(b))?(a):(b))
/* Size calculation */
@@ -449,21 +449,21 @@ typedef unsigned long long acpi_integer;
#define ACPI_CAST_PTR(t, p) ((t *) (acpi_uintptr_t) (p))
#define ACPI_CAST_INDIRECT_PTR(t, p) ((t **) (acpi_uintptr_t) (p))
-#define ACPI_ADD_PTR(t, a, b) ACPI_CAST_PTR (t, (ACPI_CAST_PTR (u8, (a)) + (acpi_size)(b)))
-#define ACPI_PTR_DIFF(a, b) (acpi_size) (ACPI_CAST_PTR (u8, (a)) - ACPI_CAST_PTR (u8, (b)))
+#define ACPI_ADD_PTR(t, a, b) ACPI_CAST_PTR(t, (ACPI_CAST_PTR(u8, (a)) + (acpi_size)(b)))
+#define ACPI_PTR_DIFF(a, b) (acpi_size) (ACPI_CAST_PTR(u8, (a)) - ACPI_CAST_PTR(u8, (b)))
/* Pointer/Integer type conversions */
-#define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void, (void *) NULL,(acpi_size) i)
-#define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p, (void *) NULL)
-#define ACPI_OFFSET(d, f) (acpi_size) ACPI_PTR_DIFF (&(((d *)0)->f), (void *) NULL)
+#define ACPI_TO_POINTER(i) ACPI_ADD_PTR(void, (void *) NULL, (acpi_size) i)
+#define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF(p, (void *) NULL)
+#define ACPI_OFFSET(d, f) (acpi_size) ACPI_PTR_DIFF(&(((d *)0)->f), (void *) NULL)
#define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i)
#define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i)
#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
-#define ACPI_COMPARE_NAME(a,b) (*ACPI_CAST_PTR (u32, (a)) == *ACPI_CAST_PTR (u32, (b)))
+#define ACPI_COMPARE_NAME(a, b) (*ACPI_CAST_PTR(u32, (a)) == *ACPI_CAST_PTR(u32, (b)))
#else
-#define ACPI_COMPARE_NAME(a,b) (!ACPI_STRNCMP (ACPI_CAST_PTR (char, (a)), ACPI_CAST_PTR (char, (b)), ACPI_NAME_SIZE))
+#define ACPI_COMPARE_NAME(a, b) (!ACPI_STRNCMP(ACPI_CAST_PTR(char, (a)), ACPI_CAST_PTR(char, (b)), ACPI_NAME_SIZE))
#endif
/*******************************************************************************
@@ -631,7 +631,7 @@ typedef u32 acpi_event_type;
#define ACPI_EVENT_SLEEP_BUTTON 3
#define ACPI_EVENT_RTC 4
#define ACPI_EVENT_MAX 4
-#define ACPI_NUM_FIXED_EVENTS ACPI_EVENT_MAX + 1
+#define ACPI_NUM_FIXED_EVENTS (ACPI_EVENT_MAX + 1)
/*
* Event Status - Per event
@@ -777,7 +777,7 @@ typedef u8 acpi_adr_space_type;
#define ACPI_BITREG_ARB_DISABLE 0x13
#define ACPI_BITREG_MAX 0x13
-#define ACPI_NUM_BITREG ACPI_BITREG_MAX + 1
+#define ACPI_NUM_BITREG (ACPI_BITREG_MAX + 1)
/* Status register values. A 1 clears a status bit. 0 = no effect */
@@ -944,7 +944,7 @@ typedef
acpi_status(*acpi_adr_space_handler) (u32 function,
acpi_physical_address address,
u32 bit_width,
- acpi_integer * value,
+ acpi_integer *value,
void *handler_context,
void *region_context);
--
1.6.5.rc1
drivers/acpi/acpica/tbfadt.c: In function ‘acpi_tb_create_local_fadt’:
arch/x86/include/asm/string_32.h:74: warning: array subscript is above array bounds
Signed-off-by: Felipe Contreras <[email protected]>
---
include/acpi/actypes.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 2d500fa..2ebd3b0 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -438,8 +438,8 @@ typedef unsigned long long acpi_integer;
#define ACPI_SET_BIT(target,bit) ((target) |= (bit))
#define ACPI_CLEAR_BIT(target,bit) ((target) &= ~(bit))
-#define ACPI_MIN(a, b) (((a)<(b))?(a):(b))
-#define ACPI_MAX(a, b) (((a)>(b))?(a):(b))
+#define ACPI_MIN(a, b) min(a, b)
+#define ACPI_MAX(a, b) max(a, b)
/* Size calculation */
--
1.6.5.rc1
drivers/acpi/acpica/exfldio.c: In function ‘acpi_ex_extract_from_field’:
drivers/acpi/acpica/exfldio.c:761: warning: comparison of distinct pointer types lacks a cast
drivers/acpi/acpica/exfldio.c:761: warning: comparison of distinct pointer types lacks a cast
drivers/acpi/acpica/exfldio.c:761: warning: comparison of distinct pointer types lacks a cast
drivers/acpi/acpica/exfldio.c:780: warning: comparison of distinct pointer types lacks a cast
drivers/acpi/acpica/exfldio.c:780: warning: comparison of distinct pointer types lacks a cast
drivers/acpi/acpica/exfldio.c:780: warning: comparison of distinct pointer types lacks a cast
drivers/acpi/acpica/exfldio.c: In function ‘acpi_ex_insert_into_field’:
drivers/acpi/acpica/exfldio.c:880: warning: comparison of distinct pointer types lacks a cast
drivers/acpi/acpica/exfldio.c:880: warning: comparison of distinct pointer types lacks a cast
drivers/acpi/acpica/exfldio.c:880: warning: comparison of distinct pointer types lacks a cast
drivers/acpi/acpica/exfldio.c:933: warning: comparison of distinct pointer types lacks a cast
drivers/acpi/acpica/exfldio.c:933: warning: comparison of distinct pointer types lacks a cast
drivers/acpi/acpica/exfldio.c:933: warning: comparison of distinct pointer types lacks a cast
Signed-off-by: Felipe Contreras <[email protected]>
---
drivers/acpi/acpica/exfldio.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/acpi/acpica/exfldio.c b/drivers/acpi/acpica/exfldio.c
index 6687be1..4affc5f 100644
--- a/drivers/acpi/acpica/exfldio.c
+++ b/drivers/acpi/acpica/exfldio.c
@@ -760,7 +760,7 @@ acpi_ex_extract_from_field(union acpi_operand_object *obj_desc,
ACPI_MEMCPY(((char *)buffer) + buffer_offset, &merged_datum,
ACPI_MIN(obj_desc->common_field.access_byte_width,
- buffer_length - buffer_offset));
+ (u8)(buffer_length - buffer_offset)));
buffer_offset += obj_desc->common_field.access_byte_width;
merged_datum =
@@ -779,7 +779,7 @@ acpi_ex_extract_from_field(union acpi_operand_object *obj_desc,
ACPI_MEMCPY(((char *)buffer) + buffer_offset, &merged_datum,
ACPI_MIN(obj_desc->common_field.access_byte_width,
- buffer_length - buffer_offset));
+ (u8)(buffer_length - buffer_offset)));
return_ACPI_STATUS(AE_OK);
}
@@ -879,7 +879,7 @@ acpi_ex_insert_into_field(union acpi_operand_object *obj_desc,
ACPI_MEMCPY(&raw_datum, buffer,
ACPI_MIN(obj_desc->common_field.access_byte_width,
- buffer_length - buffer_offset));
+ (u8)(buffer_length - buffer_offset)));
merged_datum =
raw_datum << obj_desc->common_field.start_field_bit_offset;
@@ -932,7 +932,7 @@ acpi_ex_insert_into_field(union acpi_operand_object *obj_desc,
buffer_offset += obj_desc->common_field.access_byte_width;
ACPI_MEMCPY(&raw_datum, ((char *)buffer) + buffer_offset,
ACPI_MIN(obj_desc->common_field.access_byte_width,
- buffer_length - buffer_offset));
+ (u8)(buffer_length - buffer_offset)));
merged_datum |=
raw_datum << obj_desc->common_field.start_field_bit_offset;
}
--
1.6.5.rc1
On Thu, Sep 17, 2009 at 5:38 AM, Felipe Contreras
<[email protected]> wrote:
> Otherwise we get:
> "dnsdomainname: Unknown host"
>
> Signed-off-by: Felipe Contreras <[email protected]>
Acked-by: WANG Cong <[email protected]>
> ---
> scripts/mkcompile_h | 8 ++++++--
> 1 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/mkcompile_h b/scripts/mkcompile_h
> index 6a12dd9..f060763 100755
> --- a/scripts/mkcompile_h
> +++ b/scripts/mkcompile_h
> @@ -66,9 +66,13 @@ UTS_TRUNCATE="sed -e s/\(.\{1,$UTS_LEN\}\).*/\1/"
> echo \#define LINUX_COMPILE_HOST \"`hostname | $UTS_TRUNCATE`\"
>
> if [ -x /bin/dnsdomainname ]; then
> - echo \#define LINUX_COMPILE_DOMAIN \"`dnsdomainname | $UTS_TRUNCATE`\"
> + domain=`dnsdomainname 2> /dev/null`
> elif [ -x /bin/domainname ]; then
> - echo \#define LINUX_COMPILE_DOMAIN \"`domainname | $UTS_TRUNCATE`\"
> + domain=`domainname 2> /dev/null`
> + fi
> +
> + if [ -n "$domain" ]; then
> + echo \#define LINUX_COMPILE_DOMAIN \"`echo $domain | $UTS_TRUNCATE`\"
> else
> echo \#define LINUX_COMPILE_DOMAIN
> fi
> --
> 1.6.5.rc1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
On Thu, Sep 17, 2009 at 5:38 AM, Felipe Contreras
<[email protected]> wrote:
> UTS_TRUNCATTE is simpler this way, and now editors idetify this as a
> shell script.
>
> Signed-off-by: Felipe Contreras <[email protected]>
Looks good.
Acked-by: WANG Cong <[email protected]>
> ---
> scripts/mkcompile_h | 4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/scripts/mkcompile_h b/scripts/mkcompile_h
> index f060763..bce3d0f 100755
> --- a/scripts/mkcompile_h
> +++ b/scripts/mkcompile_h
> @@ -1,3 +1,5 @@
> +#!/bin/sh
> +
> TARGET=$1
> ARCH=$2
> SMP=$3
> @@ -50,7 +52,7 @@ UTS_VERSION="$UTS_VERSION $CONFIG_FLAGS $TIMESTAMP"
> # Truncate to maximum length
>
> UTS_LEN=64
> -UTS_TRUNCATE="sed -e s/\(.\{1,$UTS_LEN\}\).*/\1/"
> +UTS_TRUNCATE="cut -b -$UTS_LEN"
>
> # Generate a temporary compile.h
>
> --
> 1.6.5.rc1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
Commit-ID: 878f4f533e5b4498215e67e0f886b0fc81417f5e
Gitweb: http://git.kernel.org/tip/878f4f533e5b4498215e67e0f886b0fc81417f5e
Author: Felipe Contreras <[email protected]>
AuthorDate: Thu, 17 Sep 2009 00:38:38 +0300
Committer: Ingo Molnar <[email protected]>
CommitDate: Sun, 20 Sep 2009 20:18:57 +0200
x86: Trivial whitespace cleanups
Signed-off-by: Felipe Contreras <[email protected]>
Cc: Vegard Nossum <[email protected]>
Cc: Pekka Enberg <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Alok N Kataria <[email protected]>
Cc: "Tan Wei Chong" <[email protected]>
Cc: Len Brown <[email protected]>
Cc: Lin Ming <[email protected]>
Cc: Bob Moore <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
---
arch/x86/include/asm/string_32.h | 1 -
arch/x86/kernel/tsc.c | 2 +-
drivers/acpi/acpica/tbfadt.c | 1 -
3 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/arch/x86/include/asm/string_32.h b/arch/x86/include/asm/string_32.h
index c86f452..ae907e6 100644
--- a/arch/x86/include/asm/string_32.h
+++ b/arch/x86/include/asm/string_32.h
@@ -65,7 +65,6 @@ static __always_inline void *__constant_memcpy(void *to, const void *from,
case 4:
*(int *)to = *(int *)from;
return to;
-
case 3:
*(short *)to = *(short *)from;
*((char *)to + 2) = *((char *)from + 2);
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index 71f4368..8a2fc11 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -670,7 +670,7 @@ static int time_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
if ((val == CPUFREQ_PRECHANGE && freq->old < freq->new) ||
(val == CPUFREQ_POSTCHANGE && freq->old > freq->new) ||
(val == CPUFREQ_RESUMECHANGE)) {
- *lpj = cpufreq_scale(loops_per_jiffy_ref, ref_freq, freq->new);
+ *lpj = cpufreq_scale(loops_per_jiffy_ref, ref_freq, freq->new);
tsc_khz = cpufreq_scale(tsc_khz_ref, ref_freq, freq->new);
if (!(freq->flags & CPUFREQ_CONST_LOOPS))
diff --git a/drivers/acpi/acpica/tbfadt.c b/drivers/acpi/acpica/tbfadt.c
index 82b02dc..c016335 100644
--- a/drivers/acpi/acpica/tbfadt.c
+++ b/drivers/acpi/acpica/tbfadt.c
@@ -275,7 +275,6 @@ void acpi_tb_parse_fadt(u32 table_index)
void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length)
{
-
/*
* Check if the FADT is larger than the largest table that we expect
* (the ACPI 2.0/3.0 version). If so, truncate the table, and issue
On Thu, Sep 17, 2009 at 12:38:39AM +0300, Felipe Contreras wrote:
> Otherwise we get:
> "dnsdomainname: Unknown host"
>
> Signed-off-by: Felipe Contreras <[email protected]>
Thanks for the respin.
Applied both patches.
Sam