@@ -136,11 +136,11 @@ static int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc,
if (dsm_call) {
/* must skip over package wrapper */
in_buf.buffer.pointer = (void *) &pkg->dsm_buf;
- in_buf.buffer.length = pkg->h.dsm_in;
+ in_buf.buffer.length = pkg->dsm_in;
/* for pass thru must use value sent in from user space. */
- uuid = pkg->h.dsm_uuid;
- rev = pkg->h.dsm_rev;
- func = pkg->h.dsm_fun_idx;
+ uuid = pkg->dsm_uuid;
+ rev = pkg->dsm_rev;
+ func = pkg->dsm_fun_idx;
}
if (IS_ENABLED(CONFIG_ACPI_NFIT_DEBUG)) {
@@ -174,11 +174,9 @@ static int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc,
}
if (dsm_call) {
- pkg->h.dsm_size = out_obj->buffer.length;
- memcpy(pkg->dsm_buf + pkg->h.dsm_in,
- out_obj->buffer.pointer,
- min(pkg->h.dsm_size, pkg->h.dsm_out));
-
+ pkg->dsm_size = out_obj->buffer.length;
+ memcpy(pkg->dsm_buf + pkg->dsm_in, out_obj->buffer.pointer,
+ min(pkg->dsm_size, pkg->dsm_out));
ACPI_FREE(out_obj);
return 0;
}
@@ -437,7 +437,7 @@ u32 nd_cmd_in_size(struct nvdimm *nvdimm, int cmd,
} else if (cmd == ND_CMD_CALL_DSM) {
struct nd_cmd_dsmcall_pkg *pkg = buf;
- return pkg->h.dsm_in;
+ return pkg->dsm_in;
}
return UINT_MAX;
@@ -463,7 +463,7 @@ u32 nd_cmd_out_size(struct nvdimm *nvdimm, int cmd,
else if (cmd == ND_CMD_CALL_DSM) {
struct nd_cmd_dsmcall_pkg *pkg =
(struct nd_cmd_dsmcall_pkg *) in_field;
- return pkg->h.dsm_out;
+ return pkg->dsm_out;
}
@@ -576,12 +576,11 @@ static int __nd_ioctl(struct nvdimm_bus *nvdimm_bus, struct nvdimm *nvdimm,
pkg = (struct nd_cmd_dsmcall_pkg *) in_env;
dev_dbg(dev, "%s:%s rev: %llu, idx: %llu, in: %zu, out: %zu, len %zu\n",
- __func__, dimm_name,
- pkg->h.dsm_rev, pkg->h.dsm_fun_idx,
- in_len, out_len, buf_len);
+ __func__, dimm_name, pkg->dsm_rev,
+ pkg->dsm_fun_idx, in_len, out_len, buf_len);
- for (i = 0; i < ARRAY_SIZE(pkg->h.reserved2); i++)
- if (pkg->h.reserved2[i])
+ for (i = 0; i < ARRAY_SIZE(pkg->reserved2); i++)
+ if (pkg->reserved2[i])
return -EINVAL;
}
@@ -213,16 +213,14 @@ enum ars_masks {
struct nd_cmd_dsmcall_pkg {
- struct {
- __u8 dsm_uuid[16];
- __u64 reserved1; /* reserved should be zero */
- __u64 dsm_rev; /* revision of dsm call */
- __u64 dsm_fun_idx; /* DSM function id */
- __u32 dsm_in; /* size of _DSM input */
- __u32 dsm_out; /* size of user buffer */
- __u32 reserved2[23]; /* reserved must be zero */
- __u32 dsm_size; /* size _DSM would write */
- } h;
+ __u8 dsm_uuid[16];
+ __u64 reserved1; /* reserved should be zero */
+ __u64 dsm_rev; /* revision of dsm call */
+ __u64 dsm_fun_idx; /* DSM function id */
+ __u32 dsm_in; /* size of _DSM input */
+ __u32 dsm_out; /* size of user buffer */
+ __u32 reserved2[23]; /* reserved must be zero */
+ __u32 dsm_size; /* size _DSM would write */
unsigned char dsm_buf[]; /* Contents of DSM call */
};
Embedding the header items in an anonymous struct clutters the resulting code for no benefit. Signed-off-by: Dan Williams <dan.j.williams@intel.com> --- drivers/acpi/nfit.c | 16 +++++++--------- drivers/nvdimm/bus.c | 13 ++++++------- include/uapi/linux/ndctl.h | 18 ++++++++---------- 3 files changed, 21 insertions(+), 26 deletions(-)