Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757033Ab0BERJ0 (ORCPT ); Fri, 5 Feb 2010 12:09:26 -0500 Received: from mx1.redhat.com ([209.132.183.28]:22582 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752892Ab0BERJZ (ORCPT ); Fri, 5 Feb 2010 12:09:25 -0500 From: Masami Hiramatsu Subject: [PATCH -tip v2] x86/alternatives: Fix build warning To: Ingo Molnar , lkml Cc: systemtap , DLE , Masami Hiramatsu Date: Fri, 05 Feb 2010 12:16:47 -0500 Message-ID: <20100205171647.15750.37221.stgit@dhcp-100-2-132.bos.redhat.com> In-Reply-To: <20100205071249.GB9320@elte.hu> References: <20100205071249.GB9320@elte.hu> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1961 Lines: 62 Fixes below warnings. ==== FYI, there's this new build warning on x86 defconfig: arch/x86/kernel/alternative.c: In function 'alternatives_text_reserved': arch/x86/kernel/alternative.c:402: warning: comparison of distinct pointer types lacks a cast arch/x86/kernel/alternative.c:402: warning: comparison of distinct pointer types lacks a cast arch/x86/kernel/alternative.c:405: warning: comparison of distinct pointer types lacks a cast arch/x86/kernel/alternative.c:405: warning: comparison of distinct pointer types lacks a cast Caused by: 2cfa197: ftrace/alternatives: Introducing *_text_reserved functions ==== Changes in v2: - Use local variables to compare, instead of type casts. Signed-off-by: Masami Hiramatsu Reported-by: Ingo Molnar --- arch/x86/kernel/alternative.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index 3832fdc..e6ea034 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c @@ -397,12 +397,14 @@ int alternatives_text_reserved(void *start, void *end) { struct smp_alt_module *mod; u8 **ptr; + u8 *text_start = start; + u8 *text_end = end; list_for_each_entry(mod, &smp_alt_modules, next) { - if (mod->text > end || mod->text_end < start) + if (mod->text > text_end || mod->text_end < text_start) continue; for (ptr = mod->locks; ptr < mod->locks_end; ptr++) - if (start <= *ptr && end >= *ptr) + if (text_start <= *ptr && text_end >= *ptr) return 1; } -- Masami Hiramatsu Software Engineer Hitachi Computer Products (America), Inc. Software Solutions Division e-mail: mhiramat@redhat.com -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/