diff mbox

[2/2] lightnvm: remove multiple groups in 1.2 data structure

Message ID 20180130132605.28635-2-m@bjorling.me (mailing list archive)
State New, archived
Headers show

Commit Message

Matias Bjørling Jan. 30, 2018, 1:26 p.m. UTC
Only one id group from the 1.2 specification is supported. Make
sure that only the first group is accessible.

Signed-off-by: Matias Bjørling <m@bjorling.me>
---
 drivers/nvme/host/lightnvm.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

=?UTF-8?q?Javier=20Gonz=C3=A1lez?= Jan. 31, 2018, 2:02 a.m. UTC | #1
> On 30 Jan 2018, at 21.26, Matias Bjørling <m@bjorling.me> wrote:
> 
> Only one id group from the 1.2 specification is supported. Make
> sure that only the first group is accessible.
> 
> Signed-off-by: Matias Bjørling <m@bjorling.me>
> ---
> drivers/nvme/host/lightnvm.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
> 

Same as before. Even though current implementation only uses one group,
the 1.2 specification relies on 4. At least, the identify structure
should reflect this.

Javier
diff mbox

Patch

diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c
index 16906327645e..e5544806fb0e 100644
--- a/drivers/nvme/host/lightnvm.c
+++ b/drivers/nvme/host/lightnvm.c
@@ -167,7 +167,8 @@  struct nvme_nvm_id {
 	__le32			dom;
 	struct nvme_nvm_addr_format ppaf;
 	__u8			resv[228];
-	struct nvme_nvm_id_group groups[4];
+	struct nvme_nvm_id_group group;
+	__u8			resv2[2880];
 } __packed;
 
 struct nvme_nvm_bb_tbl {
@@ -209,7 +210,7 @@  static int init_grps(struct nvm_id *nvm_id, struct nvme_nvm_id *nvme_nvm_id)
 	if (nvme_nvm_id->cgrps != 1)
 		return -EINVAL;
 
-	src = &nvme_nvm_id->groups[0];
+	src = &nvme_nvm_id->group;
 	grp = &nvm_id->grp;
 
 	grp->mtype = src->mtype;