From patchwork Thu Nov 22 00:06:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 1788221 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 4D6D9DF24C for ; Thu, 22 Nov 2012 20:41:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756259Ab2KVTDv (ORCPT ); Thu, 22 Nov 2012 14:03:51 -0500 Received: from mail-we0-f174.google.com ([74.125.82.174]:46061 "EHLO mail-we0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756242Ab2KVTDs (ORCPT ); Thu, 22 Nov 2012 14:03:48 -0500 Received: by mail-we0-f174.google.com with SMTP id d7so2107409wer.19 for ; Thu, 22 Nov 2012 11:03:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=HUjWW4o88AmhMrw6tlf3ml7E8lJ/CwsbN6vTtkJm/G4=; b=njqsM+6s+xx+8IOJWp72EXrEcQCRejjnnWDE2y6OMyIV3to/gMTyqVk/og9J4rC7d6 ua8aqujXRWjRrZ/m6kQOCbeGIjB8UTZ63N/RAr9MHPHuIEE4MIxZ0SmCenfvv0mJzSWM cV/061slcVn5PVoR9kB9hTxgOphDoXXTKg90Hxmqe0+aDxDLC3HW33Udvf0wboG3nUiH phq0UJjcGDTUzbU1NHhQucKbhCvei9ollXKCI3oGr0yFXQ7xNNUdpC2wMBGtFKP3BxxH vlUcZLDwlNxKfn9ioDmt8ZN5f55PLWkWGcd99pzRr4Ys2bXCYm7AMANLXykap/BdeCe5 VJHQ== Received: by 10.180.88.138 with SMTP id bg10mr1742240wib.13.1353542776399; Wed, 21 Nov 2012 16:06:16 -0800 (PST) Received: from localhost.localdomain (ARennes-256-1-138-125.w90-32.abo.wanadoo.fr. [90.32.249.125]) by mx.google.com with ESMTPS id j18sm1608627wiv.9.2012.11.21.16.06.15 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Nov 2012 16:06:16 -0800 (PST) From: "Yann E. MORIN" To: linux-kbuild@vger.kernel.org Cc: Michal Marek , "Yann E. MORIN" Subject: [PATCH 2/3] scripts/kconfig: constify an argument Date: Thu, 22 Nov 2012 01:06:05 +0100 Message-Id: <1353542766-24422-3-git-send-email-yann.morin.1998@free.fr> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1353542766-24422-1-git-send-email-yann.morin.1998@free.fr> References: <1353542766-24422-1-git-send-email-yann.morin.1998@free.fr> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org There is no reason for the prompt argument to be non-const, as it can deal with const objects (eg. hard-coded root-menu label). Furthermore, the next commit will also introduce another source for the root-menu label, which will be explicitly marked const. Signed-off-by: "Yann E. MORIN" --- scripts/kconfig/lkc.h | 4 ++-- scripts/kconfig/menu.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h index f8aee5f..5cfd940 100644 --- a/scripts/kconfig/lkc.h +++ b/scripts/kconfig/lkc.h @@ -111,8 +111,8 @@ void menu_add_entry(struct symbol *sym); void menu_end_entry(void); void menu_add_dep(struct expr *dep); void menu_add_visibility(struct expr *dep); -struct property *menu_add_prop(enum prop_type type, char *prompt, struct expr *expr, struct expr *dep); -struct property *menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep); +struct property *menu_add_prop(enum prop_type type, const char *prompt, struct expr *expr, struct expr *dep); +struct property *menu_add_prompt(enum prop_type type, const char *prompt, struct expr *dep); void menu_add_expr(enum prop_type type, struct expr *expr, struct expr *dep); void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep); void menu_add_option(int token, char *arg); diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c index 84a2ba2..6175ead 100644 --- a/scripts/kconfig/menu.c +++ b/scripts/kconfig/menu.c @@ -124,7 +124,7 @@ void menu_set_type(int type) sym_type_name(sym->type), sym_type_name(type)); } -struct property *menu_add_prop(enum prop_type type, char *prompt, struct expr *expr, struct expr *dep) +struct property *menu_add_prop(enum prop_type type, const char *prompt, struct expr *expr, struct expr *dep) { struct property *prop = prop_alloc(type, current_entry->sym); @@ -161,7 +161,7 @@ struct property *menu_add_prop(enum prop_type type, char *prompt, struct expr *e return prop; } -struct property *menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep) +struct property *menu_add_prompt(enum prop_type type, const char *prompt, struct expr *dep) { return menu_add_prop(type, prompt, NULL, dep); }