From patchwork Sat Sep 11 15:51:08 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Lacombe X-Patchwork-Id: 172022 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o8BFrr61029057 for ; Sat, 11 Sep 2010 15:53:53 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752669Ab0IKPxw (ORCPT ); Sat, 11 Sep 2010 11:53:52 -0400 Received: from mail-gx0-f174.google.com ([209.85.161.174]:36832 "EHLO mail-gx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752394Ab0IKPxv (ORCPT ); Sat, 11 Sep 2010 11:53:51 -0400 Received: by gxk23 with SMTP id 23so1555729gxk.19 for ; Sat, 11 Sep 2010 08:53:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references; bh=wwFoAInXJ3gcrQJd+ie8yI4CyrEwxA6SZ91u7G2XznI=; b=tnkPjUb0gwrJ7kHGAgRqAhYJSQ1yiHe2PbLFGFA7eb+z7NOKy7roYe4B7kN3jHIGYV xq7krxbKrQhjI7pr3DLQiDq7F/eglL9vw/yrptKE856Rht98JyjP7FfXOmLcHT7QAXyt mwwtkv00iJ+c/wvvd0If8ZsmIZrlyI3qkINwE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=Lb14CcjRwFxQNNsVdM9FWrdldiYMK9dnXPDIDw/BDP5a6qg0n0k4dBi9SQLRow3dQq a/CK60+50mY/qJhDomaPV8bczB4OgcABLIwPFDI2xLxAQrDU/V6un8plVpTyhNacVKiA 4AJaqjtZnNbCYjlG+4a7s6ia9WbwdjmHedlC0= Received: by 10.150.50.7 with SMTP id x7mr943095ybx.415.1284220430529; Sat, 11 Sep 2010 08:53:50 -0700 (PDT) Received: from localhost.localdomain (69-165-136-93.dsl.teksavvy.com [69.165.136.93]) by mx.google.com with ESMTPS id m12sm4025812ybn.19.2010.09.11.08.53.48 (version=SSLv3 cipher=RC4-MD5); Sat, 11 Sep 2010 08:53:49 -0700 (PDT) From: Arnaud Lacombe To: Sam Ravnborg , Michal Marek Cc: linux-kbuild , Arnaud Lacombe Subject: [PATCH 01/15] kconfig: replace a `switch()' statement by a more flexible `if()' statement Date: Sat, 11 Sep 2010 11:51:08 -0400 Message-Id: <1284220282-3500-2-git-send-email-lacombar@gmail.com> X-Mailer: git-send-email 1.7.2.30.gc37d7.dirty In-Reply-To: <1284220282-3500-1-git-send-email-lacombar@gmail.com> References: <1284220282-3500-1-git-send-email-lacombar@gmail.com> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Sat, 11 Sep 2010 15:53:53 +0000 (UTC) diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index dc11d51..d9181de 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c @@ -221,8 +221,7 @@ load: while (fgets(line, sizeof(line), in)) { conf_lineno++; sym = NULL; - switch (line[0]) { - case '#': + if (line[0] == '#') { if (memcmp(line + 2, "CONFIG_", 7)) continue; p = strchr(line + 9, ' '); @@ -254,12 +253,7 @@ load: default: ; } - break; - case 'C': - if (memcmp(line, "CONFIG_", 7)) { - conf_warning("unexpected data"); - continue; - } + } else if (memcmp(line, "CONFIG_", 7) == 0) { p = strchr(line + 7, '='); if (!p) continue; @@ -286,12 +280,9 @@ load: } if (conf_set_sym_val(sym, def, def_flags, p)) continue; - break; - case '\r': - case '\n': - break; - default: - conf_warning("unexpected data"); + } else { + if (line[0] != '\r' && line[0] != '\n') + conf_warning("unexpected data"); continue; } if (sym && sym_is_choice_value(sym)) {