From mboxrd@z Thu Jan 1 00:00:00 1970 From: santosh.shilimkar@ti.com (Santosh Shilimkar) Date: Mon, 25 Nov 2013 08:57:54 -0500 Subject: [PATCH] mm: nobootmem: avoid type warning about alignment value In-Reply-To: <529217C7.6030304@cogentembedded.com> References: <1385249326-9089-1-git-send-email-santosh.shilimkar@ti.com> <529217C7.6030304@cogentembedded.com> Message-ID: <52935762.1080409@ti.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Sunday 24 November 2013 10:14 AM, Sergei Shtylyov wrote: > Hello. > > On 24-11-2013 3:28, Santosh Shilimkar wrote: > >> Building ARM with NO_BOOTMEM generates below warning. Using min_t > > Where is that below? :-) > Damn.. Posted a wrong version of the patch ;-( Here is the one with warning message included. >>From 571dfdf4cf8ac7dfd50bd9b7519717c42824f1c3 Mon Sep 17 00:00:00 2001 From: Santosh Shilimkar Date: Sat, 23 Nov 2013 18:16:50 -0500 Subject: [PATCH] mm: nobootmem: avoid type warning about alignment value Building ARM with NO_BOOTMEM generates below warning. mm/nobootmem.c: In function ?__free_pages_memory?: mm/nobootmem.c:88:11: warning: comparison of distinct pointer types lacks a cast Using min_t to find the correct alignment avoids the warning. Cc: Tejun Heo Cc: Andrew Morton Signed-off-by: Santosh Shilimkar --- mm/nobootmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/nobootmem.c b/mm/nobootmem.c index 2c254d3..8954e43 100644 --- a/mm/nobootmem.c +++ b/mm/nobootmem.c @@ -85,7 +85,7 @@ static void __init __free_pages_memory(unsigned long start, unsigned long end) int order; while (start < end) { - order = min(MAX_ORDER - 1UL, __ffs(start)); + order = min_t(size_t, MAX_ORDER - 1UL, __ffs(start)); while (start + (1UL << order) > end) order--; -- 1.7.9.5 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qa0-f49.google.com (mail-qa0-f49.google.com [209.85.216.49]) by kanga.kvack.org (Postfix) with ESMTP id 9F0B76B00B6 for ; Mon, 25 Nov 2013 08:58:03 -0500 (EST) Received: by mail-qa0-f49.google.com with SMTP id ii20so6291140qab.15 for ; Mon, 25 Nov 2013 05:58:03 -0800 (PST) Received: from bear.ext.ti.com (bear.ext.ti.com. [192.94.94.41]) by mx.google.com with ESMTPS id hb10si24104937qeb.84.2013.11.25.05.58.02 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 25 Nov 2013 05:58:02 -0800 (PST) Message-ID: <52935762.1080409@ti.com> Date: Mon, 25 Nov 2013 08:57:54 -0500 From: Santosh Shilimkar MIME-Version: 1.0 Subject: Re: [PATCH] mm: nobootmem: avoid type warning about alignment value References: <1385249326-9089-1-git-send-email-santosh.shilimkar@ti.com> <529217C7.6030304@cogentembedded.com> In-Reply-To: <529217C7.6030304@cogentembedded.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 8bit Sender: owner-linux-mm@kvack.org List-ID: To: Sergei Shtylyov Cc: linux-kernel@vger.kernel.org, Tejun Heo , linux-mm@kvack.org, Andrew Morton , linux-arm-kernel@lists.infradead.org On Sunday 24 November 2013 10:14 AM, Sergei Shtylyov wrote: > Hello. > > On 24-11-2013 3:28, Santosh Shilimkar wrote: > >> Building ARM with NO_BOOTMEM generates below warning. Using min_t > > Where is that below? :-) > Damn.. Posted a wrong version of the patch ;-( Here is the one with warning message included. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756715Ab3KYN6a (ORCPT ); Mon, 25 Nov 2013 08:58:30 -0500 Received: from bear.ext.ti.com ([192.94.94.41]:36656 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754885Ab3KYN6Z (ORCPT ); Mon, 25 Nov 2013 08:58:25 -0500 Message-ID: <52935762.1080409@ti.com> Date: Mon, 25 Nov 2013 08:57:54 -0500 From: Santosh Shilimkar User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Sergei Shtylyov CC: , Tejun Heo , , Andrew Morton , Subject: Re: [PATCH] mm: nobootmem: avoid type warning about alignment value References: <1385249326-9089-1-git-send-email-santosh.shilimkar@ti.com> <529217C7.6030304@cogentembedded.com> In-Reply-To: <529217C7.6030304@cogentembedded.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sunday 24 November 2013 10:14 AM, Sergei Shtylyov wrote: > Hello. > > On 24-11-2013 3:28, Santosh Shilimkar wrote: > >> Building ARM with NO_BOOTMEM generates below warning. Using min_t > > Where is that below? :-) > Damn.. Posted a wrong version of the patch ;-( Here is the one with warning message included. >>From 571dfdf4cf8ac7dfd50bd9b7519717c42824f1c3 Mon Sep 17 00:00:00 2001 From: Santosh Shilimkar Date: Sat, 23 Nov 2013 18:16:50 -0500 Subject: [PATCH] mm: nobootmem: avoid type warning about alignment value Building ARM with NO_BOOTMEM generates below warning. mm/nobootmem.c: In function ‘__free_pages_memory’: mm/nobootmem.c:88:11: warning: comparison of distinct pointer types lacks a cast Using min_t to find the correct alignment avoids the warning. Cc: Tejun Heo Cc: Andrew Morton Signed-off-by: Santosh Shilimkar --- mm/nobootmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/nobootmem.c b/mm/nobootmem.c index 2c254d3..8954e43 100644 --- a/mm/nobootmem.c +++ b/mm/nobootmem.c @@ -85,7 +85,7 @@ static void __init __free_pages_memory(unsigned long start, unsigned long end) int order; while (start < end) { - order = min(MAX_ORDER - 1UL, __ffs(start)); + order = min_t(size_t, MAX_ORDER - 1UL, __ffs(start)); while (start + (1UL << order) > end) order--; -- 1.7.9.5