From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754324Ab1A0N4Q (ORCPT ); Thu, 27 Jan 2011 08:56:16 -0500 Received: from mail-iw0-f174.google.com ([209.85.214.174]:45635 "EHLO mail-iw0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754055Ab1A0N4N (ORCPT ); Thu, 27 Jan 2011 08:56:13 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=b+Vo6+aIoczmVElMKoWnhYVCFmOpO3mKcb6pVR7RymHcaYx7EeTuFOyuG45S4XosHD eFp74pynDJm4uwby0psLYIZM14N2XanqAnNwSKtNKeme6EzpgGOnJDeTz9ObJlJWkMzQ PW2j3T0s0jwJhRjqoTl0sEUr9jafGSTYKlOlY= From: Akinobu Mita To: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, akpm@linux-foundation.org Cc: Akinobu Mita , Greg Ungerer , Greg Ungerer , Geert Uytterhoeven , Roman Zippel , Andreas Schwab Subject: [PATCH -mm 6/6] m68knommu: convert little-endian bitops macros to static inline functions Date: Thu, 27 Jan 2011 22:56:23 +0900 Message-Id: <1296136583-13815-7-git-send-email-akinobu.mita@gmail.com> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1296136583-13815-1-git-send-email-akinobu.mita@gmail.com> References: <1296136583-13815-1-git-send-email-akinobu.mita@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org (This patch is intended to be folded into the patch in -mm: m68knommu-introduce-little-endian-bitops.patch) A few little-endian bitops on m68knommu are written as preprocessor macros with the cast to "unsigned long *". This means that even non-pointers will be accepted without an error, and that is a Very Bad Thing. This converts the little-endian bitops macros to static inline functions with proper prototypes. Suggested-by: "H. Peter Anvin" Signed-off-by: Akinobu Mita Cc: Greg Ungerer Cc: Greg Ungerer Cc: Geert Uytterhoeven Cc: Roman Zippel Cc: Andreas Schwab --- arch/m68k/include/asm/bitops_no.h | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/arch/m68k/include/asm/bitops_no.h b/arch/m68k/include/asm/bitops_no.h index c5f5a78..7d3779f 100644 --- a/arch/m68k/include/asm/bitops_no.h +++ b/arch/m68k/include/asm/bitops_no.h @@ -198,11 +198,15 @@ static __inline__ int __test_bit(int nr, const volatile unsigned long * addr) #define BITOP_LE_SWIZZLE ((BITS_PER_LONG-1) & ~0x7) -#define __set_bit_le(nr, addr) \ - __set_bit((nr) ^ BITOP_LE_SWIZZLE, (unsigned long *)(addr)) +static inline void __set_bit_le(int nr, void *addr) +{ + __set_bit(nr ^ BITOP_LE_SWIZZLE, addr); +} -#define __clear_bit_le(nr, addr) \ - __clear_bit((nr) ^ BITOP_LE_SWIZZLE, (unsigned long *)(addr)) +static inline void __clear_bit_le(int nr, void *addr) +{ + __clear_bit(nr ^ BITOP_LE_SWIZZLE, addr); +} static inline int __test_and_set_bit_le(int nr, volatile void *addr) { -- 1.7.3.4