[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240312094133.2084996-4-max.kellermann@ionos.com>
Date: Tue, 12 Mar 2024 10:41:21 +0100
From: Max Kellermann <max.kellermann@...os.com>
To: akpm@...ux-foundation.org,
linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Cc: willy@...radead.org,
sfr@...b.auug.org.au,
Max Kellermann <max.kellermann@...os.com>
Subject: [PATCH v4 03/15] include/scsi/scsicam.h: forward-declare struct block_device
After eliminating includes of linux/mm.h, the following build failure
occurred:
In file included from drivers/scsi/fdomain.c:87:
./include/scsi/scsicam.h:16:31: error: 'struct block_device' declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
16 | int scsicam_bios_param(struct block_device *bdev, sector_t capacity, int *ip);
| ^~~~~~~~~~~~
./include/scsi/scsicam.h:17:27: error: 'struct block_device' declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
17 | bool scsi_partsize(struct block_device *bdev, sector_t capacity, int geom[3]);
| ^~~~~~~~~~~~
./include/scsi/scsicam.h:18:40: error: 'struct block_device' declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
18 | unsigned char *scsi_bios_ptable(struct block_device *bdev);
| ^~~~~~~~~~~~
drivers/scsi/fdomain.c: In function 'fdomain_biosparam':
drivers/scsi/fdomain.c:475:45: error: passing argument 1 of 'scsi_bios_ptable' from incompatible pointer type [-Werror=incompatible-pointer-types]
475 | unsigned char *p = scsi_bios_ptable(bdev);
| ^~~~
| |
| struct block_device *
./include/scsi/scsicam.h:18:54: note: expected 'struct block_device *' but argument is of type 'struct block_device *'
18 | unsigned char *scsi_bios_ptable(struct block_device *bdev);
| ~~~~~~~~~~~~~~~~~~~~~^~~~
Signed-off-by: Max Kellermann <max.kellermann@...os.com>
---
include/scsi/scsicam.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/scsi/scsicam.h b/include/scsi/scsicam.h
index 6eb9fb7a57d0..c0de038b76b5 100644
--- a/include/scsi/scsicam.h
+++ b/include/scsi/scsicam.h
@@ -16,6 +16,8 @@
#include <linux/types.h> // for sector_t
+struct block_device;
+
int scsicam_bios_param(struct block_device *bdev, sector_t capacity, int *ip);
bool scsi_partsize(struct block_device *bdev, sector_t capacity, int geom[3]);
unsigned char *scsi_bios_ptable(struct block_device *bdev);
--
2.39.2
Powered by blists - more mailing lists