From patchwork Thu Feb 16 00:16:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Busch X-Patchwork-Id: 9575911 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D5CFD60244 for ; Thu, 16 Feb 2017 00:08:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C91A328592 for ; Thu, 16 Feb 2017 00:08:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BD8E4285A2; Thu, 16 Feb 2017 00:08:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 586892859F for ; Thu, 16 Feb 2017 00:08:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754657AbdBPAIS (ORCPT ); Wed, 15 Feb 2017 19:08:18 -0500 Received: from mga04.intel.com ([192.55.52.120]:64327 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752822AbdBPAIR (ORCPT ); Wed, 15 Feb 2017 19:08:17 -0500 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Feb 2017 16:08:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,167,1484035200"; d="scan'208";a="45296538" Received: from unknown (HELO localhost.lm.intel.com) ([10.232.112.96]) by orsmga002.jf.intel.com with ESMTP; 15 Feb 2017 16:08:16 -0800 From: Keith Busch To: linux-block@vger.kernel.org, Scott Bauer , Jonathan Derrick Cc: Jens Axboe , Keith Busch Subject: [PATCH] opal: Use empty structure when not defined Date: Wed, 15 Feb 2017 19:16:27 -0500 Message-Id: <1487204187-4004-1-git-send-email-keith.busch@intel.com> X-Mailer: git-send-email 2.5.5 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP No need to use space if it can't be used. This reduces the size of struct nvme_ctrl by a little over 4k when CONFIG_BLK_SED_OPAL is not set. Signed-off-by: Keith Busch Reviewed-by: Scott Bauer --- include/linux/sed-opal.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/linux/sed-opal.h b/include/linux/sed-opal.h index 205d520..ed19902 100644 --- a/include/linux/sed-opal.h +++ b/include/linux/sed-opal.h @@ -91,6 +91,7 @@ struct parsed_resp { struct opal_resp_tok toks[MAX_TOKS]; }; +#ifdef CONFIG_BLK_SED_OPAL /** * struct opal_dev - The structure representing a OPAL enabled SED. * @supported: Whether or not OPAL is supported on this controller. @@ -129,7 +130,6 @@ struct opal_dev { struct list_head unlk_lst; }; -#ifdef CONFIG_BLK_SED_OPAL bool opal_unlock_from_suspend(struct opal_dev *dev); void init_opal_dev(struct opal_dev *opal_dev, sec_send_recv *send_recv); int sed_ioctl(struct opal_dev *dev, unsigned int cmd, void __user *ioctl_ptr); @@ -154,6 +154,9 @@ static inline bool is_sed_ioctl(unsigned int cmd) return false; } #else +struct opal_dev { +}; + static inline bool is_sed_ioctl(unsigned int cmd) { return false; @@ -171,8 +174,6 @@ static inline bool opal_unlock_from_suspend(struct opal_dev *dev) static inline void init_opal_dev(struct opal_dev *opal_dev, sec_send_recv *send_recv) { - opal_dev->supported = false; - opal_dev->initialized = true; } #endif /* CONFIG_BLK_SED_OPAL */ #endif /* LINUX_OPAL_H */