From patchwork Thu Sep 11 12:29:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 37250 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qg0-f71.google.com (mail-qg0-f71.google.com [209.85.192.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 759AB20454 for ; Thu, 11 Sep 2014 12:30:12 +0000 (UTC) Received: by mail-qg0-f71.google.com with SMTP id a108sf23727352qge.2 for ; Thu, 11 Sep 2014 05:30:07 -0700 (PDT) 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=jFY6tKkk4NZ233RkqNyJhWO8jrUmvioisXoPZVoj6Mq+nTA0qBJutNGHQA9E/Kqgki EuKc6uTd5zf9F5dgYciOjWbYS0gmlsrwfD6bfQQdJFLl2rW1+O4sjOoeOUjD4rmFkavm oy++nIaeygtfCm6ZeMIE93T57xwb8pJyxWcOAQ973MdeAXDWN2E+1QBHagUhpcwI6SNf Bmuf6hHjcTC/lsbgPl9GcwLvcVb5ZZJjcbbqQafspGZDM4vcCiN8j1Cwmn6jYEISL4f/ I618d/XDuRIxvVClTNMcOz70dX7VH+OK/9g35QT9R6fwEYF6R68XDAsGJrqC+475c+0E qvWA== X-Gm-Message-State: ALoCoQlrFEhFKHP4q1E/3SDjwGuKdYqRSoWdqKDGzn34AIMnV7OrbuLqz8NwNOOycVaWK0+i6SCK X-Received: by 10.236.207.164 with SMTP id n24mr323920yho.5.1410438607178; Thu, 11 Sep 2014 05:30:07 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.81.113 with SMTP id e104ls146386qgd.33.gmail; Thu, 11 Sep 2014 05:30:07 -0700 (PDT) X-Received: by 10.220.113.15 with SMTP id y15mr337777vcp.17.1410438607078; Thu, 11 Sep 2014 05:30:07 -0700 (PDT) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id j6si260113vcs.30.2014.09.11.05.30.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 11 Sep 2014 05:30:07 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.171 as permitted sender) client-ip=209.85.220.171; Received: by mail-vc0-f171.google.com with SMTP id im17so619714vcb.16 for ; Thu, 11 Sep 2014 05:30:07 -0700 (PDT) X-Received: by 10.220.166.68 with SMTP id l4mr401740vcy.20.1410438606905; Thu, 11 Sep 2014 05:30:06 -0700 (PDT) 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.221.45.67 with SMTP id uj3csp583415vcb; Thu, 11 Sep 2014 05:30:06 -0700 (PDT) X-Received: by 10.194.79.137 with SMTP id j9mr822103wjx.79.1410438606021; Thu, 11 Sep 2014 05:30:06 -0700 (PDT) Received: from mail-wg0-f44.google.com (mail-wg0-f44.google.com [74.125.82.44]) by mx.google.com with ESMTPS id hj7si1057843wjb.114.2014.09.11.05.30.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 11 Sep 2014 05:30:05 -0700 (PDT) Received-SPF: pass (google.com: domain of daniel.thompson@linaro.org designates 74.125.82.44 as permitted sender) client-ip=74.125.82.44; Received: by mail-wg0-f44.google.com with SMTP id y10so5519175wgg.27 for ; Thu, 11 Sep 2014 05:30:05 -0700 (PDT) X-Received: by 10.180.212.50 with SMTP id nh18mr6364970wic.81.1410438604697; Thu, 11 Sep 2014 05:30:04 -0700 (PDT) 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 hy9sm1062932wjb.27.2014.09.11.05.30.03 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Sep 2014 05:30:03 -0700 (PDT) From: Daniel Thompson To: Jason Wessel Cc: Daniel Thompson , patches@linaro.org, linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, kgdb-bugreport@lists.sourceforge.net, Ingo Molnar , John Stultz , Sumit Semwal Subject: [PATCH 3.17-rc4 3/3] kdb: Const qualifier for kdb_getstr's prompt argument Date: Thu, 11 Sep 2014 13:29:39 +0100 Message-Id: <1410438579-7839-4-git-send-email-daniel.thompson@linaro.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1410438579-7839-1-git-send-email-daniel.thompson@linaro.org> References: <1410438579-7839-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.220.171 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 */