* [PATCH v3 4/6] drivers: hv: vmbus: Fix checkpatch SPLIT_STRING
@ 2020-11-25 3:29 Matheus Castello
2020-11-29 16:51 ` Michael Kelley
0 siblings, 1 reply; 4+ messages in thread
From: Matheus Castello @ 2020-11-25 3:29 UTC (permalink / raw)
To: mikelley, wei.liu, joe
Cc: kys, haiyangz, sthemmin, sashal, Tianyu.Lan, decui, sunilmut,
linux-hyperv, linux-kernel, Matheus Castello
Checkpatch emits WARNING: quoted string split across lines.
To keep the code clean and with the 80 column length indentation the
check and registration code for kmsg_dump_register has been transferred
to a new function hv_kmsg_dump_register.
Signed-off-by: Matheus Castello <matheus@castello.eng.br>
---
This is the V3 of patch 4 of the series "Add improvements suggested by
checkpatch for vmbus_drv" with the changes suggested by Michael Kelley and
Joe Perches. Thanks!
---
drivers/hv/vmbus_drv.c | 35 ++++++++++++++++++++---------------
1 file changed, 20 insertions(+), 15 deletions(-)
diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index 61d28c743263..edcc419ba328 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -1387,6 +1387,24 @@ static struct kmsg_dumper hv_kmsg_dumper = {
.dump = hv_kmsg_dump,
};
+static void hv_kmsg_dump_register(void)
+{
+ int ret;
+
+ hv_panic_page = (void *)hv_alloc_hyperv_zeroed_page();
+ if (!hv_panic_page) {
+ pr_err("Hyper-V: panic message page memory allocation failed\n");
+ return;
+ }
+
+ ret = kmsg_dump_register(&hv_kmsg_dumper);
+ if (ret) {
+ pr_err("Hyper-V: kmsg dump register error 0x%x\n", ret);
+ hv_free_hyperv_page((unsigned long)hv_panic_page);
+ hv_panic_page = NULL;
+ }
+}
+
static struct ctl_table_header *hv_ctl_table_hdr;
/*
@@ -1477,21 +1495,8 @@ static int vmbus_bus_init(void)
* capability is supported by the hypervisor.
*/
hv_get_crash_ctl(hyperv_crash_ctl);
- if (hyperv_crash_ctl & HV_CRASH_CTL_CRASH_NOTIFY_MSG) {
- hv_panic_page = (void *)hv_alloc_hyperv_zeroed_page();
- if (hv_panic_page) {
- ret = kmsg_dump_register(&hv_kmsg_dumper);
- if (ret) {
- pr_err("Hyper-V: kmsg dump register "
- "error 0x%x\n", ret);
- hv_free_hyperv_page(
- (unsigned long)hv_panic_page);
- hv_panic_page = NULL;
- }
- } else
- pr_err("Hyper-V: panic message page memory "
- "allocation failed");
- }
+ if (hyperv_crash_ctl & HV_CRASH_CTL_CRASH_NOTIFY_MSG)
+ hv_kmsg_dump_register();
register_die_notifier(&hyperv_die_block);
}
--
2.29.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* RE: [PATCH v3 4/6] drivers: hv: vmbus: Fix checkpatch SPLIT_STRING
2020-11-25 3:29 [PATCH v3 4/6] drivers: hv: vmbus: Fix checkpatch SPLIT_STRING Matheus Castello
@ 2020-11-29 16:51 ` Michael Kelley
2020-11-30 5:43 ` Stephen Hemminger
0 siblings, 1 reply; 4+ messages in thread
From: Michael Kelley @ 2020-11-29 16:51 UTC (permalink / raw)
To: Matheus Castello, wei.liu@kernel.org, joe@perches.com
Cc: KY Srinivasan, Haiyang Zhang, Stephen Hemminger,
sashal@kernel.org, Tianyu Lan, Dexuan Cui, Sunil Muthuswamy,
linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org
From: Matheus Castello <matheus@castello.eng.br> Sent: Tuesday, November 24, 2020 7:29 PM
>
> Checkpatch emits WARNING: quoted string split across lines.
> To keep the code clean and with the 80 column length indentation the
> check and registration code for kmsg_dump_register has been transferred
> to a new function hv_kmsg_dump_register.
>
> Signed-off-by: Matheus Castello <matheus@castello.eng.br>
> ---
> This is the V3 of patch 4 of the series "Add improvements suggested by
> checkpatch for vmbus_drv" with the changes suggested by Michael Kelley and
> Joe Perches. Thanks!
> ---
> drivers/hv/vmbus_drv.c | 35 ++++++++++++++++++++---------------
> 1 file changed, 20 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
> index 61d28c743263..edcc419ba328 100644
> --- a/drivers/hv/vmbus_drv.c
> +++ b/drivers/hv/vmbus_drv.c
> @@ -1387,6 +1387,24 @@ static struct kmsg_dumper hv_kmsg_dumper = {
> .dump = hv_kmsg_dump,
> };
>
> +static void hv_kmsg_dump_register(void)
> +{
> + int ret;
> +
> + hv_panic_page = (void *)hv_alloc_hyperv_zeroed_page();
> + if (!hv_panic_page) {
> + pr_err("Hyper-V: panic message page memory allocation failed\n");
> + return;
> + }
> +
> + ret = kmsg_dump_register(&hv_kmsg_dumper);
> + if (ret) {
> + pr_err("Hyper-V: kmsg dump register error 0x%x\n", ret);
> + hv_free_hyperv_page((unsigned long)hv_panic_page);
> + hv_panic_page = NULL;
> + }
> +}
> +
> static struct ctl_table_header *hv_ctl_table_hdr;
>
> /*
> @@ -1477,21 +1495,8 @@ static int vmbus_bus_init(void)
> * capability is supported by the hypervisor.
> */
> hv_get_crash_ctl(hyperv_crash_ctl);
> - if (hyperv_crash_ctl & HV_CRASH_CTL_CRASH_NOTIFY_MSG) {
> - hv_panic_page = (void *)hv_alloc_hyperv_zeroed_page();
> - if (hv_panic_page) {
> - ret = kmsg_dump_register(&hv_kmsg_dumper);
> - if (ret) {
> - pr_err("Hyper-V: kmsg dump register "
> - "error 0x%x\n", ret);
> - hv_free_hyperv_page(
> - (unsigned long)hv_panic_page);
> - hv_panic_page = NULL;
> - }
> - } else
> - pr_err("Hyper-V: panic message page memory "
> - "allocation failed");
> - }
> + if (hyperv_crash_ctl & HV_CRASH_CTL_CRASH_NOTIFY_MSG)
> + hv_kmsg_dump_register();
>
> register_die_notifier(&hyperv_die_block);
> }
> --
> 2.29.2
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v3 4/6] drivers: hv: vmbus: Fix checkpatch SPLIT_STRING
2020-11-29 16:51 ` Michael Kelley
@ 2020-11-30 5:43 ` Stephen Hemminger
2020-12-02 11:55 ` Wei Liu
0 siblings, 1 reply; 4+ messages in thread
From: Stephen Hemminger @ 2020-11-30 5:43 UTC (permalink / raw)
To: Michael Kelley
Cc: Matheus Castello, wei.liu, joe, KY Srinivasan, Haiyang Zhang,
Stephen Hemminger, sashal, Tianyu Lan, Dexuan Cui,
Sunil Muthuswamy, linux-hyperv, linux-kernel
On Sun, 29 Nov 2020 08:51:47 -0800
"Michael Kelley" <mikelley@microsoft.com> wrote:
> From: Matheus Castello <matheus@castello.eng.br> Sent: Tuesday, November
> 24, 2020 7:29 PM
> >
> > Checkpatch emits WARNING: quoted string split across lines.
> > To keep the code clean and with the 80 column length indentation the
> > check and registration code for kmsg_dump_register has been transferred
> > to a new function hv_kmsg_dump_register.
> >
> > Signed-off-by: Matheus Castello <matheus@castello.eng.br>
> > ---
> > This is the V3 of patch 4 of the series "Add improvements suggested by
> > checkpatch for vmbus_drv" with the changes suggested by Michael Kelley
> and
> > Joe Perches. Thanks!
> > ---
> > drivers/hv/vmbus_drv.c | 35 ++++++++++++++++++++---------------
> > 1 file changed, 20 insertions(+), 15 deletions(-)
> >
> > diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
> > index 61d28c743263..edcc419ba328 100644
> > --- a/drivers/hv/vmbus_drv.c
> > +++ b/drivers/hv/vmbus_drv.c
> > @@ -1387,6 +1387,24 @@ static struct kmsg_dumper hv_kmsg_dumper = {
> > .dump = hv_kmsg_dump,
> > };
> >
> > +static void hv_kmsg_dump_register(void)
> > +{
> > + int ret;
> > +
> > + hv_panic_page = (void *)hv_alloc_hyperv_zeroed_page();
I know you just copy/pasted the original code, but one other thing.
Doesn't it already return void *?
arch/x86/include/asm/mshyperv.h:void *hv_alloc_hyperv_zeroed_page(void);
> > + if (!hv_panic_page) {
> > + pr_err("Hyper-V: panic message page memory allocation
> failed\n");
> > + return;
> > + }
> > +
> > + ret = kmsg_dump_register(&hv_kmsg_dumper);
> > + if (ret) {
> > + pr_err("Hyper-V: kmsg dump register error 0x%x\n", ret);
> > + hv_free_hyperv_page((unsigned long)hv_panic_page);
> > + hv_panic_page = NULL;
> > + }
> > +}
> > +
> > static struct ctl_table_header *hv_ctl_table_hdr;
> >
> > /*
> > @@ -1477,21 +1495,8 @@ static int vmbus_bus_init(void)
> > * capability is supported by the hypervisor.
> > */
> > hv_get_crash_ctl(hyperv_crash_ctl);
> > - if (hyperv_crash_ctl & HV_CRASH_CTL_CRASH_NOTIFY_MSG) {
> > - hv_panic_page = (void
> *)hv_alloc_hyperv_zeroed_page();
> > - if (hv_panic_page) {
> > - ret = kmsg_dump_register(&hv_kmsg_dumper);
> > - if (ret) {
> > - pr_err("Hyper-V: kmsg dump
> register "
> > - "error 0x%x\n", ret);
> > - hv_free_hyperv_page(
> > - (unsigned long)hv_panic_page);
> > - hv_panic_page = NULL;
> > - }
> > - } else
> > - pr_err("Hyper-V: panic message page memory
> "
> > - "allocation failed");
> > - }
> > + if (hyperv_crash_ctl & HV_CRASH_CTL_CRASH_NOTIFY_MSG)
> > + hv_kmsg_dump_register();
> >
> > register_die_notifier(&hyperv_die_block);
> > }
> > --
> > 2.29.2
>
> Reviewed-by: Michael Kelley <mikelley@microsoft.com>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v3 4/6] drivers: hv: vmbus: Fix checkpatch SPLIT_STRING
2020-11-30 5:43 ` Stephen Hemminger
@ 2020-12-02 11:55 ` Wei Liu
0 siblings, 0 replies; 4+ messages in thread
From: Wei Liu @ 2020-12-02 11:55 UTC (permalink / raw)
To: Stephen Hemminger
Cc: Michael Kelley, Matheus Castello, wei.liu, joe, KY Srinivasan,
Haiyang Zhang, Stephen Hemminger, sashal, Tianyu Lan, Dexuan Cui,
Sunil Muthuswamy, linux-hyperv, linux-kernel
On Sun, Nov 29, 2020 at 09:43:28PM -0800, Stephen Hemminger wrote:
> On Sun, 29 Nov 2020 08:51:47 -0800
> "Michael Kelley" <mikelley@microsoft.com> wrote:
>
> > From: Matheus Castello <matheus@castello.eng.br> Sent: Tuesday, November
> > 24, 2020 7:29 PM
> > >
> > > Checkpatch emits WARNING: quoted string split across lines.
> > > To keep the code clean and with the 80 column length indentation the
> > > check and registration code for kmsg_dump_register has been transferred
> > > to a new function hv_kmsg_dump_register.
> > >
> > > Signed-off-by: Matheus Castello <matheus@castello.eng.br>
> > > ---
> > > This is the V3 of patch 4 of the series "Add improvements suggested by
> > > checkpatch for vmbus_drv" with the changes suggested by Michael Kelley
> > and
> > > Joe Perches. Thanks!
> > > ---
> > > drivers/hv/vmbus_drv.c | 35 ++++++++++++++++++++---------------
> > > 1 file changed, 20 insertions(+), 15 deletions(-)
> > >
> > > diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
> > > index 61d28c743263..edcc419ba328 100644
> > > --- a/drivers/hv/vmbus_drv.c
> > > +++ b/drivers/hv/vmbus_drv.c
> > > @@ -1387,6 +1387,24 @@ static struct kmsg_dumper hv_kmsg_dumper = {
> > > .dump = hv_kmsg_dump,
> > > };
> > >
> > > +static void hv_kmsg_dump_register(void)
> > > +{
> > > + int ret;
> > > +
> > > + hv_panic_page = (void *)hv_alloc_hyperv_zeroed_page();
>
> I know you just copy/pasted the original code, but one other thing.
>
> Doesn't it already return void *?
> arch/x86/include/asm/mshyperv.h:void *hv_alloc_hyperv_zeroed_page(void);
Good catch.
I have amended this patch and applied it to hyperv-next.
Wei.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-12-02 11:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-25 3:29 [PATCH v3 4/6] drivers: hv: vmbus: Fix checkpatch SPLIT_STRING Matheus Castello
2020-11-29 16:51 ` Michael Kelley
2020-11-30 5:43 ` Stephen Hemminger
2020-12-02 11:55 ` Wei Liu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).