From patchwork Fri Aug 21 03:36:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yalin wang X-Patchwork-Id: 7047831 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9A9A19F358 for ; Fri, 21 Aug 2015 03:37:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C43C620616 for ; Fri, 21 Aug 2015 03:37:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E74D320612 for ; Fri, 21 Aug 2015 03:37:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753203AbbHUDhQ (ORCPT ); Thu, 20 Aug 2015 23:37:16 -0400 Received: from mail-pd0-f171.google.com ([209.85.192.171]:36658 "EHLO mail-pd0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753191AbbHUDhP (ORCPT ); Thu, 20 Aug 2015 23:37:15 -0400 Received: by pdbmi9 with SMTP id mi9so21434293pdb.3; Thu, 20 Aug 2015 20:37:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=SQn/p51Z7JS/EfPqwdFYEs1D14iNFllZNFHSikqNUmY=; b=zzLhQcgE9cVnbtqn7boXgzIglSibVmG1xrFTFqqlcxuhiZWov0JHgB/dxkWoetyESb kZWJP0hp1rqM+mua6ssOkZIZnDTGAxrLB85MX6e98LUUQ38O7kKxWS/eTwgWTMR6oQJ8 2Wo/lJQU/UrJXz6iEhq1QeW4OiA1sBl3R+tP48XAv98XztgcfFnPUgKuIN8yHdaVHbxq PjxD4dfsLi1O42Q0vHypOWVt544H92aYHBHfAadARBNo4B04bsdwkYTQ82MJWy+53ury Vh1ZdP1Axp12gPtHktg25r+50yt8o5FDx8PR6LRBBzKQDGxfCQ3atkEHY1hPgMa9kpbs brEw== X-Received: by 10.70.44.133 with SMTP id e5mr13209036pdm.24.1440128233760; Thu, 20 Aug 2015 20:37:13 -0700 (PDT) Received: from ubuntu.localdomain ([17.87.20.100]) by smtp.googlemail.com with ESMTPSA id ff9sm1012382pab.48.2015.08.20.20.37.10 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 20 Aug 2015 20:37:12 -0700 (PDT) From: yalin wang To: adaplas@gmail.com, plagnioj@jcrosoft.com, tomi.valkeinen@ti.com, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: yalin wang Subject: [RFC V2] fbdev/nvidia:change reverse_order() macro Date: Fri, 21 Aug 2015 11:36:59 +0800 Message-Id: <1440128219-2951-1-git-send-email-yalin.wang2010@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This change reverse_order() to swab32(bitrev32()), so that it can have better performance on some platforms. Signed-off-by: yalin wang --- drivers/video/fbdev/nvidia/nv_local.h | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/video/fbdev/nvidia/nv_local.h b/drivers/video/fbdev/nvidia/nv_local.h index 68e508d..2c6baa1 100644 --- a/drivers/video/fbdev/nvidia/nv_local.h +++ b/drivers/video/fbdev/nvidia/nv_local.h @@ -97,18 +97,19 @@ #ifdef __LITTLE_ENDIAN +#include #include +static inline void reverse_order(u32 *data) +{ + *data = swab32(bitrev32(*data)); +} -#define reverse_order(l) \ -do { \ - u8 *a = (u8 *)(l); \ - a[0] = bitrev8(a[0]); \ - a[1] = bitrev8(a[1]); \ - a[2] = bitrev8(a[2]); \ - a[3] = bitrev8(a[3]); \ -} while(0) #else -#define reverse_order(l) do { } while(0) -#endif /* __LITTLE_ENDIAN */ +static inline void reverse_order(u32 *data) +{ + +} + +#endif /* __LITTLE_ENDIAN */ #endif /* __NV_LOCAL_H__ */