From patchwork Thu Nov 6 16:02:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 40345 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9913A20C4E for ; Thu, 6 Nov 2014 16:02:54 +0000 (UTC) Received: by mail-la0-f72.google.com with SMTP id mc6sf1950445lab.11 for ; Thu, 06 Nov 2014 08:02:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=Izo9Fb8t3gbRbsD3pkOA6WVrA9rOOM/rVGttReYCq7k=; b=mLEOeZELz8lDnQO7Fr70yTMZivIDWxoefixGbU34EqQ02whNKSr/fPG8SeWTRkDDU1 fi51kyOmtGcGH8o8M131YiNF9XHveBIynyL2AWUZgIV/7sQD3i3QFc0mVEpD79zeY0gF UcMY7l2PEofe6loBkbh/iPjcUyqoAusJ5gI3376jvET0p0uaNnIZL5A4gZGtXkFuhIsx S6V93vlDUyloJOeIj9T6/EWYanZ65lLonYT/vDHH/4Oc07eJgPdzyyCAjyQV+JB33miN AcneDwSbadKqmw2Vu+bE1nG3sT8jTmU/BgnihIVOHHJw6ciO62+cb+0c1gj+b/RWiRda pNOA== X-Gm-Message-State: ALoCoQk6rjMlIB6IP86FHov6n99sr2Z+rLc8+JvJRrmK7w/UQ5JVdsMXkcyDuJfJMUjtfNYtAonB X-Received: by 10.181.8.194 with SMTP id dm2mr6692581wid.2.1415289773534; Thu, 06 Nov 2014 08:02:53 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.43.129 with SMTP id w1ls101728lal.34.gmail; Thu, 06 Nov 2014 08:02:53 -0800 (PST) X-Received: by 10.152.42.226 with SMTP id r2mr5805494lal.29.1415289773103; Thu, 06 Nov 2014 08:02:53 -0800 (PST) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com. [209.85.217.179]) by mx.google.com with ESMTPS id kk6si11893500lac.69.2014.11.06.08.02.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 06 Nov 2014 08:02:53 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) client-ip=209.85.217.179; Received: by mail-lb0-f179.google.com with SMTP id l4so1155793lbv.24 for ; Thu, 06 Nov 2014 08:02:53 -0800 (PST) X-Received: by 10.152.42.226 with SMTP id r2mr5805482lal.29.1415289772981; Thu, 06 Nov 2014 08:02:52 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp66838lbc; Thu, 6 Nov 2014 08:02:52 -0800 (PST) X-Received: by 10.194.61.99 with SMTP id o3mr6967397wjr.54.1415289771979; Thu, 06 Nov 2014 08:02:51 -0800 (PST) Received: from mail-wg0-f53.google.com (mail-wg0-f53.google.com. [74.125.82.53]) by mx.google.com with ESMTPS id a1si10600969wiy.97.2014.11.06.08.02.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 06 Nov 2014 08:02:51 -0800 (PST) Received-SPF: pass (google.com: domain of daniel.thompson@linaro.org designates 74.125.82.53 as permitted sender) client-ip=74.125.82.53; Received: by mail-wg0-f53.google.com with SMTP id b13so1564596wgh.12 for ; Thu, 06 Nov 2014 08:02:51 -0800 (PST) X-Received: by 10.194.185.229 with SMTP id ff5mr6095347wjc.122.1415289771110; Thu, 06 Nov 2014 08:02:51 -0800 (PST) Received: from sundance.lan (cpc4-aztw19-0-0-cust157.18-1.cable.virginm.net. [82.33.25.158]) by mx.google.com with ESMTPSA id j8sm20030372wib.10.2014.11.06.08.02.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Nov 2014 08:02:50 -0800 (PST) From: Daniel Thompson To: Jason Wessel Cc: Daniel Thompson , linux-kernel@vger.kernel.org, kgdb-bugreport@lists.sourceforge.net, Andrew Morton , Ingo Molnar , patches@linaro.org, linaro-kernel@lists.linaro.org, John Stultz , Sumit Semwal Subject: [RESEND PATCH 3.18-rc3 3/3] kdb: Const qualifier for kdb_getstr's prompt argument Date: Thu, 6 Nov 2014 16:02:26 +0000 Message-Id: <1415289746-30917-4-git-send-email-daniel.thompson@linaro.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1415289746-30917-1-git-send-email-daniel.thompson@linaro.org> References: <1410438579-7839-1-git-send-email-daniel.thompson@linaro.org> <1415289746-30917-1-git-send-email-daniel.thompson@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: daniel.thompson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , All current callers of kdb_getstr() can pass constant pointers via the prompt argument. This patch adds a const qualification to make explicit the fact that this is safe. Signed-off-by: Daniel Thompson --- kernel/debug/kdb/kdb_io.c | 2 +- kernel/debug/kdb/kdb_private.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/debug/kdb/kdb_io.c b/kernel/debug/kdb/kdb_io.c index 70e0f49..59a6071 100644 --- a/kernel/debug/kdb/kdb_io.c +++ b/kernel/debug/kdb/kdb_io.c @@ -439,7 +439,7 @@ poll_again: * substituted for %d, %x or %o in the prompt. */ -char *kdb_getstr(char *buffer, size_t bufsize, char *prompt) +char *kdb_getstr(char *buffer, size_t bufsize, const char *prompt) { if (prompt && kdb_prompt_str != prompt) strncpy(kdb_prompt_str, prompt, CMD_BUFLEN); diff --git a/kernel/debug/kdb/kdb_private.h b/kernel/debug/kdb/kdb_private.h index 30ed4f3..aa90a6a 100644 --- a/kernel/debug/kdb/kdb_private.h +++ b/kernel/debug/kdb/kdb_private.h @@ -212,7 +212,7 @@ extern void kdb_ps1(const struct task_struct *p); extern void kdb_print_nameval(const char *name, unsigned long val); extern void kdb_send_sig_info(struct task_struct *p, struct siginfo *info); extern void kdb_meminfo_proc_show(void); -extern char *kdb_getstr(char *, size_t, char *); +extern char *kdb_getstr(char *, size_t, const char *); extern void kdb_gdb_state_pass(char *buf); /* Defines for kdb_symbol_print */