2008-08-22 16:44:39

by Chuck Lever III

[permalink] [raw]
Subject: [PATCH] SUNRPC: Make svc_addr's argument a constant

Clean up: Add extra type safety and squelch a few compiler complaints
in upcoming patches.

Signed-off-by: Chuck Lever <[email protected]>
---

include/linux/sunrpc/svc.h | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index 2a41d29..564e045 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -266,17 +266,17 @@ struct svc_rqst {
/*
* Rigorous type checking on sockaddr type conversions
*/
-static inline struct sockaddr_in *svc_addr_in(struct svc_rqst *rqst)
+static inline struct sockaddr_in *svc_addr_in(const struct svc_rqst *rqst)
{
return (struct sockaddr_in *) &rqst->rq_addr;
}

-static inline struct sockaddr_in6 *svc_addr_in6(struct svc_rqst *rqst)
+static inline struct sockaddr_in6 *svc_addr_in6(const struct svc_rqst *rqst)
{
return (struct sockaddr_in6 *) &rqst->rq_addr;
}

-static inline struct sockaddr *svc_addr(struct svc_rqst *rqst)
+static inline struct sockaddr *svc_addr(const struct svc_rqst *rqst)
{
return (struct sockaddr *) &rqst->rq_addr;
}



2008-08-26 19:20:48

by J. Bruce Fields

[permalink] [raw]
Subject: Re: [PATCH] SUNRPC: Make svc_addr's argument a constant

Also applied.--b.

On Fri, Aug 22, 2008 at 12:43:16PM -0400, Chuck Lever wrote:
> Clean up: Add extra type safety and squelch a few compiler complaints
> in upcoming patches.
>
> Signed-off-by: Chuck Lever <[email protected]>
> ---
>
> include/linux/sunrpc/svc.h | 6 +++---
> 1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
> index 2a41d29..564e045 100644
> --- a/include/linux/sunrpc/svc.h
> +++ b/include/linux/sunrpc/svc.h
> @@ -266,17 +266,17 @@ struct svc_rqst {
> /*
> * Rigorous type checking on sockaddr type conversions
> */
> -static inline struct sockaddr_in *svc_addr_in(struct svc_rqst *rqst)
> +static inline struct sockaddr_in *svc_addr_in(const struct svc_rqst *rqst)
> {
> return (struct sockaddr_in *) &rqst->rq_addr;
> }
>
> -static inline struct sockaddr_in6 *svc_addr_in6(struct svc_rqst *rqst)
> +static inline struct sockaddr_in6 *svc_addr_in6(const struct svc_rqst *rqst)
> {
> return (struct sockaddr_in6 *) &rqst->rq_addr;
> }
>
> -static inline struct sockaddr *svc_addr(struct svc_rqst *rqst)
> +static inline struct sockaddr *svc_addr(const struct svc_rqst *rqst)
> {
> return (struct sockaddr *) &rqst->rq_addr;
> }
>