mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Enric Balletbo i Serra <enric.balletbo@collabora.com>
To: Daniel Campello <campello@google.com>
Cc: Bernardo Perez Priego <bernardo.perez.priego@intel.com>,
	Benson Leung <bleung@chromium.org>,
	Nick Crews <ncrews@chromium.org>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] platform/chrome: wilco_ec: Provide correct output format to 'h1_gpio' file
Date: Fri, 27 Mar 2020 18:24:07 +0100	[thread overview]
Message-ID: <252e6ef3-b9f0-edb3-a7d4-be269e08e25f@collabora.com> (raw)
In-Reply-To: <334c8fff-db38-1b99-01d9-b251435ddec1@collabora.com>

Hi Bernardo,

On 24/3/20 14:54, Enric Balletbo i Serra wrote:
> Hi,
> 
> On 23/3/20 21:06, Daniel Campello wrote:
>> Hello,
>>
>> On Tue, Mar 17, 2020 at 1:09 AM Enric Balletbo i Serra
>> <enric.balletbo@collabora.com> wrote:
>>>
>>> Hi,
>>>
>>> On 14/3/20 0:27, Bernardo Perez Priego wrote:
>>>> Function 'h1_gpio_get' is receiving 'val' parameter of type u64,
>>>> this is being passed to 'send_ec_cmd' as type u8, thus, result
>>>> is stored in least significant byte. Due to output format,
>>>> the whole 'val' value was being displayed when any of the most
>>>> significant bytes are different than zero.
>>>>
>>>> This fix will make sure only least significant byte is displayed
>>>> regardless of remaining bytes value.
>>>>
>>>> Signed-off-by: Bernardo Perez Priego <bernardo.perez.priego@intel.com>
>>>
>>> Daniel, could you give a try and give you Tested-by tag if you're fine with it?
>>>
>>> Thanks,
>>>  Enric
>>>
>>>> ---
>>>>  drivers/platform/chrome/wilco_ec/debugfs.c | 2 +-
>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/platform/chrome/wilco_ec/debugfs.c b/drivers/platform/chrome/wilco_ec/debugfs.c
>>>> index df5a5f6c3ec6..c775b7d58c6d 100644
>>>> --- a/drivers/platform/chrome/wilco_ec/debugfs.c
>>>> +++ b/drivers/platform/chrome/wilco_ec/debugfs.c
>>>> @@ -211,7 +211,7 @@ static int h1_gpio_get(void *arg, u64 *val)
>>>>       return send_ec_cmd(arg, SUB_CMD_H1_GPIO, (u8 *)val);
>>>>  }
>>>>
>>>> -DEFINE_DEBUGFS_ATTRIBUTE(fops_h1_gpio, h1_gpio_get, NULL, "0x%02llx\n");
>>>> +DEFINE_DEBUGFS_ATTRIBUTE(fops_h1_gpio, h1_gpio_get, NULL, "0x%02hhx\n");
>>>>
>>>>  /**
>>>>   * test_event_set() - Sends command to EC to cause an EC test event.
>>>>
>>
>> Done. I also found the chromium review for this on crrev.com/c/2090128
>>
>> Tested-by: Daniel Campello <campello@chromium.org>
>>
> 
> Queued for 5.7. Thanks.
> 


I removed the patch from the queue as it triggers the following build warning:

drivers/platform/chrome/wilco_ec/debugfs.c:214:59: warning: format ‘%hhx’
expects argument of type ‘int’, but argument 2 has type ‘long long unsigned int’
[-Wformat=]

Thanks,
Enric

> ~ Enric
> 

  reply	other threads:[~2020-03-27 17:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-13 23:27 Bernardo Perez Priego
2020-03-17  7:09 ` Enric Balletbo i Serra
2020-03-23 20:06   ` Daniel Campello
2020-03-24 13:54     ` Enric Balletbo i Serra
2020-03-27 17:24       ` Enric Balletbo i Serra [this message]
2020-04-02 22:33 ` [PATCH v2] " Bernardo Perez Priego
2020-04-14 13:14   ` Enric Balletbo i Serra

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=252e6ef3-b9f0-edb3-a7d4-be269e08e25f@collabora.com \
    --to=enric.balletbo@collabora.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=bernardo.perez.priego@intel.com \
    --cc=bleung@chromium.org \
    --cc=campello@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ncrews@chromium.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

all inboxes | Powered by JetHome®