From patchwork Tue Feb 13 09:59:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 200317 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp434514dyb; Tue, 13 Feb 2024 02:02:22 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWjrPnbVQh7zBfLdKEg/w/1uio6ZH25JzDfqhlOdx1k2yIACRoF6iSRw3hfrnjZ869oM9pEXEYk8te9FekT50NUpJ2TpQ== X-Google-Smtp-Source: AGHT+IFZkTiAvp/krkpA3qijIIwVkkPncNId77ZXalw5O/k8BdFJppWnHQff9IULg7P2Hxy7vlMm X-Received: by 2002:a17:906:46cd:b0:a3c:f32a:e9cf with SMTP id k13-20020a17090646cd00b00a3cf32ae9cfmr1110282ejs.16.1707818542619; Tue, 13 Feb 2024 02:02:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707818542; cv=pass; d=google.com; s=arc-20160816; b=Lqfh9VaPskDjFUIooeX3i6qUvB3MfxWymAeh3UTw12Fx11UlmCZiveEEMp/83dm5WC feFM/SIj7Yy5S7HDViD3gQgJ2hYL+XvKyWuR+xMXduT4kP1hsnglk75xw10fkFF+1S1G /liIdMFwlhZFt9ObPIvKfiL0bcqjm21rnGPP6ubN+u/+PSo007QlzFKZCZyJ6sObHTpe EmcF4WMYMpft5wOI2MUVXfgudfcjARfsJRNS5LgHeEtPjT6YhqG8MrJQQwmacxW9eam4 3L8lGMIPpY0yi9IhTRx9lNUziAHJ3hPDzpaGqCOUoTn5N8Pd9q5BhFFIOTKdpJq66tPF QQQg== 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=aDfsGxM/FB9PC0/3A9erOj2h9hPqHBcckhBnhAjvpS0=; b=rTP3pHyF+p7fawuBo4GiTRsBFXYjkIHkgughn0AKTC1o3BJcFngI3ENbpwZlWrf/Iv 3QkZBb9zpQroF/vhjhRCa0WRsTyUf1K8Lb0SqjPuNdyiW7ajUBEmK2DJ1FOmflaGKtHh ihwpCHb/U52K3hChO3UsYsDlIdLCkG6XR3wrUSGZiyTusRx1NQI35+PEx11xRXACadcP ZwTufhamj4SMGqesMiK0Ue9mqRQAcML4pmHqL76nTYUO8TRDJeNAIiEs6T5niDtR3pDv i+C0u1DYoG/3O3SeL27KG7IoBrulwQ4XUz9bmoORGwyPseznr+advhXzAAtoU7RYGBpD oPQQ==; 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-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63291-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCUJVgeoTgmaaWq45GVGOubAfDZCZ77mQz6gFEvp6czUBxyRiq2QWF7nlY4qMgsSuMulNgQp+eD14xisvvZL9WpvnHrYfQ== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id go44-20020a1709070dac00b00a3cbdc0f96csi1083967ejc.1051.2024.02.13.02.02.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 02:02:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-63291-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; 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-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63291-ouuuleilei=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 am.mirrors.kernel.org (Postfix) with ESMTPS id E576A1F24203 for ; Tue, 13 Feb 2024 10:01:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 13B9B3716F; Tue, 13 Feb 2024 09:59:28 +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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790777536460747216 X-GMAIL-MSGID: 1790777536460747216 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