Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754441AbYBLXHA (ORCPT ); Tue, 12 Feb 2008 18:07:00 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751201AbYBLXGw (ORCPT ); Tue, 12 Feb 2008 18:06:52 -0500 Received: from fg-out-1718.google.com ([72.14.220.155]:4852 "EHLO fg-out-1718.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750931AbYBLXGu (ORCPT ); Tue, 12 Feb 2008 18:06:50 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=to:cc:subject:date:message-id:x-mailer:from; b=qMTn11XcxE39fGBXO08xFUvOzalpV5Pnz0PjxLxiKZCkFKIwsGLfBTHI1e8eEG9Xs8SzzRr7mdTJ7es5vpM2lAqHyR4LJtReU/dqg4g1DKv7oiDo5ybAZn1pgcUMMjDiJ8S/KWkZThM4RdiEkwz0QHXF1ZP65kLk/SpMzaclBpE= To: LKML Cc: Marcin Slusarz Subject: [PATCHSET] [bl]e*_add_cpu conversions Date: Wed, 13 Feb 2008 00:06:05 +0100 Message-Id: <1202857582-15450-1-git-send-email-marcin.slusarz@gmail.com> X-Mailer: git-send-email 1.5.3.7 From: marcin.slusarz@gmail.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4032 Lines: 134 From: Marcin Slusarz Hi This patchset converts big/little_endian_variable = cpu_to_[bl]eX([bl]eX_to_cpu(big/little_endian_variable) + expression_in_cpu_byteorder); to: [bl]eX_add_cpu(&big/little_endian_variable, expression_in_cpu_byteorder); All patches were generated by spatch, then reviewed and fixed to follow coding style. Semantic patch: @@ expression *X; expression Y; @@ ( - *X = cpu_to_le64(le64_to_cpu(*X) + Y); + le64_add_cpu(X, Y); | - *X = cpu_to_le32(le32_to_cpu(*X) + Y); + le32_add_cpu(X, Y); | - *X = cpu_to_le16(le16_to_cpu(*X) + Y); + le16_add_cpu(X, Y); | - *X = cpu_to_be64(be64_to_cpu(*X) + Y); + be64_add_cpu(X, Y); | - *X = cpu_to_be32(be32_to_cpu(*X) + Y); + be32_add_cpu(X, Y); | - *X = cpu_to_be16(be16_to_cpu(*X) + Y); + be16_add_cpu(X, Y); | - *X = cpu_to_le64(le64_to_cpu(*X) - Y); + le64_add_cpu(X, -Y); | - *X = cpu_to_le32(le32_to_cpu(*X) - Y); + le32_add_cpu(X, -Y); | - *X = cpu_to_le16(le16_to_cpu(*X) - Y); + le16_add_cpu(X, -Y); | - *X = cpu_to_be64(be64_to_cpu(*X) - Y); + be64_add_cpu(X, -Y); | - *X = cpu_to_be32(be32_to_cpu(*X) - Y); + be32_add_cpu(X, -Y); | - *X = cpu_to_be16(be16_to_cpu(*X) - Y); + be16_add_cpu(X, -Y); ) @@ expression X, Y; @@ ( - X = cpu_to_le64(le64_to_cpu(X) + Y); + le64_add_cpu(&X, Y); | - X = cpu_to_le32(le32_to_cpu(X) + Y); + le32_add_cpu(&X, Y); | - X = cpu_to_le16(le16_to_cpu(X) + Y); + le16_add_cpu(&X, Y); | - X = cpu_to_be64(be64_to_cpu(X) + Y); + be64_add_cpu(&X, Y); | - X = cpu_to_be32(be32_to_cpu(X) + Y); + be32_add_cpu(&X, Y); | - X = cpu_to_be16(be16_to_cpu(X) + Y); + be16_add_cpu(&X, Y); | - X = cpu_to_le64(le64_to_cpu(X) - Y); + le64_add_cpu(&X, -Y); | - X = cpu_to_le32(le32_to_cpu(X) - Y); + le32_add_cpu(&X, -Y); | - X = cpu_to_le16(le16_to_cpu(X) - Y); + le16_add_cpu(&X, -Y); | - X = cpu_to_be64(be64_to_cpu(X) - Y); + be64_add_cpu(&X, -Y); | - X = cpu_to_be32(be32_to_cpu(X) - Y); + be32_add_cpu(&X, -Y); | - X = cpu_to_be16(be16_to_cpu(X) - Y); + be16_add_cpu(&X, -Y); ) diffstat: crypto/lrw.c | 2 +- drivers/ieee1394/csr.c | 6 ++---- drivers/infiniband/hw/mthca/mthca_cq.c | 2 +- drivers/net/wireless/ipw2200.c | 4 +--- drivers/scsi/aacraid/commsup.c | 2 +- drivers/scsi/ips.c | 8 ++------ fs/affs/file.c | 4 ++-- fs/ext2/ialloc.c | 12 ++++-------- fs/ext2/super.c | 2 +- fs/ext2/xattr.c | 9 +++------ fs/ext4/balloc.c | 7 ++----- fs/ext4/extents.c | 20 +++++++++----------- fs/ext4/ialloc.c | 12 ++++-------- fs/ext4/mballoc.c | 7 ++----- fs/ext4/resize.c | 6 ++---- fs/ext4/super.c | 2 +- fs/ext4/xattr.c | 6 ++---- fs/gfs2/dir.c | 6 +++--- fs/hfs/mdb.c | 2 +- fs/hfsplus/super.c | 2 +- fs/jfs/jfs_dmap.c | 11 +++++------ fs/jfs/jfs_imap.c | 15 ++++++--------- fs/jfs/jfs_xtree.c | 26 ++++++++------------------ fs/ntfs/upcase.c | 5 ++--- fs/ocfs2/dir.c | 5 ++--- fs/ocfs2/localalloc.c | 3 +-- fs/quota_v2.c | 4 ++-- fs/reiserfs/objectid.c | 5 ++--- fs/reiserfs/stree.c | 3 +-- fs/sysv/sysv.h | 8 ++++---- fs/ufs/swab.h | 16 ++++++++-------- 31 files changed, 86 insertions(+), 136 deletions(-) Marcin -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/