All of lore.kernel.org
 help / color / mirror / Atom feed
From: Keith Busch <keith.busch@intel.com>
To: linux-block@vger.kernel.org, Scott Bauer <scott.bauer@intel.com>,
	Jonathan Derrick <jonathan.derrick@intel.com>
Cc: Jens Axboe <axboe@fb.com>, Keith Busch <keith.busch@intel.com>
Subject: [PATCH] opal: Use empty structure when not defined
Date: Wed, 15 Feb 2017 19:16:27 -0500	[thread overview]
Message-ID: <1487204187-4004-1-git-send-email-keith.busch@intel.com> (raw)

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 <keith.busch@intel.com>
---
 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 */
-- 
2.5.5

             reply	other threads:[~2017-02-16  0:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-16  0:16 Keith Busch [this message]
2017-02-16  2:01 ` [PATCH] opal: Use empty structure when not defined Scott Bauer
2017-02-16  7:58 ` Christoph Hellwig
2017-02-16 17:18   ` Jon Derrick
2017-02-16 17:21     ` Christoph Hellwig
2017-02-16 17:37     ` Scott Bauer
2017-02-16 17:39       ` Scott Bauer
2017-02-16 18:45   ` Scott Bauer
2017-02-16 20:07     ` Christoph Hellwig
2017-02-16 20:52       ` Scott Bauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1487204187-4004-1-git-send-email-keith.busch@intel.com \
    --to=keith.busch@intel.com \
    --cc=axboe@fb.com \
    --cc=jonathan.derrick@intel.com \
    --cc=linux-block@vger.kernel.org \
    --cc=scott.bauer@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.