Message ID | 20210419192801.62255-2-its@irrelevant.dk (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | hw(/block/)nvme: spring cleaning | expand |
On 19/04/2021 21.27, Klaus Jensen wrote: > From: Klaus Jensen <k.jensen@samsung.com> > > Get rid of the (reserved) double underscore use. > > Cc: Philippe Mathieu-Daudé <philmd@redhat.com> > Cc: Thomas Huth <thuth@redhat.com> > Signed-off-by: Klaus Jensen <k.jensen@samsung.com> > --- > hw/block/nvme.c | 16 ++++++++++------ > 1 file changed, 10 insertions(+), 6 deletions(-) I think it would be good to mention the change with NVME_ZRM_AUTO in the patch description, too. Apart from that: Reviewed-by: Thomas Huth <thuth@redhat.com>
On Apr 20 07:53, Thomas Huth wrote: >On 19/04/2021 21.27, Klaus Jensen wrote: >>From: Klaus Jensen <k.jensen@samsung.com> >> >>Get rid of the (reserved) double underscore use. >> >>Cc: Philippe Mathieu-Daudé <philmd@redhat.com> >>Cc: Thomas Huth <thuth@redhat.com> >>Signed-off-by: Klaus Jensen <k.jensen@samsung.com> >>--- >> hw/block/nvme.c | 16 ++++++++++------ >> 1 file changed, 10 insertions(+), 6 deletions(-) > >I think it would be good to mention the change with NVME_ZRM_AUTO in >the patch description, too. > >Apart from that: >Reviewed-by: Thomas Huth <thuth@redhat.com> > Makes sense, thanks!
diff --git a/hw/block/nvme.c b/hw/block/nvme.c index 624a1431d072..002c0672b397 100644 --- a/hw/block/nvme.c +++ b/hw/block/nvme.c @@ -1682,8 +1682,12 @@ static void nvme_zrm_auto_transition_zone(NvmeNamespace *ns) } } -static uint16_t __nvme_zrm_open(NvmeNamespace *ns, NvmeZone *zone, - bool implicit) +enum { + NVME_ZRM_AUTO = 1 << 0, +}; + +static uint16_t nvme_zrm_open_flags(NvmeNamespace *ns, NvmeZone *zone, + int flags) { int act = 0; uint16_t status; @@ -1707,7 +1711,7 @@ static uint16_t __nvme_zrm_open(NvmeNamespace *ns, NvmeZone *zone, nvme_aor_inc_open(ns); - if (implicit) { + if (flags & NVME_ZRM_AUTO) { nvme_assign_zone_state(ns, zone, NVME_ZONE_STATE_IMPLICITLY_OPEN); return NVME_SUCCESS; } @@ -1715,7 +1719,7 @@ static uint16_t __nvme_zrm_open(NvmeNamespace *ns, NvmeZone *zone, /* fallthrough */ case NVME_ZONE_STATE_IMPLICITLY_OPEN: - if (implicit) { + if (flags & NVME_ZRM_AUTO) { return NVME_SUCCESS; } @@ -1733,12 +1737,12 @@ static uint16_t __nvme_zrm_open(NvmeNamespace *ns, NvmeZone *zone, static inline uint16_t nvme_zrm_auto(NvmeNamespace *ns, NvmeZone *zone) { - return __nvme_zrm_open(ns, zone, true); + return nvme_zrm_open_flags(ns, zone, NVME_ZRM_AUTO); } static inline uint16_t nvme_zrm_open(NvmeNamespace *ns, NvmeZone *zone) { - return __nvme_zrm_open(ns, zone, false); + return nvme_zrm_open_flags(ns, zone, 0); } static void __nvme_advance_zone_wp(NvmeNamespace *ns, NvmeZone *zone,