diff mbox series

mtd: mtdoops: Fix kmsgdump parameter renaming.

Message ID 20240719152542.1554440-1-jfalempe@redhat.com
State New
Headers show
Series mtd: mtdoops: Fix kmsgdump parameter renaming. | expand

Commit Message

Jocelyn Falempe July 19, 2024, 3:24 p.m. UTC
When the kmsg_dumper callback parameter changed, the reason variable
in mtdoops_do_dump() was not updated accordingly.
This breaks the build with mtdoops.

Fixes: e1a261ba599e ("printk: Add a short description string to kmsg_dump()")
Reported-by: Knop Ryszard <ryszard.knop@intel.com>
Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
---

The offended commit is in the drm-misc tree, because it was needed
by drm_panic. So I will push the fix there too.

 drivers/mtd/mtdoops.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


base-commit: 26dbffb2a4c4d4639c7b336f6b74a437c23dadd4

Comments

Richard Weinberger July 22, 2024, 3:21 p.m. UTC | #1
----- Ursprüngliche Mail -----
> Betreff: [PATCH] mtd: mtdoops: Fix kmsgdump parameter renaming.

> When the kmsg_dumper callback parameter changed, the reason variable
> in mtdoops_do_dump() was not updated accordingly.
> This breaks the build with mtdoops.
> 
> Fixes: e1a261ba599e ("printk: Add a short description string to kmsg_dump()")
> Reported-by: Knop Ryszard <ryszard.knop@intel.com>
> Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
> ---
> 
> The offended commit is in the drm-misc tree, because it was needed
> by drm_panic. So I will push the fix there too.
> 
> drivers/mtd/mtdoops.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mtd/mtdoops.c b/drivers/mtd/mtdoops.c
> index 86d49db9196d..7bf3777e1f13 100644
> --- a/drivers/mtd/mtdoops.c
> +++ b/drivers/mtd/mtdoops.c
> @@ -305,7 +305,7 @@ static void mtdoops_do_dump(struct kmsg_dumper *dumper,
> 	struct kmsg_dump_iter iter;
> 
> 	/* Only dump oopses if dump_oops is set */
> -	if (reason == KMSG_DUMP_OOPS && !dump_oops)
> +	if (detail->reason == KMSG_DUMP_OOPS && !dump_oops)
> 		return;
> 
> 	kmsg_dump_rewind(&iter);
> @@ -317,7 +317,7 @@ static void mtdoops_do_dump(struct kmsg_dumper *dumper,
> 			     record_size - sizeof(struct mtdoops_hdr), NULL);
> 	clear_bit(0, &cxt->oops_buf_busy);
> 
> -	if (reason != KMSG_DUMP_OOPS) {
> +	if (detail->reason != KMSG_DUMP_OOPS) {

Acked-by: Richard Weinberger <richard@nod.at>

Thanks,
//richard
Jocelyn Falempe July 22, 2024, 4:33 p.m. UTC | #2
On 22/07/2024 17:21, Richard Weinberger wrote:
> ----- Ursprüngliche Mail -----
>> Betreff: [PATCH] mtd: mtdoops: Fix kmsgdump parameter renaming.
> 
>> When the kmsg_dumper callback parameter changed, the reason variable
>> in mtdoops_do_dump() was not updated accordingly.
>> This breaks the build with mtdoops.
>>
>> Fixes: e1a261ba599e ("printk: Add a short description string to kmsg_dump()")
>> Reported-by: Knop Ryszard <ryszard.knop@intel.com>
>> Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
>> ---
>>
>> The offended commit is in the drm-misc tree, because it was needed
>> by drm_panic. So I will push the fix there too.
>>
>> drivers/mtd/mtdoops.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/mtd/mtdoops.c b/drivers/mtd/mtdoops.c
>> index 86d49db9196d..7bf3777e1f13 100644
>> --- a/drivers/mtd/mtdoops.c
>> +++ b/drivers/mtd/mtdoops.c
>> @@ -305,7 +305,7 @@ static void mtdoops_do_dump(struct kmsg_dumper *dumper,
>> 	struct kmsg_dump_iter iter;
>>
>> 	/* Only dump oopses if dump_oops is set */
>> -	if (reason == KMSG_DUMP_OOPS && !dump_oops)
>> +	if (detail->reason == KMSG_DUMP_OOPS && !dump_oops)
>> 		return;
>>
>> 	kmsg_dump_rewind(&iter);
>> @@ -317,7 +317,7 @@ static void mtdoops_do_dump(struct kmsg_dumper *dumper,
>> 			     record_size - sizeof(struct mtdoops_hdr), NULL);
>> 	clear_bit(0, &cxt->oops_buf_busy);
>>
>> -	if (reason != KMSG_DUMP_OOPS) {
>> +	if (detail->reason != KMSG_DUMP_OOPS) {
> 
> Acked-by: Richard Weinberger <richard@nod.at>

I pushed it to drm-misc-next.

Thanks a lot.

> 
> Thanks,
> //richard
>
diff mbox series

Patch

diff --git a/drivers/mtd/mtdoops.c b/drivers/mtd/mtdoops.c
index 86d49db9196d..7bf3777e1f13 100644
--- a/drivers/mtd/mtdoops.c
+++ b/drivers/mtd/mtdoops.c
@@ -305,7 +305,7 @@  static void mtdoops_do_dump(struct kmsg_dumper *dumper,
 	struct kmsg_dump_iter iter;
 
 	/* Only dump oopses if dump_oops is set */
-	if (reason == KMSG_DUMP_OOPS && !dump_oops)
+	if (detail->reason == KMSG_DUMP_OOPS && !dump_oops)
 		return;
 
 	kmsg_dump_rewind(&iter);
@@ -317,7 +317,7 @@  static void mtdoops_do_dump(struct kmsg_dumper *dumper,
 			     record_size - sizeof(struct mtdoops_hdr), NULL);
 	clear_bit(0, &cxt->oops_buf_busy);
 
-	if (reason != KMSG_DUMP_OOPS) {
+	if (detail->reason != KMSG_DUMP_OOPS) {
 		/* Panics must be written immediately */
 		mtdoops_write(cxt, 1);
 	} else {