Received: by 10.223.176.5 with SMTP id f5csp730312wra; Fri, 2 Feb 2018 05:16:22 -0800 (PST) X-Google-Smtp-Source: AH8x224ibBqBW1ieO+FkDXxk0BMZ+JAnIwvY6YW7pG9IITkvt9z4IpMgpLUxZxOhCdzfvq4GNNos X-Received: by 10.99.97.87 with SMTP id v84mr31977935pgb.342.1517577382478; Fri, 02 Feb 2018 05:16:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517577382; cv=none; d=google.com; s=arc-20160816; b=cVhb2rhDaAAn9Z85nygRY00qcem+Z0fhOseYFpW2G94V5OxuYdsNrbrwIkDMDBVHI7 zK3g199LE85J8lUKPcaVqOqwaSWYWgiIGbAdSFKWKrj2hakDekPhmEh7duFMEqa9V2mU flt3UKrzsUznnD9qEM4c+v4Qwj7Ek8ftxoFpy+ewQlDFAaUuG58le/UuiCJg1Dc9SNZ7 vCrE0KrKDO8aZhgkigD6UQgw9+72olShelhZi7PfvpBok9ewx4MWlSV+uDnI/SovGX74 Xt+WZyVCUHdiuYgqdM9Q+Rh6/dctzxLA9r85+wK6famS4MtHGTazR4iWAHtRbtUoeRoA lcZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=E2S8AIyIjeQ2E1nVRRCorPFqIeb2jc8WPuZpgijbpfo=; b=AHal+HehP6UiSezm69VUue9qnXb8Y9m0KKvrCRUAvOTHGPzq4A9Tcjx06bKvx1g+WI Uuwb1ruxGhaJ9x8uW72tjjOn1QbLCR9HFGEgylhWe3RjIudDmChACSOczRrof7NYVKQY mQbK5HxEVxDEpkGZekyZ25alo5GBnKE8a848xwGAfVAWl1R6+xkNZhvnQOecMLcS5GyT bFNCwH2effNSov2CS9PetoUJRHWjK9tiPJg1+1qpk2vHQIQlYEDeFd5WKfGUhRBfdhA3 RW43d9YLpLQ21blD97tp3zJ3Ef2UfPlHQ8MOS8iKj7bnPUUQxuqHgsRZmLxFlwNPK+Qw AvCg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w16-v6si1730031plp.276.2018.02.02.05.16.07; Fri, 02 Feb 2018 05:16:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752053AbeBBNOc (ORCPT + 99 others); Fri, 2 Feb 2018 08:14:32 -0500 Received: from mout.kundenserver.de ([212.227.126.135]:52782 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751709AbeBBNOL (ORCPT ); Fri, 2 Feb 2018 08:14:11 -0500 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue003 [212.227.15.129]) with ESMTPA (Nemesis) id 0Lla8x-1fGerY2GYR-00bJni; Fri, 02 Feb 2018 14:13:51 +0100 From: Arnd Bergmann To: linux-scsi@vger.kernel.org, "James E . J . Bottomley" , QLogic-Storage-Upstream@cavium.com, "Martin K. Petersen" Cc: Nicolas Pitre , Andi Kleen , Arnd Bergmann , Manish Rangankar , Tomer Tayar , "David S. Miller" , Ariel Elior , Arun Easi , Nilesh Javali , linux-kernel@vger.kernel.org Subject: [PATCH 5/6] scsi: qedi: fix building with LTO Date: Fri, 2 Feb 2018 14:12:19 +0100 Message-Id: <20180202131225.1658853-6-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180202131225.1658853-1-arnd@arndb.de> References: <20180202131225.1658853-1-arnd@arndb.de> X-Provags-ID: V03:K0:X/vEzoBnno762QFfYBVKwukKJN1Hh/T597k/Iji1/SPkM5DuoFn mqtr0Cj96mJa16e0fqqLZ8IyUwQapSmcZuwBWu/qorXEx8ACCylNtFKCIICuYV/cmXWkvM2 aJzsvmyYKtoBrIWXxGZMQPpvhSYzr3iYKME+vNIOfc3kkBxFHvislL+qbuVratdxAgWtsOI kAeMs21DaJVIZ3U6WKuWA== X-UI-Out-Filterresults: notjunk:1;V01:K0:eH6g0VIrow4=:5Xg9G5SUwszN+xwxnolInE xWgDu7l+fKaA0K4cA90HkeJM9kshrLrDp7L/Aux/b8Je0MsX9VHeKJQ4E6RYhPf8iNlpMeXxI j7mplH8Uo9BFlLTIeozP9yljVc02/1pfvHLSEADoVWKnYZ/Iz+U7OGZc1yKPbZEiV4oCltxGG v4L1mcqG4YLZr8zLO7W10zJXMbYDdUU/y325EzMoFMKGS47kRUXxRkBKwj/QE19GS3V04LgFA 32igcFL9We0qAWjk4fcwD2mLa8HjdctOX/sArsQLulk44WiGsT/HZXpAJOU+sia/OZsZ5EeBc BTIbz/a/vRUNVUeEVdNVmhnX+g96PGl/lWzeU4eNQBGOYcUEG9hjdCFhyuxiJqB/lOr6lPMFj 9f8KhZWLaU1TbJvfrnIOd0ViowDOGVLxFjJ9O8Chw0bUZHRPqvyPhiLDYtfkjHL9uZf6GtB5n hvqY4IIyzxfcZq61do/QWyW/Bu8OdOgSbXtw70VrWPiOUiUIqE7WE+HccjKFD7dzt0Pcl7TtP GZ1smro7b+/o4LKFw5VMVnNGSQE0UcS0fHhRbtpESMJ0GZq+zjzAaHB418on7wXH/+aw5YIQq o5kSYwj5XCb+dWdwLN2tDz0+bJRFh3j++8ASxGLsmwsCG3sCHzeYDqW3Au63hM/dO399i4pab 0ecs770buaYE8Z+S3aMvDpC8pEG48ZcBKcw3H/u+C2s3jQnGXmSgxvmli/18CDGVWvNLtWBgm W/dHI1iE7iJjgWvb5Uvmf8viEeT3qzwOG0zntg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When link-time optimizations are enabled, qedi fails to build because of mismatched prototypes: drivers/scsi/qedi/qedi_gbl.h:27:37: error: type of 'qedi_dbg_fops' does not match original declaration [-Werror=lto-type-mismatch] extern const struct file_operations qedi_dbg_fops; ^ drivers/scsi/qedi/qedi_debugfs.c:239:30: note: 'qedi_dbg_fops' was previously declared here const struct file_operations qedi_dbg_fops[] = { ^ drivers/scsi/qedi/qedi_gbl.h:26:32: error: type of 'qedi_debugfs_ops' does not match original declaration [-Werror=lto-type-mismatch] extern struct qedi_debugfs_ops qedi_debugfs_ops; ^ drivers/scsi/qedi/qedi_debugfs.c:102:25: note: 'qedi_debugfs_ops' was previously declared here struct qedi_debugfs_ops qedi_debugfs_ops[] = { This changes the declaration to match the definition, and adapts the users as necessary. Since both array can be constant here, I'm adding the 'const' everywhere for consistency. Signed-off-by: Arnd Bergmann --- drivers/scsi/qedi/qedi_dbg.h | 2 +- drivers/scsi/qedi/qedi_debugfs.c | 4 ++-- drivers/scsi/qedi/qedi_gbl.h | 4 ++-- drivers/scsi/qedi/qedi_main.c | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/qedi/qedi_dbg.h b/drivers/scsi/qedi/qedi_dbg.h index c55572badfb0..358f40567849 100644 --- a/drivers/scsi/qedi/qedi_dbg.h +++ b/drivers/scsi/qedi/qedi_dbg.h @@ -134,7 +134,7 @@ struct qedi_debugfs_ops { } void qedi_dbg_host_init(struct qedi_dbg_ctx *qedi, - struct qedi_debugfs_ops *dops, + const struct qedi_debugfs_ops *dops, const struct file_operations *fops); void qedi_dbg_host_exit(struct qedi_dbg_ctx *qedi); void qedi_dbg_init(char *drv_name); diff --git a/drivers/scsi/qedi/qedi_debugfs.c b/drivers/scsi/qedi/qedi_debugfs.c index fd8a1eea3163..fd914ca4149a 100644 --- a/drivers/scsi/qedi/qedi_debugfs.c +++ b/drivers/scsi/qedi/qedi_debugfs.c @@ -19,7 +19,7 @@ static struct dentry *qedi_dbg_root; void qedi_dbg_host_init(struct qedi_dbg_ctx *qedi, - struct qedi_debugfs_ops *dops, + const struct qedi_debugfs_ops *dops, const struct file_operations *fops) { char host_dirname[32]; @@ -99,7 +99,7 @@ static struct qedi_list_of_funcs qedi_dbg_do_not_recover_ops[] = { { NULL, NULL } }; -struct qedi_debugfs_ops qedi_debugfs_ops[] = { +const struct qedi_debugfs_ops qedi_debugfs_ops[] = { { "gbl_ctx", NULL }, { "do_not_recover", qedi_dbg_do_not_recover_ops}, { "io_trace", NULL }, diff --git a/drivers/scsi/qedi/qedi_gbl.h b/drivers/scsi/qedi/qedi_gbl.h index f5b5a31999aa..a2aa06ed1620 100644 --- a/drivers/scsi/qedi/qedi_gbl.h +++ b/drivers/scsi/qedi/qedi_gbl.h @@ -23,8 +23,8 @@ extern uint qedi_io_tracing; extern struct scsi_host_template qedi_host_template; extern struct iscsi_transport qedi_iscsi_transport; extern const struct qed_iscsi_ops *qedi_ops; -extern struct qedi_debugfs_ops qedi_debugfs_ops; -extern const struct file_operations qedi_dbg_fops; +extern const struct qedi_debugfs_ops qedi_debugfs_ops[]; +extern const struct file_operations qedi_dbg_fops[]; extern struct device_attribute *qedi_shost_attrs[]; int qedi_alloc_sq(struct qedi_ctx *qedi, struct qedi_endpoint *ep); diff --git a/drivers/scsi/qedi/qedi_main.c b/drivers/scsi/qedi/qedi_main.c index 029e2e69b29f..e992f9d3ef00 100644 --- a/drivers/scsi/qedi/qedi_main.c +++ b/drivers/scsi/qedi/qedi_main.c @@ -2303,8 +2303,8 @@ static int __qedi_probe(struct pci_dev *pdev, int mode) } #ifdef CONFIG_DEBUG_FS - qedi_dbg_host_init(&qedi->dbg_ctx, &qedi_debugfs_ops, - &qedi_dbg_fops); + qedi_dbg_host_init(&qedi->dbg_ctx, qedi_debugfs_ops, + qedi_dbg_fops); #endif QEDI_INFO(&qedi->dbg_ctx, QEDI_LOG_INFO, "QLogic FastLinQ iSCSI Module qedi %s, FW %d.%d.%d.%d\n", -- 2.9.0