platform-driver-x86.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: "Limonciello, Mario" <Mario.Limonciello@dell.com>,
	Divya Bharathi <divya27392@gmail.com>,
	"dvhart@infradead.org" <dvhart@infradead.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	"platform-driver-x86@vger.kernel.org" 
	<platform-driver-x86@vger.kernel.org>,
	"Bharathi, Divya" <Divya.Bharathi@Dell.com>,
	Andy Shevchenko <andy.shevchenko@gmail.com>,
	mark gross <mgross@linux.intel.com>,
	"Ksr, Prasanth" <Prasanth.Ksr@dell.com>
Subject: Re: [PATCH v6] Introduce support for Systems Management Driver over WMI for Dell Systems
Date: Mon, 26 Oct 2020 16:41:44 +0100	[thread overview]
Message-ID: <7f40bc72-83cc-c265-ac46-9543f74d228a@redhat.com> (raw)
In-Reply-To: <DM6PR19MB26367BCFE51C45BC00D13F6BFA190@DM6PR19MB2636.namprd19.prod.outlook.com>

Hi,

On 10/26/20 4:39 PM, Limonciello, Mario wrote:
>> This was present in previous versions too, but I just noticed this are you
>> sure that using
>> .string.pointer is correct here? That seems wrong since the pointer gets
>> allocated by
>> the Linux ACPI core, so it is not under influence of the AML code?
>>
>> I think you want / need to use ".integer.value" here ?
>>
>> And maybe first do a type check, e.g.:
>>
>> 	if (obj->package.elements[CURRENT_VAL].type != ACPI_TYPE_INTEGER) {
>> 		ret = -EINVAL;
>> 		goto out;
>> 	}
>>
>> Adding this type check will also show if I'm right that you should use
>> .integer.value ...
>>
>> 	ret = snprintf(buf, PAGE_SIZE, "%lld\n", obj-
> 
> We'll need to double check this, but I'm pretty sure the firmware outputs
> everything as a string.

Ok, in that case it should probably be printed as a "%s" though and not interpret
the buffer-address which the kernel allocated for storing the string as an
integer.

And it would still be good to do the type-check for this, but then checking
for a type of ACPI_TYPE_STRING.

Regards,

Hans


      reply	other threads:[~2020-10-26 15:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-06  8:26 [PATCH v6] Introduce support for Systems Management Driver over WMI for Dell Systems Divya Bharathi
2020-10-26 14:37 ` Hans de Goede
2020-10-26 15:25   ` Limonciello, Mario
2020-10-26 15:36     ` Hans de Goede
2020-10-26 15:39   ` Limonciello, Mario
2020-10-26 15:41     ` Hans de Goede [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7f40bc72-83cc-c265-ac46-9543f74d228a@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=Divya.Bharathi@Dell.com \
    --cc=Mario.Limonciello@dell.com \
    --cc=Prasanth.Ksr@dell.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=divya27392@gmail.com \
    --cc=dvhart@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgross@linux.intel.com \
    --cc=platform-driver-x86@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).