Skip to content

Commit 4c5ec47

Browse files
Vladimir Sementsov-OgievskiyMarkus Armbruster
authored andcommitted
9pfs: make Error **errp const where it is appropriate
Mostly, Error ** is for returning error from the function, so the callee sets it. However error_append_security_model_hint and error_append_socket_sockfd_hint get already filled errp parameter. They don't change the pointer itself, only change the internal state of referenced Error object. So we can make it Error *const * errp, to stress the behavior. It will also help coccinelle script (in future) to distinguish such cases from common errp usage. Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]> Acked-by: Greg Kurz <[email protected]> Message-Id: <[email protected]> Reviewed-by: Markus Armbruster <[email protected]> [Commit message replaced] Signed-off-by: Markus Armbruster <[email protected]>
1 parent 0c11568 commit 4c5ec47

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

hw/9pfs/9p-local.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1473,7 +1473,7 @@ static void local_cleanup(FsContext *ctx)
14731473
g_free(data);
14741474
}
14751475

1476-
static void error_append_security_model_hint(Error **errp)
1476+
static void error_append_security_model_hint(Error *const *errp)
14771477
{
14781478
error_append_hint(errp, "Valid options are: security_model="
14791479
"[passthrough|mapped-xattr|mapped-file|none]\n");

hw/9pfs/9p-proxy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1114,7 +1114,7 @@ static int connect_namedsocket(const char *path, Error **errp)
11141114
return sockfd;
11151115
}
11161116

1117-
static void error_append_socket_sockfd_hint(Error **errp)
1117+
static void error_append_socket_sockfd_hint(Error *const *errp)
11181118
{
11191119
error_append_hint(errp, "Either specify socket=/some/path where /some/path"
11201120
" points to a listening AF_UNIX socket or sock_fd=fd"

0 commit comments

Comments
 (0)