From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14833 invoked by alias); 5 Feb 2010 17:09:14 -0000 Received: (qmail 14815 invoked by uid 22791); 5 Feb 2010 17:09:12 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 05 Feb 2010 17:09:08 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o15H96PO027184 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 5 Feb 2010 12:09:07 -0500 Received: from dhcp-100-2-132.bos.redhat.com (dhcp-100-2-132.bos.redhat.com [10.16.2.132]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o15H953A019643; Fri, 5 Feb 2010 12:09:06 -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 17:09:00 -0000 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 X-IsSubscribed: yes Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2010-q1/txt/msg00344.txt.bz2 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