Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2959452rdb; Tue, 13 Feb 2024 02:32:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IFjE6J/wGIyKVVXJVRbjA2HGA1AlJ+qOA3d9Cej8k7sMD0xLI2OvBLAs9gcSJg71jDRlau5 X-Received: by 2002:a17:903:2281:b0:1d9:b9da:ea8f with SMTP id b1-20020a170903228100b001d9b9daea8fmr13323895plh.2.1707820361734; Tue, 13 Feb 2024 02:32:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707820361; cv=pass; d=google.com; s=arc-20160816; b=UHxCGp1jsG64E1l9PSmjyrY6HQ/+hXGUv2dMjO1qwRQPZHgTN0/iykcns3skokLzaa ERQQYA5cIYnlAmrxZs4dBcESooKdnYp3gykV4lvlO9KpWw6KfvfZH/k3D+VRWsoOfCTt jE1H1IiqorzIWNI9kuGCmJfqfXbunmgTD55RzpDPX4JIpzIMSwp3eU79IrWmJ8JrLeQe rHSK04t2rlg0ijpOQfhyDery/NpWNCzMUclFuWjoWG40ezTHlA5CSst5SWTL7GilozBt NNo/H6PUjRT9VG0lXBxa7n2fa8Zebfp+9dvUbT28ULe50tlHk0yZxMDaXMzMNqFDz7ir sxhw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=INXCUwVMCTgun/xFcL5cdw9S3io0yuf4kvOvdN8wCCM=; fh=r+hW9CeKxqoCHpWW6lh1Ph0xs5RaDkVuv3AmcQdZ1CY=; b=ALLSrIEl/hlL7W0F9RV/IOe/+rbqSnZe6mp2689OTadwWhJK8H6tyV0tqwVWHD724g L139Abhl5IyC1BCIZu+1PRhl25psrUxmWMcSbExlPlaXAD5D7iPtIVDxNU1q548Gkn0q lcX7FELaW+oigXEVDjlA2E/vkqZRQ3R+r8vuOa1aXDIXktQLkYZ6q/l//61OlX4aL5bf jpUPy24+VHB2IEwDk90q0dDMDqMKFKkqTWFBd3kRXUE8ox3IupPqEc5bNdsCulDJASxr pGAq63NPaJbCmemnIeX3a4N5wvvIOn3N7go1u/cH5aOfOku9NM2gakN/hrIleyGz8aW+ 7Ejg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FoBBTJBn; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-63306-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63306-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; AJvYcCXofectUaHAEj05DnyS9/Gfftxt4k4ZCb4GUqgDtyGAoirvPzf8XAVJWc6LVl+IWlOK1V3h0aK96Eo1olFX0XafBQ6MuL+tsOEo/XYO1w== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id u10-20020a170902e80a00b001db339f4096si1088491plg.395.2024.02.13.02.32.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 02:32:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-63306-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FoBBTJBn; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-63306-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63306-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 AA68BB23245 for ; Tue, 13 Feb 2024 10:07:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 171F9225B2; Tue, 13 Feb 2024 10:07:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FoBBTJBn" 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 3478A22EE3; Tue, 13 Feb 2024 10:07:34 +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=1707818855; cv=none; b=RJlnyoKagE8XbJ2kQvdqHkqabWBiBfx+6n6vBTlSdY9PKDCHoFO2/O+I2nnqf2yZNfvElo01k7ohwnSYcZpgsA5VWzYOW+H1e3iSA4m0lloE/qVUtguzBz++wKfBPdrdgxlFI+1gyiJ+xmLIU7uTSV4kHEROUvoBFTlZdK3avvw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707818855; c=relaxed/simple; bh=TfBI8+XT35oYQJ/Alj2IsV1Q/w0MB4GZiDDW54Ji4wI=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=NVPDWBDlTDttTnU6LcuEnG0SlukQfhnYCIN2h0MrGdLJVJEcQeOdwgkJtJ/NgeWKqyixor1h1Zf1MfEsI8piz4YOI6QDZdq6UpDKy8pfJgw03PP8+DIF8MQMJWos5Slys1+42jmp5QolvNfa3S+mBtCeA/Yd25xhkpvSdztDLEc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FoBBTJBn; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B0D8DC433F1; Tue, 13 Feb 2024 10:07:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707818854; bh=TfBI8+XT35oYQJ/Alj2IsV1Q/w0MB4GZiDDW54Ji4wI=; h=From:To:Cc:Subject:Date:From; b=FoBBTJBnT9jMzq2HQpaXgCfIU0GKlnax5THlFjXZ/lghnWleJee7NaysU/oungnq1 d5B8z6I6EDtKGApEceeeMZpaH3ffSfzp+kEZ1NrrB8E7BGRAM2oxzsqb9fCSHxO5AG QUjRq4oU96o5xktf7ZiuOt12Vm3fFe5L2/otQ6dz14JisIV0OgQgJW5P3KQuMueVwv 1NKO9kHvC6y7owf7yOQrjQOUMa2G3X69ISNOzYft2GJzRhZD3KTTSjcq73dsT/6ctj +yN0WHCTvSLkTwRPjzt/j5cztFC7nSJaQfHpQN7hAL+bZ+9PMtvVbC7Y9h0qZiEc7R Jk/bpHkgLVNFw== From: Arnd Bergmann To: Bart Van Assche Cc: Arnd Bergmann , Jason Gunthorpe , Leon Romanovsky , 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: [PATCH] RDMA/srpt: fix function pointer cast warnings Date: Tue, 13 Feb 2024 11:07:13 +0100 Message-Id: <20240213100728.458348-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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(-) 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