From owner-svn-src-head@FreeBSD.ORG Wed Nov 16 19:06:56 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 193F5106568C; Wed, 16 Nov 2011 19:06:56 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F38238FC15; Wed, 16 Nov 2011 19:06:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAGJ6tHq062759; Wed, 16 Nov 2011 19:06:55 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGJ6tGE062755; Wed, 16 Nov 2011 19:06:55 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201111161906.pAGJ6tGE062755@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 16 Nov 2011 19:06:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227581 - in head: share/man/man9 sys/kern sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 19:06:56 -0000 Author: pjd Date: Wed Nov 16 19:06:55 2011 New Revision: 227581 URL: http://svn.freebsd.org/changeset/base/227581 Log: Constify stack argument for functions that don't modify it. Reviewed by: ed, kib, jhb Modified: head/share/man/man9/stack.9 head/sys/kern/subr_stack.c head/sys/sys/stack.h Modified: head/share/man/man9/stack.9 ============================================================================== --- head/share/man/man9/stack.9 Wed Nov 16 18:53:52 2011 (r227580) +++ head/share/man/man9/stack.9 Wed Nov 16 19:06:55 2011 (r227581) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 24, 2009 +.Dd November 16, 2011 .Dt STACK 9 .Os .Sh NAME @@ -46,21 +46,21 @@ In the kernel configuration file: .Ft int .Fn stack_put "struct stack *st" "vm_offset_t pc" .Ft void -.Fn stack_copy "struct stack *src" "struct stack dst" +.Fn stack_copy "const struct stack *src" "struct stack dst" .Ft void .Fn stack_zero "struct stack *st" .Ft void -.Fn stack_print "struct stack *st" +.Fn stack_print "const struct stack *st" .Ft void -.Fn stack_print_ddb "struct stack *st" +.Fn stack_print_ddb "const struct stack *st" .Ft void -.Fn stack_print_short "struct stack *st" +.Fn stack_print_short "const struct stack *st" .Ft void -.Fn stack_print_short_ddb "struct stack *st" +.Fn stack_print_short_ddb "const struct stack *st" .Ft void -.Fn stack_sbuf_print "struct sbuf sb*" "struct stack *st" +.Fn stack_sbuf_print "struct sbuf sb*" "const struct stack *st" .Ft void -.Fn stack_sbuf_print_ddb "struct sbuf sb*" "struct stack *st" +.Fn stack_sbuf_print_ddb "struct sbuf sb*" "const struct stack *st" .Ft void .Fn stack_save "struct stack *st" .Sh DESCRIPTION Modified: head/sys/kern/subr_stack.c ============================================================================== --- head/sys/kern/subr_stack.c Wed Nov 16 18:53:52 2011 (r227580) +++ head/sys/kern/subr_stack.c Wed Nov 16 19:06:55 2011 (r227581) @@ -77,7 +77,7 @@ stack_put(struct stack *st, vm_offset_t } void -stack_copy(struct stack *src, struct stack *dst) +stack_copy(const struct stack *src, struct stack *dst) { *dst = *src; @@ -91,7 +91,7 @@ stack_zero(struct stack *st) } void -stack_print(struct stack *st) +stack_print(const struct stack *st) { char namebuf[64]; long offset; @@ -107,7 +107,7 @@ stack_print(struct stack *st) } void -stack_print_short(struct stack *st) +stack_print_short(const struct stack *st) { char namebuf[64]; long offset; @@ -127,7 +127,7 @@ stack_print_short(struct stack *st) } void -stack_print_ddb(struct stack *st) +stack_print_ddb(const struct stack *st) { const char *name; long offset; @@ -143,7 +143,7 @@ stack_print_ddb(struct stack *st) #ifdef DDB void -stack_print_short_ddb(struct stack *st) +stack_print_short_ddb(const struct stack *st) { const char *name; long offset; @@ -167,7 +167,7 @@ stack_print_short_ddb(struct stack *st) * other for use in the live kernel. */ void -stack_sbuf_print(struct sbuf *sb, struct stack *st) +stack_sbuf_print(struct sbuf *sb, const struct stack *st) { char namebuf[64]; long offset; @@ -184,7 +184,7 @@ stack_sbuf_print(struct sbuf *sb, struct #ifdef DDB void -stack_sbuf_print_ddb(struct sbuf *sb, struct stack *st) +stack_sbuf_print_ddb(struct sbuf *sb, const struct stack *st) { const char *name; long offset; @@ -201,8 +201,8 @@ stack_sbuf_print_ddb(struct sbuf *sb, st #ifdef KTR void -stack_ktr(u_int mask, const char *file, int line, struct stack *st, u_int depth, - int cheap) +stack_ktr(u_int mask, const char *file, int line, const struct stack *st, + u_int depth, int cheap) { #ifdef DDB const char *name; Modified: head/sys/sys/stack.h ============================================================================== --- head/sys/sys/stack.h Wed Nov 16 18:53:52 2011 (r227580) +++ head/sys/sys/stack.h Wed Nov 16 19:06:55 2011 (r227581) @@ -37,16 +37,17 @@ struct sbuf; struct stack *stack_create(void); void stack_destroy(struct stack *); int stack_put(struct stack *, vm_offset_t); -void stack_copy(struct stack *, struct stack *); +void stack_copy(const struct stack *, struct stack *); void stack_zero(struct stack *); -void stack_print(struct stack *); -void stack_print_ddb(struct stack *); -void stack_print_short(struct stack *); -void stack_print_short_ddb(struct stack *); -void stack_sbuf_print(struct sbuf *, struct stack *); -void stack_sbuf_print_ddb(struct sbuf *, struct stack *); +void stack_print(const struct stack *); +void stack_print_ddb(const struct stack *); +void stack_print_short(const struct stack *); +void stack_print_short_ddb(const struct stack *); +void stack_sbuf_print(struct sbuf *, const struct stack *); +void stack_sbuf_print_ddb(struct sbuf *, const struct stack *); #ifdef KTR -void stack_ktr(u_int, const char *, int, struct stack *, u_int, int); +void stack_ktr(u_int, const char *, int, const struct stack *, + u_int, int); #define CTRSTACK(m, st, depth, cheap) do { \ if (KTR_COMPILE & (m)) \ stack_ktr((m), __FILE__, __LINE__, st, depth, cheap); \