diff mbox

[12/32] iwpmd: fix the prototype for the pthread_create start functions

Message ID 1476381095-20041-13-git-send-email-hch@lst.de (mailing list archive)
State Accepted
Headers show

Commit Message

Christoph Hellwig Oct. 13, 2016, 5:51 p.m. UTC
And also remove the unessecary taking of the address for function
arguments while we're at it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 iwpmd/iwarp_pm_server.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Steve Wise Oct. 13, 2016, 7:09 p.m. UTC | #1
> @@ -1438,11 +1438,11 @@ int main(int argc, char *argv[])
>  	pthread_cond_init(&cond_req_complete, NULL);
>  	pthread_cond_init(&cond_pending_msg, NULL);
> 
> -	ret = pthread_create(&map_req_thread, NULL,
> &iwpm_mapping_reqs_handler, NULL);
> +	ret = pthread_create(&map_req_thread, NULL,
> iwpm_mapping_reqs_handler, NULL);
>  	if (ret)
>  		goto error_exit;
> 
> -	ret = pthread_create(&pending_msg_thread, NULL,
> &iwpm_pending_msgs_handler, NULL);
> +	ret = pthread_create(&pending_msg_thread, NULL,
> iwpm_pending_msgs_handler, NULL);
>  	if (ret)
>  		goto error_exit;

How did this work before?

Reviewed-by: Steve Wise <swise@opengridcomputing.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jason Gunthorpe Oct. 13, 2016, 7:44 p.m. UTC | #2
On Thu, Oct 13, 2016 at 02:09:44PM -0500, Steve Wise wrote:
> > @@ -1438,11 +1438,11 @@ int main(int argc, char *argv[])
> >  	pthread_cond_init(&cond_req_complete, NULL);
> >  	pthread_cond_init(&cond_pending_msg, NULL);
> > 
> > -	ret = pthread_create(&map_req_thread, NULL,
> > &iwpm_mapping_reqs_handler, NULL);
> > +	ret = pthread_create(&map_req_thread, NULL,
> > iwpm_mapping_reqs_handler, NULL);
> >  	if (ret)
> >  		goto error_exit;
> > 
> > -	ret = pthread_create(&pending_msg_thread, NULL,
> > &iwpm_pending_msgs_handler, NULL);
> > +	ret = pthread_create(&pending_msg_thread, NULL,
> > iwpm_pending_msgs_handler, NULL);
> >  	if (ret)
> >  		goto error_exit;
> 
> How did this work before?

gcc will not warn if an old-style prototype eg () is passed in to a
typed function pointer.

An earlier patch in the series changed it to (void) which broke the
compile.. I reorderd things to avoid this in the PR.

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/iwpmd/iwarp_pm_server.c b/iwpmd/iwarp_pm_server.c
index b8ae3e3..ab90c6c 100644
--- a/iwpmd/iwarp_pm_server.c
+++ b/iwpmd/iwarp_pm_server.c
@@ -87,7 +87,7 @@  static void iwpm_signal_handler(int signum)
 /**
  * iwpm_mapping_reqs_handler - Handle mapping requests timeouts and retries
  */
-static void *iwpm_mapping_reqs_handler(void)
+static void *iwpm_mapping_reqs_handler(void *unused)
 {
 	iwpm_mapping_request *iwpm_map_req, *next_map_req;
 	int ret = 0;
@@ -139,7 +139,7 @@  mapping_reqs_handler_exit:
 /**
  * iwpm_pending_msgs_handler - Handle sending iwarp port mapper wire messages
  */
-static void *iwpm_pending_msgs_handler(void)
+static void *iwpm_pending_msgs_handler(void *unused)
 {
 	iwpm_pending_msg *pending_msg;
 	iwpm_send_msg *send_msg;
@@ -1438,11 +1438,11 @@  int main(int argc, char *argv[])
 	pthread_cond_init(&cond_req_complete, NULL);
 	pthread_cond_init(&cond_pending_msg, NULL);
 
-	ret = pthread_create(&map_req_thread, NULL, &iwpm_mapping_reqs_handler, NULL);
+	ret = pthread_create(&map_req_thread, NULL, iwpm_mapping_reqs_handler, NULL);
 	if (ret)
 		goto error_exit;
 
-	ret = pthread_create(&pending_msg_thread, NULL, &iwpm_pending_msgs_handler, NULL);
+	ret = pthread_create(&pending_msg_thread, NULL, iwpm_pending_msgs_handler, NULL);
 	if (ret)
 		goto error_exit;