Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvmet: fix the error of point math issue
@ 2024-11-11 10:40 Guixin Liu
  2024-11-11 10:48 ` Dan Carpenter
  2024-11-11 17:54 ` Keith Busch
  0 siblings, 2 replies; 5+ messages in thread
From: Guixin Liu @ 2024-11-11 10:40 UTC (permalink / raw)
  To: Keith Busch, Jens Axboe, Christoph Hellwig, Sagi Grimberg,
	Chaitanya Kulkarni, Dan Carpenter
  Cc: linux-nvme, oe-kbuild-all

Fix the wrong place of parenthesis of ctrl_eds and data point in
nvmet_execute_pr_report(), switch to "void *" first and then do
the addtion.

Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
---
 drivers/nvme/target/pr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/nvme/target/pr.c b/drivers/nvme/target/pr.c
index bef82135a0e7..550effcfb9ad 100644
--- a/drivers/nvme/target/pr.c
+++ b/drivers/nvme/target/pr.c
@@ -848,8 +848,8 @@ static void nvmet_execute_pr_report(struct nvmet_req *req)
 		/*
 		 * continue to get the number of all registrans.
 		 */
-		if ((void *)(ctrl_eds + sizeof(*ctrl_eds)) >
-			(void *)(data + num_bytes))
+		if (((void *)ctrl_eds + sizeof(*ctrl_eds)) >
+		    ((void *)data + num_bytes))
 			continue;
 		/*
 		 * Dynamic controller, set cntlid to 0xffff.
-- 
2.43.0



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

* Re: [PATCH] nvmet: fix the error of point math issue
  2024-11-11 10:40 [PATCH] nvmet: fix the error of point math issue Guixin Liu
@ 2024-11-11 10:48 ` Dan Carpenter
  2024-11-11 11:35   ` Christoph Hellwig
  2024-11-11 17:54 ` Keith Busch
  1 sibling, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2024-11-11 10:48 UTC (permalink / raw)
  To: Guixin Liu
  Cc: Keith Busch, Jens Axboe, Christoph Hellwig, Sagi Grimberg,
	Chaitanya Kulkarni, linux-nvme, oe-kbuild-all

On Mon, Nov 11, 2024 at 06:40:35PM +0800, Guixin Liu wrote:
> Fix the wrong place of parenthesis of ctrl_eds and data point in
> nvmet_execute_pr_report(), switch to "void *" first and then do
> the addtion.
> 
> Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>

This needs a Fixes tag so that the stable tools know not to apply it to old
kernels.

regards,
dan carpenter



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

* Re: [PATCH] nvmet: fix the error of point math issue
  2024-11-11 10:48 ` Dan Carpenter
@ 2024-11-11 11:35   ` Christoph Hellwig
  0 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2024-11-11 11:35 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Guixin Liu, Keith Busch, Jens Axboe, Christoph Hellwig,
	Sagi Grimberg, Chaitanya Kulkarni, linux-nvme, oe-kbuild-all

On Mon, Nov 11, 2024 at 01:48:57PM +0300, Dan Carpenter wrote:
> On Mon, Nov 11, 2024 at 06:40:35PM +0800, Guixin Liu wrote:
> > Fix the wrong place of parenthesis of ctrl_eds and data point in
> > nvmet_execute_pr_report(), switch to "void *" first and then do
> > the addtion.
> > 
> > Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
> 
> This needs a Fixes tag so that the stable tools know not to apply it to old
> kernels.

We might still be able to fold it in as it's near the top of the
nvme tree not send upstream yet.


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

* Re: [PATCH] nvmet: fix the error of point math issue
  2024-11-11 10:40 [PATCH] nvmet: fix the error of point math issue Guixin Liu
  2024-11-11 10:48 ` Dan Carpenter
@ 2024-11-11 17:54 ` Keith Busch
  2024-11-12  1:32   ` Guixin Liu
  1 sibling, 1 reply; 5+ messages in thread
From: Keith Busch @ 2024-11-11 17:54 UTC (permalink / raw)
  To: Guixin Liu
  Cc: Jens Axboe, Christoph Hellwig, Sagi Grimberg, Chaitanya Kulkarni,
	Dan Carpenter, linux-nvme, oe-kbuild-all

On Mon, Nov 11, 2024 at 06:40:35PM +0800, Guixin Liu wrote:
> Fix the wrong place of parenthesis of ctrl_eds and data point in
> nvmet_execute_pr_report(), switch to "void *" first and then do
> the addtion.

Thanks, I folded this inot the original commit.


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

* Re: [PATCH] nvmet: fix the error of point math issue
  2024-11-11 17:54 ` Keith Busch
@ 2024-11-12  1:32   ` Guixin Liu
  0 siblings, 0 replies; 5+ messages in thread
From: Guixin Liu @ 2024-11-12  1:32 UTC (permalink / raw)
  To: Keith Busch
  Cc: Jens Axboe, Christoph Hellwig, Sagi Grimberg, Chaitanya Kulkarni,
	Dan Carpenter, linux-nvme, oe-kbuild-all


在 2024/11/12 01:54, Keith Busch 写道:
> On Mon, Nov 11, 2024 at 06:40:35PM +0800, Guixin Liu wrote:
>> Fix the wrong place of parenthesis of ctrl_eds and data point in
>> nvmet_execute_pr_report(), switch to "void *" first and then do
>> the addtion.
> Thanks, I folded this inot the original commit.

Thanks to fold that.

Best Regards,

Guixin Liu



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

end of thread, other threads:[~2024-11-12  1:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-11 10:40 [PATCH] nvmet: fix the error of point math issue Guixin Liu
2024-11-11 10:48 ` Dan Carpenter
2024-11-11 11:35   ` Christoph Hellwig
2024-11-11 17:54 ` Keith Busch
2024-11-12  1:32   ` Guixin Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox