Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2956510rdb; Tue, 13 Feb 2024 02:25:19 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUdbcUjUhmTIrKlnMIz00U9Nv6YzMbpUzkUGac7SuET/oGu+MKIAE2SidvzdqExkp0csxt/Nwpkngv/juk++FV9jFS9It5K21fizXtPQA== X-Google-Smtp-Source: AGHT+IGEUfIhW7U3Apqs4Bibc518Sy3SinsGnoMdCioXcd5K7WRjznbi9W8RejgQBisuqynWDVHJ X-Received: by 2002:a05:6a00:2d24:b0:6e0:f2a6:abde with SMTP id fa36-20020a056a002d2400b006e0f2a6abdemr3178001pfb.5.1707819919137; Tue, 13 Feb 2024 02:25:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707819919; cv=pass; d=google.com; s=arc-20160816; b=SYGVrMMw7RxnHjU3CcF5Xq7Z7PSz+s8pUaoWXwnirtA80pZ3Wnqr8vI65Ow5r6jr9L 1VMWspRVJF/0A8FvbSyW/tWKzuB7Doa3VIHkS5ec1QWg5X331oKZ6EFha8nyeAt6xlOW p7Otc7t0tKueBFBPWL9ERTiWC7oxkMYuS6Fc7NbFah1w9TRC28cmi2YT9pLjOH2nRbV5 l4IXG80oROLbqkNIpzdcvyR2HsWSgKtCU+IRh5T3p6rEQXG42OcDWuMXG81CWAY/Kov5 TEWjX1RM+KUwef98FE6R0Ks1YQ65xMmSWQxqkqP+BElymQd0sGFp7pqILX1WhPki3QYh 9z8g== 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=fGbg4jJWuaSTBu0MRiAG8x1JHiN63yNye3bpI3e1Sh4=; fh=HsgYWkzw74H+7cMutpc5vt/6g/7snENwc0hINt9cq3g=; b=xr318HY1KnRn4mofVZeLZjgRaN4T95gWDFB1OWXrm7eAoCuu3adbqiOBqY0FcPo68B Uh2S7nFM94DbIRrEN47gW2L1R5xBqM1LIDAVEpADzpYPTXZ4D8SaejRVj3+DN1O7cF56 HBV7f/PMU49wRjhRJ4oS7fhbjEUD1Ll80HGdPF3gcfXmNZqF0ziBSMtBJiScvCq6CjuH CRLgbHc49k57iQuabHPeV+WFTkeM8JbsQ+P8LGdmLdJphIIwZXi425hhezxAj0jvlnzH geJcgAFS7obnS6msEVwUDQ1XXwFpqhMftQaUnu1YREvk4kSpq9+TuwaJIlqzi+kpqtJJ PQzA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=P8BmoHJO; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-63291-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63291-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; AJvYcCUgIueHE9GWyFmoxQyZ0kWiZzD+M5UkQ7MHS9m+0LhErEliVbA6fMxFTsxJsMmOT2EnhnwM3WBebDIPbQeYNU/KcJdqk9kAw9rQ5ppqAg== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id x32-20020a056a0018a000b006dbe30aeb1dsi6586445pfh.112.2024.02.13.02.25.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 02:25:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-63291-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=P8BmoHJO; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-63291-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63291-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 D6435B29582 for ; Tue, 13 Feb 2024 10:01:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3CC1836AE9; Tue, 13 Feb 2024 09:59:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="P8BmoHJO" 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 5722A3613A; Tue, 13 Feb 2024 09:59:25 +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=1707818365; cv=none; b=NFLbc0k7XTsRIYJ0wCATwhj2iVo/1wnb/gTUXNen2MQb+6veDKe+gWyuUJf07a6V8YlRkQVFEgsxKrWyVDWyNSeUT1MTSl1IFLUedK9uZ1T0QlDCUtphAJMIMcp/TemkvEbdYtubDbYr8ZWPZFuOCQuElS3x7FoWdypNJByqZ5g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707818365; c=relaxed/simple; bh=UNaT/TcOOYKTpTEIwTZQopiZeqe91jixzxP3/uh8vag=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=GP4zIPLNjTLwcU7wib1igCEiAr7WP+/QVhvLfuofuvP8+h9uN01jA+5W2yjEJweO603WyAwfrQgeT9Q84E7jB2ujX5UIUXWN0dmFB6NBPlIFSL5SMH6R8V6ZDlWif/USXpl1+xSc8BnXtSShuyrm5+adFc4WN2SQvg5aYzLVf3o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=P8BmoHJO; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A1A4CC433C7; Tue, 13 Feb 2024 09:59:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707818364; bh=UNaT/TcOOYKTpTEIwTZQopiZeqe91jixzxP3/uh8vag=; h=From:To:Cc:Subject:Date:From; b=P8BmoHJOB+QEfz31J05kpFoB7sp1M81dAD0VI+fCLeuU4u7JwYZu4z/Lo8dFZuj4L YeF8Uj8nMqakhnaHLSZXdBrNXg+brjp5MgjwL3QsI5pjBlbyy1Ctw58pJvRP9h1Par g8rEI9q8Kc0tDQOeJsoBbtKghIYWMpWsDPDYPHsZl2XBrfT81BoLsSXaAfAPgH2UNP JOIzRErOZ9PI5qX5OmOYmV57JZnHNAUuK+p4XerQLkaXU20jwHziCCI3ndJfr3tCHn hjNDHIA7dSQpLCoW5V91D6GLDAyXA9tbM4U+kKMGHqSftd+Aj0z95LfY67kGk2mwOo IewacrGqVADfQ== From: Arnd Bergmann To: Denis Efremov , Jens Axboe Cc: Arnd Bergmann , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Christian Brauner , Hannes Reinecke , Andrew Morton , "Kirill A. Shutemov" , Johannes Thumshirn , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH] floppy: fix function pointer cast warnings Date: Tue, 13 Feb 2024 10:59:07 +0100 Message-Id: <20240213095918.455478-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 complains about a control flow integrity (kcfi) violation casting between incompatible pointers: drivers/block/floppy.c:2001:11: error: cast from 'void (*)(void)' to 'done_f' (aka 'void (*)(int)') converts to incompatible function type [-Werror,-Wcast-function-type-strict] 2001 | .done = (done_f)empty | ^~~~~~~~~~~~~ Just add another empty function with the correct prototype as a workaround. The warning is for code that was added before the start of the normal git history, but I tracked it done to an early change in the reconstructed linux-history.git. Fixes: 598a477afe06 ("Import 1.1.41") Signed-off-by: Arnd Bergmann --- drivers/block/floppy.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index d0e41d52d6a9..2ba0ba135951 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -530,14 +530,13 @@ static struct format_descr format_req; static char *floppy_track_buffer; static int max_buffer_sectors; -typedef void (*done_f)(int); static const struct cont_t { void (*interrupt)(void); /* this is called after the interrupt of the * main command */ void (*redo)(void); /* this is called to retry the operation */ void (*error)(void); /* this is called to tally an error */ - done_f done; /* this is called to say if the operation has + void (*done)(int); /* this is called to say if the operation has * succeeded/failed */ } *cont; @@ -985,6 +984,10 @@ static void empty(void) { } +static void empty_done(int result) +{ +} + static void (*floppy_work_fn)(void); static void floppy_work_workfn(struct work_struct *work) @@ -1998,14 +2001,14 @@ static const struct cont_t wakeup_cont = { .interrupt = empty, .redo = do_wakeup, .error = empty, - .done = (done_f)empty + .done = empty_done, }; static const struct cont_t intr_cont = { .interrupt = empty, .redo = process_fd_request, .error = empty, - .done = (done_f)empty + .done = empty_done, }; /* schedules handler, waiting for completion. May be interrupted, will then -- 2.39.2