From patchwork Fri May 9 22:45:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: George Spelvin X-Patchwork-Id: 4170211 Return-Path: X-Original-To: patchwork-ocfs2-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B4F3E9F1C0 for ; Tue, 13 May 2014 18:42:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0381A2027D for ; Tue, 13 May 2014 18:42:35 +0000 (UTC) Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8B0FB20172 for ; Tue, 13 May 2014 18:42:33 +0000 (UTC) Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s4DIgHe7023294 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 13 May 2014 18:42:18 GMT Received: from oss.oracle.com (oss-external.oracle.com [137.254.96.51]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s4DIgB7J017078 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 13 May 2014 18:42:11 GMT Received: from localhost ([127.0.0.1] helo=oss.oracle.com) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1WkHbS-0008Sr-8T; Tue, 13 May 2014 11:39:02 -0700 Received: from ucsinet22.oracle.com ([156.151.31.94]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1WitXV-0003nt-TC for ocfs2-devel@oss.oracle.com; Fri, 09 May 2014 15:45:14 -0700 Received: from userp1020.oracle.com (userp1020.oracle.com [156.151.31.79]) by ucsinet22.oracle.com (8.14.5+Sun/8.14.5) with ESMTP id s49MjC0Y022806 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Fri, 9 May 2014 22:45:13 GMT Received: from ns.horizon.com (ns.horizon.com [71.41.210.147]) by userp1020.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with SMTP id s49Mj9nG022959 for ; Fri, 9 May 2014 22:45:11 GMT Received: (qmail 27913 invoked by uid 1000); 9 May 2014 18:45:08 -0400 Date: 9 May 2014 18:45:08 -0400 Message-ID: <20140509224508.27912.qmail@ns.horizon.com> From: "George Spelvin" To: tao.ma@oracle.com X-Flow-Control-Info: class=Pass-to-MM reputation=ipRisk-All ip=71.41.210.147 ct-class=T2 ct-vol1=1 ct-vol2=0 ct-vol3=0 ct-risk=67 ct-spam1=75 ct-spam2=0 ct-bulk=0 rcpts=1 size=875 X-Sendmail-CM-Score: 0.00% X-Sendmail-CM-Analysis: v=2.1 cv=QuRngzCd c=1 sm=1 tr=0 a=FNFn4Nt/4F9GmOA5wR5c9Q==:117 a=FNFn4Nt/4F9GmOA5wR5c9Q==:17 a=vmZkGlBaNpEA:10 a=wk54qo3VhqYA:10 a=azj6Gt-4AAAA:8 a=0SYFrKLxOF1Wqye66U8A:9 a=eJ1lpvm07AkA:10 X-Sendmail-CT-RefID: str=0001.0A090206.536D5A78.0079, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-Sendmail-CT-Classification: not spam X-Mailman-Approved-At: Tue, 13 May 2014 11:39:00 -0700 Cc: mfasheh@suse.com, ocfs2-devel@oss.oracle.com, linux@horizon.com Subject: [Ocfs2-devel] [PATCH] ocfs2: Remove some redundant casting X-BeenThere: ocfs2-devel@oss.oracle.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ocfs2-devel-bounces@oss.oracle.com Errors-To: ocfs2-devel-bounces@oss.oracle.com X-Source-IP: acsinet22.oracle.com [141.146.126.238] X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 There are two standard techniques for dereferencing structures pointed to by void *: cast to the right type each time they're used, or assign to local variables of the right type. But there's no need to do *both*. Signed-off-by: George Spelvin Reviewed-by: Jie Liu --- Obviously, this makes zero difference to the generated code, but it's prettier. diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c index 6ba4bcbc47..714e53b9cc 100644 --- a/fs/ocfs2/refcounttree.c +++ b/fs/ocfs2/refcounttree.c @@ -1408,10 +1408,9 @@ static void swap_refcount_rec(void *a, void *b, int size) { struct ocfs2_refcount_rec *l = a, *r = b, tmp; - tmp = *(struct ocfs2_refcount_rec *)l; - *(struct ocfs2_refcount_rec *)l = - *(struct ocfs2_refcount_rec *)r; - *(struct ocfs2_refcount_rec *)r = tmp; + tmp = *l; + *l = *r; + *r = tmp; } /*