From: Gleb C. <lna...@ya...> - 2023-05-02 20:14:44
|
Commit: 3dad1e9 GitHub URL: https://github.com/SCST-project/scst/commit/3dad1e957db0bd2b75efa645805579daa8fdbfbf Author: Gleb Chesnokov Date: 2023-05-02T23:14:06+03:00 Log Message: ----------- scst: Unbreak the build for kernel versions <= 6.3 The previous series of patches introduced the use of a const pointer to scsi_host_template. However, scsi_host_alloc() uses a non-const pointer prior to kernel version 6.4, causing the build to throw the following error: passing argument 1 of ‘scsi_host_alloc’ discards ‘const’ qualifier from pointer target type Hence, cast away the constness to resolve the error. Modified Paths: -------------- qla2x00t-32gbit/qla_os.c | 2 +- qla2x00t/qla_os.c | 2 +- scst_local/scst_local.c | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) =================================================================== diff --git a/qla2x00t-32gbit/qla_os.c b/qla2x00t-32gbit/qla_os.c index 50aa600..4b4b19f 100644 --- a/qla2x00t-32gbit/qla_os.c +++ b/qla2x00t-32gbit/qla_os.c @@ -5084,7 +5084,7 @@ struct scsi_qla_host *qla2x00_create_host(const struct scsi_host_template *sht, struct Scsi_Host *host; struct scsi_qla_host *vha = NULL; - host = scsi_host_alloc(sht, sizeof(scsi_qla_host_t)); + host = scsi_host_alloc((struct scsi_host_template *) sht, sizeof(scsi_qla_host_t)); if (!host) { ql_log_pci(ql_log_fatal, ha->pdev, 0x0107, "Failed to allocate host from the scsi layer, aborting.\n"); diff --git a/qla2x00t/qla_os.c b/qla2x00t/qla_os.c index 2976b1b..4ffa2f6 100644 --- a/qla2x00t/qla_os.c +++ b/qla2x00t/qla_os.c @@ -3625,7 +3625,7 @@ struct scsi_qla_host *qla2x00_create_host(const struct scsi_host_template *sht, struct Scsi_Host *host; struct scsi_qla_host *vha = NULL; - host = scsi_host_alloc(sht, sizeof(scsi_qla_host_t)); + host = scsi_host_alloc((struct scsi_host_template *) sht, sizeof(scsi_qla_host_t)); if (host == NULL) { ql_log_pci(ql_log_fatal, ha->pdev, 0x0107, "Failed to allocate host from the scsi layer, aborting.\n"); diff --git a/scst_local/scst_local.c b/scst_local/scst_local.c index 7577b98..742a05c 100644 --- a/scst_local/scst_local.c +++ b/scst_local/scst_local.c @@ -1425,7 +1425,8 @@ static int scst_local_driver_probe(struct device *dev) TRACE_DBG("sess %p", sess); - hpnt = scsi_host_alloc(&scst_lcl_ini_driver_template, sizeof(*sess)); + hpnt = scsi_host_alloc((struct scsi_host_template *) &scst_lcl_ini_driver_template, + sizeof(*sess)); if (hpnt == NULL) { PRINT_ERROR("%s", "scsi_register() failed"); ret = -ENODEV; |