From patchwork Mon Feb 22 00:37:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Joe Perches X-Patchwork-Id: 8369891 Return-Path: X-Original-To: patchwork-linux-btrfs@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 1E56D9F314 for ; Mon, 22 Feb 2016 00:39:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4477E203AA for ; Mon, 22 Feb 2016 00:39:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6E52D203A9 for ; Mon, 22 Feb 2016 00:39:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752666AbcBVAh7 (ORCPT ); Sun, 21 Feb 2016 19:37:59 -0500 Received: from smtprelay0228.hostedemail.com ([216.40.44.228]:45266 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752383AbcBVAh6 (ORCPT ); Sun, 21 Feb 2016 19:37:58 -0500 Received: from filter.hostedemail.com (unknown [216.40.38.60]) by smtprelay03.hostedemail.com (Postfix) with ESMTP id 141876AA2B; Mon, 22 Feb 2016 00:37:57 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2, 0, 0, , d41d8cd98f00b204, joe@perches.com, :::::::::::, RULES_HIT:41:355:379:541:599:966:968:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2196:2199:2393:2559:2562:2828:2914:3138:3139:3140:3141:3142:3352:3622:3865:3871:3872:4321:4385:5007:6261:7875:10004:10400:10848:11026:11232:11473:11658:11783:11914:12296:12517:12519:12555:12740:13069:13311:13357:13894:14659:21080:30054:30064:30091, 0, RBL:none, CacheIP:none, Bayesian:0.5, 0.5, 0.5, Netcheck:none, DomainCache:0, MSF:not bulk, SPF:fn, MSBL:0, DNSBL:none, Custom_rules:0:0:0, LFtime:1, LUA_SUMMARY:none X-HE-Tag: screw38_4535f84db4146 X-Filterd-Recvd-Size: 2331 Received: from joe-X200MA (81.sub-70-211-64.myvzw.com [70.211.64.81]) (Authenticated sender: joe@perches.com) by omf06.hostedemail.com (Postfix) with ESMTPA; Mon, 22 Feb 2016 00:37:55 +0000 (UTC) Message-ID: <1456101474.31061.16.camel@perches.com> Subject: Re: [PATCH] Btrfs: compression: added line after variable declaration From: Joe Perches To: Philippe Loctaux , clm@fb.com Cc: jbacik@fb.com, dsterba@suse.com, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org Date: Sun, 21 Feb 2016 16:37:54 -0800 In-Reply-To: <1456097209-3916-1-git-send-email-phil@philippeloctaux.com> References: <1456097209-3916-1-git-send-email-phil@philippeloctaux.com> X-Mailer: Evolution 3.18.4-0ubuntu1 Mime-Version: 1.0 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 On Mon, 2016-02-22 at 00:26 +0100, Philippe Loctaux wrote: > Added line after variable declaration, fixing checkpatch warning. [] > diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c [] > @@ -522,6 +522,7 @@ static noinline int add_ra_bio_pages(struct inode *inode, >   >   if (zero_offset) { >   int zeros; > + >   zeros = PAGE_CACHE_SIZE - zero_offset; >   userpage = kmap_atomic(page); >   memset(userpage + zero_offset, 0, zeros); This zeros temporary is used once. Perhaps it should just be removed instead. Maybe the userpage declaration should move too. Something like: ---  fs/btrfs/compression.c | 9 ++++-----  1 file changed, 4 insertions(+), 5 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c index 3346cd8..be41f83 100644 --- a/fs/btrfs/compression.c +++ b/fs/btrfs/compression.c @@ -517,14 +517,13 @@ static noinline int add_ra_bio_pages(struct inode *inode,   free_extent_map(em);     if (page->index == end_index) { - char *userpage;   size_t zero_offset = isize & (PAGE_CACHE_SIZE - 1);     if (zero_offset) { - int zeros; - zeros = PAGE_CACHE_SIZE - zero_offset; - userpage = kmap_atomic(page); - memset(userpage + zero_offset, 0, zeros); + char *userpage = kmap_atomic(page); + + memset(userpage + zero_offset, 0, +        PAGE_CACHE_SIZE - zero_offset);   flush_dcache_page(page);   kunmap_atomic(userpage);   }