public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [patch] UBIFS: remove douple initialization in change_category()
@ 2012-04-01 15:57 Dan Carpenter
  2012-04-13 16:11 ` Artem Bityutskiy
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2012-04-01 15:57 UTC (permalink / raw)
  To: Artem Bityutskiy; +Cc: kernel-janitors, linux-mtd, Adrian Hunter

"heap" is initialized twice.  I removed the first one, because it makes
Smatch complain that we use "new_cat" as an offset before checking it.

This doesn't change how the code works, it's just a cleanup.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/fs/ubifs/lprops.c b/fs/ubifs/lprops.c
index f8a181e..b5c95a6 100644
--- a/fs/ubifs/lprops.c
+++ b/fs/ubifs/lprops.c
@@ -447,7 +447,7 @@ static void change_category(struct ubifs_info *c, struct ubifs_lprops *lprops)
 	int new_cat = ubifs_categorize_lprops(c, lprops);
 
 	if (old_cat == new_cat) {
-		struct ubifs_lpt_heap *heap = &c->lpt_heap[new_cat - 1];
+		struct ubifs_lpt_heap *heap;
 
 		/* lprops on a heap now must be moved up or down */
 		if (new_cat < 1 || new_cat > LPROPS_HEAP_CNT)

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch] UBIFS: remove douple initialization in change_category()
  2012-04-01 15:57 [patch] UBIFS: remove douple initialization in change_category() Dan Carpenter
@ 2012-04-13 16:11 ` Artem Bityutskiy
  0 siblings, 0 replies; 2+ messages in thread
From: Artem Bityutskiy @ 2012-04-13 16:11 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: kernel-janitors, linux-mtd, Adrian Hunter

[-- Attachment #1: Type: text/plain, Size: 415 bytes --]

On Sun, 2012-04-01 at 18:57 +0300, Dan Carpenter wrote:
> "heap" is initialized twice.  I removed the first one, because it makes
> Smatch complain that we use "new_cat" as an offset before checking it.
> 
> This doesn't change how the code works, it's just a cleanup.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Pushed to linux-ubifs.git, thanks!

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-04-13 16:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-01 15:57 [patch] UBIFS: remove douple initialization in change_category() Dan Carpenter
2012-04-13 16:11 ` Artem Bityutskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox