From patchwork Fri Feb 2 13:12:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 126706 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp632243ljc; Fri, 2 Feb 2018 05:14:37 -0800 (PST) X-Google-Smtp-Source: AH8x2255/4DGd3JTQ8uabEBGjbu4qQ5b3lNjD0dLTtDJr5hvbYpVX48ki4XMGMkbl1sNPX/b7IcQ X-Received: by 10.98.86.130 with SMTP id h2mr5937961pfj.208.1517577276899; Fri, 02 Feb 2018 05:14:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517577276; cv=none; d=google.com; s=arc-20160816; b=xAPWYFnmKD1azD8UYZboEFC903oGh/G3C2Bv2zGdTEQfx46bZEQS/r8MqDQhHdmEeg SS3Xh5X1UkJe8ab22CRH0GPb2Rdul9Gykpd0Zc+Iis14h5J3kOq8jJm537Tjz2B2SRRO g6usuh7JruzdRS188wUS2qaEM8opsBAFPUrEOekJDqUtlRs1r0dWpAcFzV+3LfbuRXg/ yGgG9Bu4KQv/qipOwkv2NmLIaB1hy1B4F63VodW2dlcW5gvJ+tOHC571cln/rFf1G7VJ DbytP5Oxvn8rBAftxhuL19mlLDYze5wlOGbYg1UbryKErg215XsvjVT5ZknzHY0V8D1f Wfuw== 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 h184si1439888pgc.148.2018.02.02.05.14.36; Fri, 02 Feb 2018 05:14:36 -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 S1752086AbeBBNOe (ORCPT + 28 others); Fri, 2 Feb 2018 08:14:34 -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(-) -- 2.9.0 Acked-by: Manish Rangankar 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",