mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
Cc: linux-kernel@vger.kernel.org,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	David Woodhouse <dwmw2@infradead.org>
Subject: Re: [PATCH] ihex: restore missing default in switch statement
Date: Wed, 4 Mar 2015 14:18:15 -0800	[thread overview]
Message-ID: <20150304141815.e740456b5e386c2357f89194@linux-foundation.org> (raw)
In-Reply-To: <1425479050-5997-1-git-send-email-nicolas.iooss_linux@m4x.org>

On Wed,  4 Mar 2015 22:24:10 +0800 Nicolas Iooss <nicolas.iooss_linux@m4x.org> wrote:

> Commit 2473238eac95 ("ihex: add support for CS:IP/EIP records") removes
> the "default:" statement in the switch block, making the "return
> usage();" line dead code and ihex2fw silently ignoring unknown options.
> Restore this statement.
> 
> This bug was found by building with HOSTCC=clang and adding
> -Wunreachable-code-return to HOSTCFLAGS.
> 
> ...
>
> --- a/firmware/ihex2fw.c
> +++ b/firmware/ihex2fw.c
> @@ -86,6 +86,7 @@ int main(int argc, char **argv)
>  		case 'j':
>  			include_jump = 1;
>  			break;
> +		default:
>  			return usage();
>  		}
>  	}

whee.  So if there's userspace out there which is passing bad options
to ihex2fw, this fix will break it.

Oh well, I expect we'll survive.

      reply	other threads:[~2015-03-04 22:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-04 14:24 Nicolas Iooss
2015-03-04 22:18 ` Andrew Morton [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150304141815.e740456b5e386c2357f89194@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicolas.iooss_linux@m4x.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®