From patchwork Fri Aug 21 05:59:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yalin wang X-Patchwork-Id: 7048201 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8DB8DC05AC for ; Fri, 21 Aug 2015 05:59:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BAB8F2041D for ; Fri, 21 Aug 2015 05:59:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E37C22041C for ; Fri, 21 Aug 2015 05:59:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751819AbbHUF7Z (ORCPT ); Fri, 21 Aug 2015 01:59:25 -0400 Received: from mail-pa0-f47.google.com ([209.85.220.47]:34534 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751077AbbHUF7Y (ORCPT ); Fri, 21 Aug 2015 01:59:24 -0400 Received: by paom9 with SMTP id m9so11384646pao.1; Thu, 20 Aug 2015 22:59:24 -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=JQv0cE6ajJTrU8CkOvm2qNMiE3FCXjcwZpNhUCZB8S4=; b=ZPVyhvHPfyev5eFi83oOAhyaKfvKmcVOVD3MZYscfMVR54mC70mzNmiUhr17x5AFWa CxeYT+ak2t1KEeaMKBat2E2qgWngD6Y3xwwMxTorfqsXrAwQVKm1eqPOkdx5jfJ/z6uL Lg3/8yQhbqVVlIEuAxLeVMObRFjyOisb/JTz8ioJR6dQkxU2+34N5H7LMmbPUVIwl9b1 I56lcFsC7GwYFsNyFcuyYpvbyQDazf5rMi0T/5v0CZwdlYNonK6yx59YBaYd0EHCtEJq hsdp8sbpSPmf+W9I1yKozQj3FBQUr2xCchY8WuFS1TjPygTakGz+ii6CJq2iV3eKV1Cg UuGw== X-Received: by 10.68.135.161 with SMTP id pt1mr13967204pbb.47.1440136764191; Thu, 20 Aug 2015 22:59:24 -0700 (PDT) Received: from ubuntu.localdomain ([17.87.20.100]) by smtp.googlemail.com with ESMTPSA id tt8sm6320844pbc.49.2015.08.20.22.59.20 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 20 Aug 2015 22:59:23 -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/riva:change to use generice function to implement reverse_order() Date: Fri, 21 Aug 2015 13:59:10 +0800 Message-Id: <1440136750-30990-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.6 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 to use swab32(bitrev32()) to implement reverse_order() function, have better performance on some platforms. Signed-off-by: yalin wang --- drivers/video/fbdev/riva/fbdev.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/video/fbdev/riva/fbdev.c b/drivers/video/fbdev/riva/fbdev.c index f1ad274..ccf0f82 100644 --- a/drivers/video/fbdev/riva/fbdev.c +++ b/drivers/video/fbdev/riva/fbdev.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #ifdef CONFIG_PMAC_BACKLIGHT #include @@ -453,11 +454,7 @@ static inline unsigned char MISCin(struct riva_par *par) static inline void reverse_order(u32 *l) { - u8 *a = (u8 *)l; - a[0] = bitrev8(a[0]); - a[1] = bitrev8(a[1]); - a[2] = bitrev8(a[2]); - a[3] = bitrev8(a[3]); + *l = swab32(bitrev32(*l)); } /* ------------------------------------------------------------------------- *