All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] nvmet: nvme_excute_get_feat() cleanup
@ 2022-03-09 17:43 Chaitanya Kulkarni
  2022-03-09 17:43 ` [PATCH 1/2] nvmet: open code nvmet_get_feat_async_event() Chaitanya Kulkarni
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Chaitanya Kulkarni @ 2022-03-09 17:43 UTC (permalink / raw)
  To: linux-nvme; +Cc: hch, sagi, Chaitanya Kulkarni

Hi,

Just open code get feature functions which has only one caller and one
line.

-ck

Chaitanya Kulkarni (2):
  nvmet: open code nvmet_get_feat_async_event()
  nvmet: open code nvmet_get_feat_kato()

 drivers/nvme/target/admin-cmd.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

-- 
2.29.0



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/2] nvmet: open code nvmet_get_feat_async_event()
  2022-03-09 17:43 [PATCH 0/2] nvmet: nvme_excute_get_feat() cleanup Chaitanya Kulkarni
@ 2022-03-09 17:43 ` Chaitanya Kulkarni
  2022-03-09 17:43 ` [PATCH 2/2] nvmet: open code nvmet_get_feat_kato() Chaitanya Kulkarni
  2022-03-14  7:42 ` [PATCH 0/2] nvmet: nvme_excute_get_feat() cleanup Christoph Hellwig
  2 siblings, 0 replies; 7+ messages in thread
From: Chaitanya Kulkarni @ 2022-03-09 17:43 UTC (permalink / raw)
  To: linux-nvme; +Cc: hch, sagi, Chaitanya Kulkarni

Just like we have open coded NVME_FEAT_HOST_ID handling, open code one
liner function nvmet_get_feat_async_event() for NVME_FEAT_ASYNC_EVENT.

Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
---
 drivers/nvme/target/admin-cmd.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cmd.c
index 6fb24746de06..e034ced953a3 100644
--- a/drivers/nvme/target/admin-cmd.c
+++ b/drivers/nvme/target/admin-cmd.c
@@ -894,11 +894,6 @@ void nvmet_get_feat_kato(struct nvmet_req *req)
 	nvmet_set_result(req, req->sq->ctrl->kato * 1000);
 }
 
-void nvmet_get_feat_async_event(struct nvmet_req *req)
-{
-	nvmet_set_result(req, READ_ONCE(req->sq->ctrl->aen_enabled));
-}
-
 void nvmet_execute_get_features(struct nvmet_req *req)
 {
 	struct nvmet_subsys *subsys = nvmet_req_subsys(req);
@@ -931,7 +926,7 @@ void nvmet_execute_get_features(struct nvmet_req *req)
 		break;
 #endif
 	case NVME_FEAT_ASYNC_EVENT:
-		nvmet_get_feat_async_event(req);
+		nvmet_set_result(req, READ_ONCE(req->sq->ctrl->aen_enabled));
 		break;
 	case NVME_FEAT_VOLATILE_WC:
 		nvmet_set_result(req, 1);
-- 
2.29.0



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] nvmet: open code nvmet_get_feat_kato()
  2022-03-09 17:43 [PATCH 0/2] nvmet: nvme_excute_get_feat() cleanup Chaitanya Kulkarni
  2022-03-09 17:43 ` [PATCH 1/2] nvmet: open code nvmet_get_feat_async_event() Chaitanya Kulkarni
@ 2022-03-09 17:43 ` Chaitanya Kulkarni
  2022-03-14  7:42 ` [PATCH 0/2] nvmet: nvme_excute_get_feat() cleanup Christoph Hellwig
  2 siblings, 0 replies; 7+ messages in thread
From: Chaitanya Kulkarni @ 2022-03-09 17:43 UTC (permalink / raw)
  To: linux-nvme; +Cc: hch, sagi, Chaitanya Kulkarni

Just like we have open coded NVME_FEAT_HOST_ID handling, open code one
liner function nvmet_get_feat_kato() for NVME_FEAT_KATO.

Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
---
 drivers/nvme/target/admin-cmd.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cmd.c
index e034ced953a3..50db5dfc1929 100644
--- a/drivers/nvme/target/admin-cmd.c
+++ b/drivers/nvme/target/admin-cmd.c
@@ -889,11 +889,6 @@ static u16 nvmet_get_feat_write_protect(struct nvmet_req *req)
 	return 0;
 }
 
-void nvmet_get_feat_kato(struct nvmet_req *req)
-{
-	nvmet_set_result(req, req->sq->ctrl->kato * 1000);
-}
-
 void nvmet_execute_get_features(struct nvmet_req *req)
 {
 	struct nvmet_subsys *subsys = nvmet_req_subsys(req);
@@ -936,7 +931,7 @@ void nvmet_execute_get_features(struct nvmet_req *req)
 			(subsys->max_qid-1) | ((subsys->max_qid-1) << 16));
 		break;
 	case NVME_FEAT_KATO:
-		nvmet_get_feat_kato(req);
+		nvmet_set_result(req, req->sq->ctrl->kato * 1000);
 		break;
 	case NVME_FEAT_HOST_ID:
 		/* need 128-bit host identifier flag */
-- 
2.29.0



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/2] nvmet: nvme_excute_get_feat() cleanup
  2022-03-09 17:43 [PATCH 0/2] nvmet: nvme_excute_get_feat() cleanup Chaitanya Kulkarni
  2022-03-09 17:43 ` [PATCH 1/2] nvmet: open code nvmet_get_feat_async_event() Chaitanya Kulkarni
  2022-03-09 17:43 ` [PATCH 2/2] nvmet: open code nvmet_get_feat_kato() Chaitanya Kulkarni
@ 2022-03-14  7:42 ` Christoph Hellwig
  2022-03-14 23:00   ` Chaitanya Kulkarni
  2022-03-14 23:05   ` Chaitanya Kulkarni
  2 siblings, 2 replies; 7+ messages in thread
From: Christoph Hellwig @ 2022-03-14  7:42 UTC (permalink / raw)
  To: Chaitanya Kulkarni; +Cc: linux-nvme, hch, sagi

Thanks,

applied to nvme-5.18.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/2] nvmet: nvme_excute_get_feat() cleanup
  2022-03-14  7:42 ` [PATCH 0/2] nvmet: nvme_excute_get_feat() cleanup Christoph Hellwig
@ 2022-03-14 23:00   ` Chaitanya Kulkarni
  2022-03-15  6:30     ` Christoph Hellwig
  2022-03-14 23:05   ` Chaitanya Kulkarni
  1 sibling, 1 reply; 7+ messages in thread
From: Chaitanya Kulkarni @ 2022-03-14 23:00 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: linux-nvme, sagi

On 3/14/22 00:42, Christoph Hellwig wrote:
> Thanks,
> 
> applied to nvme-5.18.
> 

When I pulled the changes today it didn't show this patch-series,
git HEAD is pointing to

"nvmet: use snprintf() with PAGE_SIZE in configfs" :-

nvme (nvme-5.18) # gitpulltheirs
warning: Pulling without specifying how to reconcile divergent branches is
discouraged. You can squelch this message by running one of the following
commands sometime before your next pull:

   git config pull.rebase false  # merge (the default strategy)
   git config pull.rebase true   # rebase
   git config pull.ff only       # fast-forward only

You can replace "git config" with "git config --global" to set a default
preference for all repositories. You can also pass --rebase, --no-rebase,
or --ff-only on the command line to override the configured default per
invocation.

Already up to date.
nvme (nvme-5.18) # gitlog -3
1720007a91d9 (HEAD -> nvme-5.18) Merge branch 'nvme-5.18' of 
git://git.infradead.org/nvme into nvme-5.18
98152eb70fff (origin/nvme-5.18) nvmet: use snprintf() with PAGE_SIZE in 
configfs
73d77c53ff34 nvmet: don't fold lines
nvme (nvme-5.18) # git log -3
commit 1720007a91d9146d537da662e3ce53e656b4850a (HEAD -> nvme-5.18)
Merge: ec7daf016113 98152eb70fff
Author: Chaitanya Kulkarni <kch@nvidia.com>
Date:   Mon Mar 14 15:51:27 2022 -0700

     Merge branch 'nvme-5.18' of git://git.infradead.org/nvme into nvme-5.18

commit 98152eb70fffad910ee7c511b110afe98f162fc5 (origin/nvme-5.18)
Author: Chaitanya Kulkarni <kch@nvidia.com>
Date:   Tue Mar 8 14:56:58 2022 -0800

     nvmet: use snprintf() with PAGE_SIZE in configfs

     Instead of using sprintf, use snprintf with buffer size limited to
     PAGE_SIZE just like what we have for the rest of the file.

     Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
     Signed-off-by: Christoph Hellwig <hch@lst.de>

commit 73d77c53ff342bfa23daedf4475cdd06618e447b
Author: Chaitanya Kulkarni <kch@nvidia.com>
Date:   Tue Mar 8 14:56:57 2022 -0800

     nvmet: don't fold lines

     Don't fold line that can fit into 80 char limit. No functional change
     in this patch.

     Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
     Signed-off-by: Christoph Hellwig <hch@lst.de>
nvme (nvme-5.18) #


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/2] nvmet: nvme_excute_get_feat() cleanup
  2022-03-14  7:42 ` [PATCH 0/2] nvmet: nvme_excute_get_feat() cleanup Christoph Hellwig
  2022-03-14 23:00   ` Chaitanya Kulkarni
@ 2022-03-14 23:05   ` Chaitanya Kulkarni
  1 sibling, 0 replies; 7+ messages in thread
From: Chaitanya Kulkarni @ 2022-03-14 23:05 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: linux-nvme, sagi

Christoph,

On 3/14/22 00:42, Christoph Hellwig wrote:
> Thanks,
> 
> applied to nvme-5.18.
> 

Please revert this series I've made a mistake when sending this series
that is breaking the build, will send out a right one later.

Sorry for the inconvenience.

-ck



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/2] nvmet: nvme_excute_get_feat() cleanup
  2022-03-14 23:00   ` Chaitanya Kulkarni
@ 2022-03-15  6:30     ` Christoph Hellwig
  0 siblings, 0 replies; 7+ messages in thread
From: Christoph Hellwig @ 2022-03-15  6:30 UTC (permalink / raw)
  To: Chaitanya Kulkarni; +Cc: Christoph Hellwig, linux-nvme, sagi

I had to drop it again as it caused compile failures.  These helpers
are also used in discovery.c.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-03-15  6:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-09 17:43 [PATCH 0/2] nvmet: nvme_excute_get_feat() cleanup Chaitanya Kulkarni
2022-03-09 17:43 ` [PATCH 1/2] nvmet: open code nvmet_get_feat_async_event() Chaitanya Kulkarni
2022-03-09 17:43 ` [PATCH 2/2] nvmet: open code nvmet_get_feat_kato() Chaitanya Kulkarni
2022-03-14  7:42 ` [PATCH 0/2] nvmet: nvme_excute_get_feat() cleanup Christoph Hellwig
2022-03-14 23:00   ` Chaitanya Kulkarni
2022-03-15  6:30     ` Christoph Hellwig
2022-03-14 23:05   ` Chaitanya Kulkarni

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.