Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp452575rdh; Wed, 14 Feb 2024 01:38:35 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUkzBE+d/ePQIQeUPwJpV+3Q5O3Ae5OBTv44pzzP/SVEdLEG/4+sZ0GN/ieK8uUFLgSjD69K5VLnFrVNv2KykDvnlqKtjAYxoFNrgOQjQ== X-Google-Smtp-Source: AGHT+IFIoJmJsCZWGc8AlHpD/xLuAZs13lggI7Hnaf+OM44w+saxKbqQl/L7ID98yX5DsPH9fj+E X-Received: by 2002:a05:6a20:71cf:b0:19c:8a24:82e1 with SMTP id t15-20020a056a2071cf00b0019c8a2482e1mr1792786pzb.17.1707903514917; Wed, 14 Feb 2024 01:38:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707903514; cv=pass; d=google.com; s=arc-20160816; b=WTMIHOJAnh2ZUJt0A45ek+ihQTZCCa7QUnoGjWkmPg9kqdeBK2Rxs+CSt2s0MPteTZ tGpDqiyDnU1fUC3dA+8Jrs5DYMP/sp2WVikZssIyv7DM3zM6+gSoYMAIXui0Knu4fiW4 1dvQL8FsRfuclv+nehc6CCS4GaFvOhOfFSQUuWBejbDRmcDTZ+VdkMOOiQ/VIHM4vL+M jQ6/z0KgqA4k1MGffwhBtMCpG9jlIZE5joOoJ6wnX5yLdZQbRJqtbmSCtsf4xXbN8+Zo ZKpfB0iqx/B0WeBlPyw8wmAFhs2rNxTrh4YBLtDeQmXQp/+bKq8BW5wJC8q4sWCAAKOg y1xQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=BIdNKdAMB8wkeCTJLhTMv9NlGdakUVLWdXW2WWyKqhg=; fh=0fTgRyLnlcmF1B3k6ZiI5zgZNtMn3Up08FDfF6Mu5AA=; b=sEWmq7MqUHbWR+V756jONCVbTAEM36opcPMUmMn/NIvVhFlbSDvHpQt/5AU+fbUZos 19Lo6aYvr/YvhJ+LgKQxWfqq4i6gLlktbcfSBvOFMoyMtmND68R5Jzjh1rWmzjY8oOCb VQQ05GFVX2s+E+oSeXhdeefOK0DkkDtfHEZvAVd7L+lmA6h8VKK6MAbn8iUMLAHhrBs8 zqQY/Kg6P3R1GImwzv7PHIgwuPRiSzpkkS/t9y4B8wwuiwf7loZ7eA2p+iNQ9MDA7TYK GX9KaTDGdgVtOir5NVVdYtL2eJhnuRj34Js7tVMRWH+nDAA9jW2X698w2Ulp87NyhNd0 38rA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NOeZpdxH; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-64946-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64946-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCWJaO1JH6t175ZDpecZqwQLKNxSgSc7wZ7aggIf9il9mVIcWdl4hkG2K7BFghdxqWwwcbzyJwJ9/ySwCyHoCTd+c78G0C0SC4GpcWd16w== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id e5-20020aa79805000000b006e08068d6dbsi8149429pfl.265.2024.02.14.01.38.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 01:38:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-64946-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NOeZpdxH; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-64946-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64946-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 3E684B24EB4 for ; Wed, 14 Feb 2024 09:22:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ECD0512B6A; Wed, 14 Feb 2024 09:21:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="NOeZpdxH" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 14677CA73; Wed, 14 Feb 2024 09:21:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707902510; cv=none; b=F/1n1olLE17WKK39VquAtaYH7P0t3lmFgSRUs39PuC3sC3r5yt/s6LpbuNbSCl7PpOm8DzscSwFXfMDjaGFrhUtWNFobL0znvo779glCl/+Ke27rJTAoUbKczr+j8QhYyVvjTy7tG38Wo6SWFyPUhfVzeO4RPDNGfu7PjQ69xjI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707902510; c=relaxed/simple; bh=ir1ZTlVuKq3OpAEOdgpZVagRG7UpTq1IJDjRKpFOG3Y=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=mO7q7QXRkNVQs67QXfc1ukPPiqhWc4hGX8Scl0yReUgSD1R61dflQWJ5FDSzuv/Dg5y6loP3nGgLHMCaTzDylTJKO1gly02c/M3Sv6sUSsJSCASgcOyNFv0JCursO/YX4MeFLvp5QnvkGbb1juC5adrCsbiRIpnynlbDSgoOOVM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=NOeZpdxH; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id DB0BAC433F1; Wed, 14 Feb 2024 09:21:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707902509; bh=ir1ZTlVuKq3OpAEOdgpZVagRG7UpTq1IJDjRKpFOG3Y=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=NOeZpdxHh+ZiAtHiKBZvRMtcQJNYSTn6wJIgQPyGtTmCeoX72gy4L5K0v34adO0J3 SwASsrRv+tR5NhoN5YO+iA2I6TTRMphhDLoAw6nMs9XqQ2rQrIP006wI70orMouo7Z bIpIZWYMFOz8/a2AbvMPcPZfG3fKQCNsIcFKbmlbevq6OvqGie/CJGgzrkw+7E3AzH UWvvEEfLvWdZV3nvPlf01b548oZp1eg6b3jFjFjfzHdBPaoc6aQxdsrzj0Pt3LIcA1 nfKunJSrcf5cbtEnNLTQ4LKb7UGPVBNco7QzOGx5r6Wtc35gwI3WjardFa3ughUyrH YX0KJiHXIGj5Q== Date: Wed, 14 Feb 2024 11:21:44 +0200 From: Leon Romanovsky To: Arnd Bergmann Cc: Bart Van Assche , Arnd Bergmann , Jason Gunthorpe , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , "Martin K. Petersen" , "Nicholas A. Bellinger" , linux-rdma@vger.kernel.org, target-devel@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH] RDMA/srpt: fix function pointer cast warnings Message-ID: <20240214092144.GF52640@unreal> References: <20240213100728.458348-1-arnd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240213100728.458348-1-arnd@kernel.org> On Tue, Feb 13, 2024 at 11:07:13AM +0100, Arnd Bergmann wrote: > From: Arnd Bergmann > > clang-16 notices that srpt_qp_event() gets called through an incompatible > pointer here: > > drivers/infiniband/ulp/srpt/ib_srpt.c:1815:5: error: cast from 'void (*)(struct ib_event *, struct srpt_rdma_ch *)' to 'void (*)(struct ib_event *, void *)' converts to incompatible function type [-Werror,-Wcast-function-type-strict] > 1815 | = (void(*)(struct ib_event *, void*))srpt_qp_event; > > Change srpt_qp_event() to use the correct prototype and adjust the > argument inside of it. > > Fixes: a42d985bd5b2 ("ib_srpt: Initial SRP Target merge for v3.3-rc1") > Signed-off-by: Arnd Bergmann > --- > drivers/infiniband/ulp/srpt/ib_srpt.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) This patch generates the following warnings, fixed and applied. ➜ kernel git:(wip/leon-for-rc) mkt ci f17a855457db (HEAD -> build) RDMA/srpt: fix function pointer cast warnings drivers/infiniband/ulp/srpt/ib_srpt.c:220: warning: Function parameter or struct member 'ptr' not described in 'srpt_qp_event' drivers/infiniband/ulp/srpt/ib_srpt.c:220: warning: Excess function parameter 'ch' description in 'srpt_qp_event' drivers/infiniband/ulp/srpt/ib_srpt.c:220: warning: Function parameter or struct member 'ptr' not described in 'srpt_qp_event' drivers/infiniband/ulp/srpt/ib_srpt.c:220: warning: Excess function parameter 'ch' description in 'srpt_qp_event' > > diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c > index 0875f197118f..942b311b6296 100644 > --- a/drivers/infiniband/ulp/srpt/ib_srpt.c > +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c > @@ -216,8 +216,10 @@ static const char *get_ch_state_name(enum rdma_ch_state s) > * @event: Description of the event that occurred. > * @ch: SRPT RDMA channel. > */ > -static void srpt_qp_event(struct ib_event *event, struct srpt_rdma_ch *ch) > +static void srpt_qp_event(struct ib_event *event, void *ptr) > { > + struct srpt_rdma_ch *ch = ptr; > + > pr_debug("QP event %d on ch=%p sess_name=%s-%d state=%s\n", > event->event, ch, ch->sess_name, ch->qp->qp_num, > get_ch_state_name(ch->state)); > @@ -1811,8 +1813,7 @@ static int srpt_create_ch_ib(struct srpt_rdma_ch *ch) > ch->cq_size = ch->rq_size + sq_size; > > qp_init->qp_context = (void *)ch; > - qp_init->event_handler > - = (void(*)(struct ib_event *, void*))srpt_qp_event; > + qp_init->event_handler = srpt_qp_event; > qp_init->send_cq = ch->cq; > qp_init->recv_cq = ch->cq; > qp_init->sq_sig_type = IB_SIGNAL_REQ_WR; > -- > 2.39.2 >