linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 4.14 v2 ] platform/x86: Corrects warning: missing braces around initializer
@ 2020-10-30 15:55 john.p.donnelly
  2020-10-30 16:52 ` Andy Shevchenko
  0 siblings, 1 reply; 4+ messages in thread
From: john.p.donnelly @ 2020-10-30 15:55 UTC (permalink / raw)
  To: linux-kernel; +Cc: trix, andriy.shevchenko

From: John Donnelly <john.p.donnelly@oracle.com>

The assignment statement of a local variable "struct tp_nvram_state s[2] = {0};
is not valid for all versions of compilers.

Fixes: 515ded02bc4b ("platform/x86: thinkpad_acpi: initialize tp_nvram_state variable")

Signed-off-by: John Donnelly <john.p.donnelly@oracle.com>
---
 drivers/platform/x86/thinkpad_acpi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index ffaaccded34e..c41ac0385304 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -2477,7 +2477,7 @@ static void hotkey_compare_and_issue_event(struct tp_nvram_state *oldn,
  */
 static int hotkey_kthread(void *data)
 {
-	struct tp_nvram_state s[2] = { 0 };
+	struct tp_nvram_state s[2];
 	u32 poll_mask, event_mask;
 	unsigned int si, so;
 	unsigned long t;
@@ -2488,6 +2488,8 @@ static int hotkey_kthread(void *data)
 	if (tpacpi_lifecycle == TPACPI_LIFE_EXITING)
 		goto exit;
 
+	memset(&s, 0, sizeof(s));
+
 	set_freezable();
 
 	so = 0;
-- 
2.27.0


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

* Re: [PATCH 4.14 v2 ] platform/x86: Corrects warning: missing braces around initializer
  2020-10-30 15:55 [PATCH 4.14 v2 ] platform/x86: Corrects warning: missing braces around initializer john.p.donnelly
@ 2020-10-30 16:52 ` Andy Shevchenko
  2020-10-30 17:18   ` John Donnelly
  0 siblings, 1 reply; 4+ messages in thread
From: Andy Shevchenko @ 2020-10-30 16:52 UTC (permalink / raw)
  To: john.p.donnelly; +Cc: linux-kernel, trix

On Fri, Oct 30, 2020 at 08:55:01AM -0700, john.p.donnelly@oracle.com wrote:
> From: John Donnelly <john.p.donnelly@oracle.com>
> 
> The assignment statement of a local variable "struct tp_nvram_state s[2] = {0};
> is not valid for all versions of compilers.

I don't get the subject. IS it backport of existing change to v4.14, or you are
trying to fix v4.14? If the latter is the case, it's not correct order. Try
latest vanilla first (v5.10-rc1 as of today) and if there is still an issue,
submit a patch.

> Fixes: 515ded02bc4b ("platform/x86: thinkpad_acpi: initialize tp_nvram_state variable")
> 
> Signed-off-by: John Donnelly <john.p.donnelly@oracle.com>

Should not be blank line in between.

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH 4.14 v2 ] platform/x86: Corrects warning: missing braces around initializer
  2020-10-30 16:52 ` Andy Shevchenko
@ 2020-10-30 17:18   ` John Donnelly
  2020-10-30 17:42     ` Andy Shevchenko
  0 siblings, 1 reply; 4+ messages in thread
From: John Donnelly @ 2020-10-30 17:18 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: linux-kernel, trix



> On Oct 30, 2020, at 11:52 AM, Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
> 
> On Fri, Oct 30, 2020 at 08:55:01AM -0700, john.p.donnelly@oracle.com wrote:
>> From: John Donnelly <john.p.donnelly@oracle.com>
>> 
>> The assignment statement of a local variable "struct tp_nvram_state s[2] = {0};
>> is not valid for all versions of compilers.
> 
> I don't get the subject. IS it backport of existing change to v4.14, or you are
> trying to fix v4.14? If the latter is the case, it's not correct order. Try
> latest vanilla first (v5.10-rc1 as of today) and if there is still an issue,
> submit a patch.

Hi,

 It is only intended for 4.14. Why would you back port  a commit  to a stable tree that emits warnings ?




> 
>> Fixes: 515ded02bc4b ("platform/x86: thinkpad_acpi: initialize tp_nvram_state variable")
>> 
>> Signed-off-by: John Donnelly <john.p.donnelly@oracle.com>
> 
> Should not be blank line in between.
> 
> -- 
> With Best Regards,
> Andy Shevchenko
> 
> 


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

* Re: [PATCH 4.14 v2 ] platform/x86: Corrects warning: missing braces around initializer
  2020-10-30 17:18   ` John Donnelly
@ 2020-10-30 17:42     ` Andy Shevchenko
  0 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2020-10-30 17:42 UTC (permalink / raw)
  To: John Donnelly; +Cc: linux-kernel, trix

On Fri, Oct 30, 2020 at 12:18:44PM -0500, John Donnelly wrote:
> > On Oct 30, 2020, at 11:52 AM, Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
> > 
> > On Fri, Oct 30, 2020 at 08:55:01AM -0700, john.p.donnelly@oracle.com wrote:
> >> From: John Donnelly <john.p.donnelly@oracle.com>
> >> 
> >> The assignment statement of a local variable "struct tp_nvram_state s[2] = {0};
> >> is not valid for all versions of compilers.
> > 
> > I don't get the subject. IS it backport of existing change to v4.14, or you are
> > trying to fix v4.14? If the latter is the case, it's not correct order. Try
> > latest vanilla first (v5.10-rc1 as of today) and if there is still an issue,
> > submit a patch.
> 
> Hi,
> 
>  It is only intended for 4.14. Why would you back port  a commit  to a stable tree that emits warnings ?

So, if this is for stable, what is the current commit in the kernel of this?

> >> Fixes: 515ded02bc4b ("platform/x86: thinkpad_acpi: initialize tp_nvram_state variable")
> >> 
> >> Signed-off-by: John Donnelly <john.p.donnelly@oracle.com>
> > 
> > Should not be blank line in between.

-- 
With Best Regards,
Andy Shevchenko



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

end of thread, other threads:[~2020-10-30 17:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-30 15:55 [PATCH 4.14 v2 ] platform/x86: Corrects warning: missing braces around initializer john.p.donnelly
2020-10-30 16:52 ` Andy Shevchenko
2020-10-30 17:18   ` John Donnelly
2020-10-30 17:42     ` Andy Shevchenko

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).