Received: by 10.223.164.202 with SMTP id h10csp1495646wrb; Mon, 27 Nov 2017 03:39:37 -0800 (PST) X-Google-Smtp-Source: AGs4zMZmcVQgXQ4751kDJCWDp6C9TyVD9wCuHpq4yIt3fApmpEgZDgnAAFngHJiERKfbBu/uv00o X-Received: by 10.99.113.86 with SMTP id b22mr37301646pgn.309.1511782777449; Mon, 27 Nov 2017 03:39:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511782777; cv=none; d=google.com; s=arc-20160816; b=LTzDK9dkUuMMM12Q6HYOtk44OAZ5ZBVSV7jLk8MpYChPtwemcXPn9q0TZ+edjKd/8K J9jp380forlnk27QnMbq9nQXkNwRMZYN7mZl0AccFUNSqNNKFXc0gkSzLWdAvG9jCHHZ FUcD15OBdSfM9o4vkEfd53+eiA4P4KnZ4ct/+/avwZheW8go1eu6Tr+T3HLUu8pYaGze 2yjG0VyIII13deKykVc+LEBu3ONDi1KWl2/nm5rqvVWAY3iMdKtgoRgvfLvBs5FKbA8d q3DsQIOL3e7R3jn4runP6fBGIBCH8O2f99hduf4SfjXa/h56o2B2yUHRd8fqiwHXkxMP cAdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=NNSGIZ18PL5s4OPOEUNQqB2jIGzbFnlTxzu2yLkpLBM=; b=ZxxYzn13frV3BGRUW7E1ArvrFtaLgIOYmIbHARD2uFNoq5GHYfXQ8GNybphuBLvtmL qO94fJpwXR10bOlUr4O4eav+fZVJ1QcKwVQnO8yyWwHM+NUi+aiWIRHpLWQNhqA07Jxf wcrhPdxfoLWL0syVCftZnqCSjqcI/DWSZD+BxMYspE7HSN7rBv3OdWZ7b4gC7be7YCI7 l/hQSymirLYBy57iixI8FMIuUKZHw/HcPZBQX6o8r0C5Ls6k+4IJhhrZSOeyN+8jonHq p5rm4v9vGbNbU+CdMXn58vO3MrZCKfuf7EvmxXoI3MRexpvS7brBzWbXA93VbR+CDQSb ECVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=Cklwt1S1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 188si22618923pgc.709.2017.11.27.03.39.25; Mon, 27 Nov 2017 03:39:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=Cklwt1S1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752060AbdK0Lhk (ORCPT + 77 others); Mon, 27 Nov 2017 06:37:40 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:53333 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751724AbdK0Lhi (ORCPT ); Mon, 27 Nov 2017 06:37:38 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id F28DB20CBC; Mon, 27 Nov 2017 06:37:37 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute4.internal (MEProxy); Mon, 27 Nov 2017 06:37:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=NNSGIZ 18PL5s4OPOEUNQqB2jIGzbFnlTxzu2yLkpLBM=; b=Cklwt1S1oombSIoAy8zoD9 GOYCNna5etgCQ7LfqCSgS2ZFwSLQPjzbO9DpLXEk6RKkLZVUBzcqucnnVnWuR1uV U/66W8jyAS5qkSeSmydulT80whFF66vhEWctzrJyKjm5kkImdexKgNsOLVnvBoYc I20uYaUz9m72h49suCl+1JgorNGjfunM+WaJIkOapD4p3Z9xt8QbtctuoALHoSi0 WBulG6x6IM2GBhpXga0Ht6SNiwdMQozVaLdRGJp9+Ge8EHwjveVJ+vgT2ugnB3EN XDVuaVM2K+CjuQLgBXqsQpbdIwlP0pf8ivmpakJGK4mJtdtE232MHDzyswb04mvg == X-ME-Sender: Received: from [10.68.155.25] (54-240-197-232.amazon.com [54.240.197.232]) by mail.messagingengine.com (Postfix) with ESMTPA id 3061724009; Mon, 27 Nov 2017 06:37:37 -0500 (EST) Subject: Re: [PATCH] fs: befs: btree: Fixed some coding standard issues To: Alex Frappier Lachapelle , salah.triki@gmail.com Cc: linux-kernel@vger.kernel.org, alfonsolimaastor@gmail.com References: <20171126031729.25720-1-Alex.FrappierLachapelle@gmail.com> From: Luis de Bethencourt Message-ID: Date: Mon, 27 Nov 2017 11:37:35 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171126031729.25720-1-Alex.FrappierLachapelle@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/26/2017 03:17 AM, Alex Frappier Lachapelle wrote: > Fixed some coding standard issues. > > Signed-off-by: Alex Frappier Lachapelle > --- > fs/befs/btree.c | 97 ++++++++++++++++++++++++++++++--------------------------- > 1 file changed, 51 insertions(+), 46 deletions(-) > > diff --git a/fs/befs/btree.c b/fs/befs/btree.c > index 1b7e0f7128d6..76a401c48bae 100644 > --- a/fs/befs/btree.c > +++ b/fs/befs/btree.c > @@ -6,7 +6,7 @@ > * Licensed under the GNU GPL. See the file COPYING for details. > * > * 2002-02-05: Sergey S. Kostyliov added binary search within > - * btree nodes. > + * btree nodes. > * > * Many thanks to: > * > @@ -88,13 +88,15 @@ struct befs_btree_node { > static const befs_off_t BEFS_BT_INVAL = 0xffffffffffffffffULL; > > /* local functions */ > -static int befs_btree_seekleaf(struct super_block *sb, const befs_data_stream *ds, > - befs_btree_super * bt_super, > +static int befs_btree_seekleaf(struct super_block *sb, > + const befs_data_stream *ds, > + befs_btree_super *bt_super, > struct befs_btree_node *this_node, > - befs_off_t * node_off); > + befs_off_t *node_off); > > -static int befs_bt_read_super(struct super_block *sb, const befs_data_stream *ds, > - befs_btree_super * sup); > +static int befs_bt_read_super(struct super_block *sb, > + const befs_data_stream *ds, > + befs_btree_super *sup); > > static int befs_bt_read_node(struct super_block *sb, const befs_data_stream *ds, > struct befs_btree_node *node, > @@ -110,11 +112,11 @@ static char *befs_bt_keydata(struct befs_btree_node *node); > > static int befs_find_key(struct super_block *sb, > struct befs_btree_node *node, > - const char *findkey, befs_off_t * value); > + const char *findkey, befs_off_t *value); > > static char *befs_bt_get_key(struct super_block *sb, > struct befs_btree_node *node, > - int index, u16 * keylen); > + int index, u16 *keylen); > > static int befs_compare_strings(const void *key1, int keylen1, > const void *key2, int keylen2); > @@ -132,7 +134,7 @@ static int befs_compare_strings(const void *key1, int keylen1, > */ > static int > befs_bt_read_super(struct super_block *sb, const befs_data_stream *ds, > - befs_btree_super * sup) > + befs_btree_super *sup) > { > struct buffer_head *bh; > befs_disk_btree_super *od_sup; > @@ -163,7 +165,7 @@ befs_bt_read_super(struct super_block *sb, const befs_data_stream *ds, > befs_debug(sb, "<--- %s", __func__); > return BEFS_OK; > > - error: > +error: > befs_debug(sb, "<--- %s ERROR", __func__); > return BEFS_ERR; > } > @@ -200,8 +202,8 @@ befs_bt_read_node(struct super_block *sb, const befs_data_stream *ds, > > node->bh = befs_read_datastream(sb, ds, node_off, &off); > if (!node->bh) { > - befs_error(sb, "%s failed to read " > - "node at %llu", __func__, node_off); > + befs_error(sb, "%s failed to read node at %llu", > + __func__, node_off); > befs_debug(sb, "<--- %s ERROR", __func__); > > return BEFS_ERR; > @@ -243,7 +245,7 @@ befs_bt_read_node(struct super_block *sb, const befs_data_stream *ds, > */ > int > befs_btree_find(struct super_block *sb, const befs_data_stream *ds, > - const char *key, befs_off_t * value) > + const char *key, befs_off_t *value) > { > struct befs_btree_node *this_node; > befs_btree_super bt_super; > @@ -253,16 +255,16 @@ befs_btree_find(struct super_block *sb, const befs_data_stream *ds, > befs_debug(sb, "---> %s Key: %s", __func__, key); > > if (befs_bt_read_super(sb, ds, &bt_super) != BEFS_OK) { > - befs_error(sb, > - "befs_btree_find() failed to read index superblock"); > + befs_error(sb, "%s() failed to read index superblock", > + __func__); > goto error; > } > > this_node = kmalloc(sizeof(struct befs_btree_node), > GFP_NOFS); > if (!this_node) { > - befs_error(sb, "befs_btree_find() failed to allocate %zu " > - "bytes of memory", sizeof(struct befs_btree_node)); > + befs_error(sb, "%s() failed to allocate %zu bytes of memory", > + __func__, sizeof(struct befs_btree_node)); > goto error; > } > > @@ -271,8 +273,8 @@ befs_btree_find(struct super_block *sb, const befs_data_stream *ds, > /* read in root node */ > node_off = bt_super.root_node_ptr; > if (befs_bt_read_node(sb, ds, this_node, node_off) != BEFS_OK) { > - befs_error(sb, "befs_btree_find() failed to read " > - "node at %llu", node_off); > + befs_error(sb, "%s() failed to read node at %llu", > + __func__, node_off); > goto error_alloc; > } > > @@ -282,8 +284,8 @@ befs_btree_find(struct super_block *sb, const befs_data_stream *ds, > if (res == BEFS_BT_OVERFLOW) > node_off = this_node->head.overflow; > if (befs_bt_read_node(sb, ds, this_node, node_off) != BEFS_OK) { > - befs_error(sb, "befs_btree_find() failed to read " > - "node at %llu", node_off); > + befs_error(sb, "%s() failed to read node at %llu", > + __func__, node_off); > goto error_alloc; > } > } > @@ -304,9 +306,9 @@ befs_btree_find(struct super_block *sb, const befs_data_stream *ds, > key, *value); > return BEFS_OK; > > - error_alloc: > +error_alloc: > kfree(this_node); > - error: > +error: > *value = 0; > befs_debug(sb, "<--- %s ERROR", __func__); > return BEFS_ERR; > @@ -328,7 +330,7 @@ befs_btree_find(struct super_block *sb, const befs_data_stream *ds, > */ > static int > befs_find_key(struct super_block *sb, struct befs_btree_node *node, > - const char *findkey, befs_off_t * value) > + const char *findkey, befs_off_t *value) > { > int first, last, mid; > int eq; > @@ -409,8 +411,8 @@ befs_find_key(struct super_block *sb, struct befs_btree_node *node, > */ > int > befs_btree_read(struct super_block *sb, const befs_data_stream *ds, > - loff_t key_no, size_t bufsize, char *keybuf, size_t * keysize, > - befs_off_t * value) > + loff_t key_no, size_t bufsize, char *keybuf, size_t *keysize, > + befs_off_t *value) > { > struct befs_btree_node *this_node; > befs_btree_super bt_super; > @@ -426,15 +428,15 @@ befs_btree_read(struct super_block *sb, const befs_data_stream *ds, > befs_debug(sb, "---> %s", __func__); > > if (befs_bt_read_super(sb, ds, &bt_super) != BEFS_OK) { > - befs_error(sb, > - "befs_btree_read() failed to read index superblock"); > + befs_error(sb, "%s() failed to read index superblock", > + __func__); > goto error; > } > > this_node = kmalloc(sizeof(struct befs_btree_node), GFP_NOFS); > if (this_node == NULL) { > - befs_error(sb, "befs_btree_read() failed to allocate %zu " > - "bytes of memory", sizeof(struct befs_btree_node)); > + befs_error(sb, "%s() failed to allocate %zu bytes of memory", > + __func__, sizeof(struct befs_btree_node)); > goto error; > } > > @@ -490,12 +492,12 @@ befs_btree_read(struct super_block *sb, const befs_data_stream *ds, > keystart = befs_bt_get_key(sb, this_node, cur_key, &keylen); > > befs_debug(sb, "Read [%llu,%d]: keysize %d", > - (long long unsigned int)node_off, (int)cur_key, > + (unsigned long long int)node_off, (int)cur_key, > (int)keylen); > > if (bufsize < keylen + 1) { > - befs_error(sb, "%s keybuf too small (%zu) " > - "for key of size %d", __func__, bufsize, keylen); > + befs_error(sb, "%s keybuf too small (%zu) for key of size %d", > + __func__, bufsize, keylen); > brelse(this_node->bh); > goto error_alloc; > } > @@ -514,10 +516,10 @@ befs_btree_read(struct super_block *sb, const befs_data_stream *ds, > > return BEFS_OK; > > - error_alloc: > +error_alloc: > kfree(this_node); > > - error: > +error: > *keysize = 0; > *value = 0; > befs_debug(sb, "<--- %s ERROR", __func__); > @@ -531,7 +533,7 @@ befs_btree_read(struct super_block *sb, const befs_data_stream *ds, > * @bt_super: Pointer to the superblock of the btree > * @this_node: Buffer to return the leafnode in > * @node_off: Pointer to offset of current node within datastream. Modified > - * by the function. > + * by the function. > * > * Helper function for btree traverse. Moves the current position to the > * start of the first leaf node. > @@ -542,14 +544,14 @@ static int > befs_btree_seekleaf(struct super_block *sb, const befs_data_stream *ds, > befs_btree_super *bt_super, > struct befs_btree_node *this_node, > - befs_off_t * node_off) > + befs_off_t *node_off) > { > > befs_debug(sb, "---> %s", __func__); > > if (befs_bt_read_node(sb, ds, this_node, *node_off) != BEFS_OK) { > - befs_error(sb, "%s failed to read " > - "node at %llu", __func__, *node_off); > + befs_error(sb, "%s failed to read node at %llu", > + __func__, *node_off); > goto error; > } > befs_debug(sb, "Seekleaf to root node %llu", *node_off); > @@ -572,8 +574,8 @@ befs_btree_seekleaf(struct super_block *sb, const befs_data_stream *ds, > *node_off = fs64_to_cpu(sb, valarray[0]); > } > if (befs_bt_read_node(sb, ds, this_node, *node_off) != BEFS_OK) { > - befs_error(sb, "%s failed to read " > - "node at %llu", __func__, *node_off); > + befs_error(sb, "%s failed to read node at %llu", > + __func__, *node_off); > goto error; > } > > @@ -583,7 +585,7 @@ befs_btree_seekleaf(struct super_block *sb, const befs_data_stream *ds, > > return BEFS_OK; > > - error: > +error: > befs_debug(sb, "<--- %s ERROR", __func__); > return BEFS_ERR; > } > @@ -623,7 +625,7 @@ befs_bt_keylen_index(struct befs_btree_node *node) > { > const int keylen_align = 8; > unsigned long int off = > - (sizeof (befs_btree_nodehead) + node->head.all_key_length); > + (sizeof(befs_btree_nodehead) + node->head.all_key_length); > ulong tmp = off % keylen_align; > > if (tmp) > @@ -643,7 +645,7 @@ static fs64 * > befs_bt_valarray(struct befs_btree_node *node) > { > void *keylen_index_start = (void *) befs_bt_keylen_index(node); > - size_t keylen_index_size = node->head.all_key_count * sizeof (fs16); > + size_t keylen_index_size = node->head.all_key_count * sizeof(fs16); > > return (fs64 *) (keylen_index_start + keylen_index_size); > } > @@ -658,7 +660,7 @@ befs_bt_valarray(struct befs_btree_node *node) > static char * > befs_bt_keydata(struct befs_btree_node *node) > { > - return (char *) ((void *) node->od_node + sizeof (befs_btree_nodehead)); > + return (char *) ((void *) node->od_node + sizeof(befs_btree_nodehead)); > } > > /** > @@ -673,7 +675,7 @@ befs_bt_keydata(struct befs_btree_node *node) > */ > static char * > befs_bt_get_key(struct super_block *sb, struct befs_btree_node *node, > - int index, u16 * keylen) > + int index, u16 *keylen) > { > int prev_key_end; > char *keystart; > @@ -714,6 +716,7 @@ befs_compare_strings(const void *key1, int keylen1, > { > int len = min_t(int, keylen1, keylen2); > int result = strncmp(key1, key2, len); > + > if (result == 0) > result = keylen1 - keylen2; > return result; > @@ -765,6 +768,7 @@ static int > btree_compare_float(cont void *key1, int keylen1, const void *key2, int keylen2) > { > float result = *(float *) key1 - *(float *) key2; > + > if (result == 0.0f) > return 0; > > @@ -776,6 +780,7 @@ btree_compare_double(cont void *key1, int keylen1, > const void *key2, int keylen2) > { > double result = *(double *) key1 - *(double *) key2; > + > if (result == 0.0) > return 0; > > Hi Alex, Thanks for the patch. The original code author wasn't very strict with the 80 characters per line rule or not indenting goto labels. Most of the above are worth fixing. Can you describe in the commit message which coding standard issues are you fixing? The print out of checkpatch.pl is usually enough. Cheers, Luis PD: Adding Alfonso to CC to give him the opportunity to review since he showed interest before. From 1585097010488453159@xxx Sun Nov 26 03:18:27 +0000 2017 X-GM-THRID: 1585097010488453159 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread