linux-mips
[Top] [All Lists]

Re: [PATCH 2/2] MIPS: Remove unreachable break statements from cp1emu.c

To: David Daney <ddaney.cavm@gmail.com>
Subject: Re: [PATCH 2/2] MIPS: Remove unreachable break statements from cp1emu.c
From: Ralf Baechle <ralf@linux-mips.org>
Date: Wed, 21 Aug 2013 18:59:21 +0200
Cc: linux-mips@linux-mips.org, David Daney <david.daney@cavium.com>
In-reply-to: <1376939435-19761-3-git-send-email-ddaney.cavm@gmail.com>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1376939435-19761-1-git-send-email-ddaney.cavm@gmail.com> <1376939435-19761-3-git-send-email-ddaney.cavm@gmail.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.21 (2010-09-15)
On Mon, Aug 19, 2013 at 12:10:35PM -0700, David Daney wrote:

> There were many cases of:
> 
>    return something;
>    break;
> 
> All those break statements are unreachable and thus redundant.

And are generally making code harder to read.

There seems to be a school of thought which believes that any case
block should end in a break - but those seem to not yet have heared
of Duff's Device or the syntatical candy in C that makes it possible.

Patch queued for 3.12.  Thanks,

  Ralf

<Prev in Thread] Current Thread [Next in Thread>