Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1661369 > unrolled thread

Re: [PATCH] platform/x86: wmi: Fix printing info about WDG structure

Started byDarren Hart <dvhart@infradead.org>
First post2017-06-08 17:20 +0200
Last post2017-06-09 11:30 +0200
Articles 7 — 4 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] platform/x86: wmi: Fix printing info about WDG structure Darren Hart <dvhart@infradead.org> - 2017-06-08 17:20 +0200
    Re: [PATCH] platform/x86: wmi: Fix printing info about WDG structure Joe Perches <joe@perches.com> - 2017-06-08 17:40 +0200
      Re: [PATCH] platform/x86: wmi: Fix printing info about WDG structure Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-06-08 19:50 +0200
        Re: [PATCH] platform/x86: wmi: Fix printing info about WDG structure Pali Rohár <pali.rohar@gmail.com> - 2017-06-08 20:20 +0200
      Re: [PATCH] platform/x86: wmi: Fix printing info about WDG structure Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-06-08 19:50 +0200
    Re: [PATCH] platform/x86: wmi: Fix printing info about WDG structure Pali Rohár <pali.rohar@gmail.com> - 2017-06-09 10:30 +0200
      Re: [PATCH] platform/x86: wmi: Fix printing info about WDG structure Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-06-09 11:30 +0200

#1661369 — Re: [PATCH] platform/x86: wmi: Fix printing info about WDG structure

FromDarren Hart <dvhart@infradead.org>
Date2017-06-08 17:20 +0200
SubjectRe: [PATCH] platform/x86: wmi: Fix printing info about WDG structure
Message-ID<tQ7o6-5X8-19@gated-at.bofh.it>
On Sat, May 27, 2017 at 11:49:22PM +0300, Andy Shevchenko wrote:
> On Sat, May 27, 2017 at 11:48 PM, Pali Rohár <pali.rohar@gmail.com> wrote:
> > On Saturday 27 May 2017 15:33:14 Andy Shevchenko wrote:
> >> On Sat, May 27, 2017 at 4:17 PM, Pali Rohár <pali.rohar@gmail.com>
> >> wrote:
> 
> >> Okay, got it. But on your opinion does it make sense to do
> >>
> >> pr_info("\tobject_id: %2pE\n", g->object_id);
> >>
> >> instead?
> >>
> >> For ASCII it will go as is previously, otherwise escaping would be
> >> done.
> >
> > Both is OK for me. Do you want to send a new patch with %2pE?
> 
> To me it looks slightly cleaner.

I don't want to let this one fall through the cracks. Pali, is a new one coming?

-- 
Darren Hart
VMware Open Source Technology Center

[toc] | [next] | [standalone]


#1661395

FromJoe Perches <joe@perches.com>
Date2017-06-08 17:40 +0200
Message-ID<tQ7Hr-63v-3@gated-at.bofh.it>
In reply to#1661369
On Thu, 2017-06-08 at 08:16 -0700, Darren Hart wrote:
> On Sat, May 27, 2017 at 11:49:22PM +0300, Andy Shevchenko wrote:
> > On Sat, May 27, 2017 at 11:48 PM, Pali Rohár <pali.rohar@gmail.com> wrote:
> > > On Saturday 27 May 2017 15:33:14 Andy Shevchenko wrote:
> > > > On Sat, May 27, 2017 at 4:17 PM, Pali Rohár <pali.rohar@gmail.com>
> > > > wrote:
> > > > Okay, got it. But on your opinion does it make sense to do
> > > > 
> > > > pr_info("\tobject_id: %2pE\n", g->object_id);
> > > > 
> > > > instead?
> > > > 
> > > > For ASCII it will go as is previously, otherwise escaping would be
> > > > done.
> > > 
> > > Both is OK for me. Do you want to send a new patch with %2pE?
> > 
> > To me it looks slightly cleaner.
> 
> I don't want to let this one fall through the cracks. Pali, is a new one coming?

Perhaps
	pr_info("\t%*pE\n", (int)sizeof(g->object_id), g->object_id);

[toc] | [prev] | [next] | [standalone]


#1661529

FromAndy Shevchenko <andy.shevchenko@gmail.com>
Date2017-06-08 19:50 +0200
Message-ID<tQ9Jf-7ib-3@gated-at.bofh.it>
In reply to#1661395
On Thu, Jun 8, 2017 at 8:42 PM, Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
> On Thu, Jun 8, 2017 at 6:38 PM, Joe Perches <joe@perches.com> wrote:
>> On Thu, 2017-06-08 at 08:16 -0700, Darren Hart wrote:
>>> On Sat, May 27, 2017 at 11:49:22PM +0300, Andy Shevchenko wrote:
>>> > On Sat, May 27, 2017 at 11:48 PM, Pali Rohár <pali.rohar@gmail.com> wrote:
>>> > > On Saturday 27 May 2017 15:33:14 Andy Shevchenko wrote:

>> Perhaps
>>         pr_info("\t%*pE\n", (int)sizeof(g->object_id), g->object_id);
>
> It will print some noisy characters as far as I understood the initial
> intention.

Ah, sorry, it will work, though sligtly differently. It will take
extra argument from the stack which we can avoid. I don't expect the
size of that growing. Pali?


-- 
With Best Regards,
Andy Shevchenko

[toc] | [prev] | [next] | [standalone]


#1661551

FromPali Rohár <pali.rohar@gmail.com>
Date2017-06-08 20:20 +0200
Message-ID<tQach-7H1-3@gated-at.bofh.it>
In reply to#1661529

[Multipart message — attachments visible in raw view] — view raw

On Thursday 08 June 2017 19:44:39 Andy Shevchenko wrote:
> On Thu, Jun 8, 2017 at 8:42 PM, Andy Shevchenko
> 
> <andy.shevchenko@gmail.com> wrote:
> > On Thu, Jun 8, 2017 at 6:38 PM, Joe Perches <joe@perches.com> wrote:
> >> On Thu, 2017-06-08 at 08:16 -0700, Darren Hart wrote:
> >>> On Sat, May 27, 2017 at 11:49:22PM +0300, Andy Shevchenko wrote:
> >>> > On Sat, May 27, 2017 at 11:48 PM, Pali Rohár
> >>> > <pali.rohar@gmail.com> wrote:
> >>> > > On Saturday 27 May 2017 15:33:14 Andy Shevchenko wrote:
> >> Perhaps
> >> 
> >>         pr_info("\t%*pE\n", (int)sizeof(g->object_id),
> >>         g->object_id);
> > 
> > It will print some noisy characters as far as I understood the
> > initial intention.
> 
> Ah, sorry, it will work, though sligtly differently. It will take
> extra argument from the stack which we can avoid. I don't expect the
> size of that growing. Pali?

ObjectID is always 2 bytes. And it should be printable ASCII (probably 
only [A-Za-z0-9_]) as it is used as ACPI method name.

Size is not going to change.

-- 
Pali Rohár
pali.rohar@gmail.com

[toc] | [prev] | [next] | [standalone]


#1661532

FromAndy Shevchenko <andy.shevchenko@gmail.com>
Date2017-06-08 19:50 +0200
Message-ID<tQ9Jf-7ib-5@gated-at.bofh.it>
In reply to#1661395
On Thu, Jun 8, 2017 at 6:38 PM, Joe Perches <joe@perches.com> wrote:
> On Thu, 2017-06-08 at 08:16 -0700, Darren Hart wrote:
>> On Sat, May 27, 2017 at 11:49:22PM +0300, Andy Shevchenko wrote:
>> > On Sat, May 27, 2017 at 11:48 PM, Pali Rohár <pali.rohar@gmail.com> wrote:
>> > > On Saturday 27 May 2017 15:33:14 Andy Shevchenko wrote:
>> > > > On Sat, May 27, 2017 at 4:17 PM, Pali Rohár <pali.rohar@gmail.com>
>> > > > wrote:
>> > > > Okay, got it. But on your opinion does it make sense to do
>> > > >
>> > > > pr_info("\tobject_id: %2pE\n", g->object_id);
>> > > >
>> > > > instead?
>> > > >
>> > > > For ASCII it will go as is previously, otherwise escaping would be
>> > > > done.
>> > >
>> > > Both is OK for me. Do you want to send a new patch with %2pE?
>> >
>> > To me it looks slightly cleaner.
>>
>> I don't want to let this one fall through the cracks. Pali, is a new one coming?
>
> Perhaps
>         pr_info("\t%*pE\n", (int)sizeof(g->object_id), g->object_id);

It will print some noisy characters as far as I understood the initial
intention.

-- 
With Best Regards,
Andy Shevchenko

[toc] | [prev] | [next] | [standalone]


#1662093

FromPali Rohár <pali.rohar@gmail.com>
Date2017-06-09 10:30 +0200
Message-ID<tQnsS-7B7-31@gated-at.bofh.it>
In reply to#1661369
On Thursday 08 June 2017 08:16:18 Darren Hart wrote:
> On Sat, May 27, 2017 at 11:49:22PM +0300, Andy Shevchenko wrote:
> > On Sat, May 27, 2017 at 11:48 PM, Pali Rohár <pali.rohar@gmail.com> wrote:
> > > On Saturday 27 May 2017 15:33:14 Andy Shevchenko wrote:
> > >> On Sat, May 27, 2017 at 4:17 PM, Pali Rohár <pali.rohar@gmail.com>
> > >> wrote:
> > 
> > >> Okay, got it. But on your opinion does it make sense to do
> > >>
> > >> pr_info("\tobject_id: %2pE\n", g->object_id);
> > >>
> > >> instead?
> > >>
> > >> For ASCII it will go as is previously, otherwise escaping would be
> > >> done.
> > >
> > > Both is OK for me. Do you want to send a new patch with %2pE?
> > 
> > To me it looks slightly cleaner.
> 
> I don't want to let this one fall through the cracks. Pali, is a new one coming?

So.. which modifier to use? Andy already proposed two alternatives and
basically I'm fine all 3 which are in this thread.

-- 
Pali Rohár
pali.rohar@gmail.com

[toc] | [prev] | [next] | [standalone]


#1662174

FromAndy Shevchenko <andy.shevchenko@gmail.com>
Date2017-06-09 11:30 +0200
Message-ID<tQooV-8bH-13@gated-at.bofh.it>
In reply to#1662093
On Fri, Jun 9, 2017 at 11:29 AM, Pali Rohár <pali.rohar@gmail.com> wrote:
> On Thursday 08 June 2017 08:16:18 Darren Hart wrote:
>> On Sat, May 27, 2017 at 11:49:22PM +0300, Andy Shevchenko wrote:
>> > On Sat, May 27, 2017 at 11:48 PM, Pali Rohár <pali.rohar@gmail.com> wrote:
>> > > On Saturday 27 May 2017 15:33:14 Andy Shevchenko wrote:
>> > >> On Sat, May 27, 2017 at 4:17 PM, Pali Rohár <pali.rohar@gmail.com>
>> > >> wrote:
>> >
>> > >> Okay, got it. But on your opinion does it make sense to do
>> > >>
>> > >> pr_info("\tobject_id: %2pE\n", g->object_id);
>> > >>
>> > >> instead?
>> > >>
>> > >> For ASCII it will go as is previously, otherwise escaping would be
>> > >> done.
>> > >
>> > > Both is OK for me. Do you want to send a new patch with %2pE?
>> >
>> > To me it looks slightly cleaner.
>>
>> I don't want to let this one fall through the cracks. Pali, is a new one coming?
>
> So.. which modifier to use? Andy already proposed two alternatives and
> basically I'm fine all 3 which are in this thread.

I would go with %2pE.
Rationale:
 - we are not going to change size
 - E is just a guard against _possible_ broken data

-- 
With Best Regards,
Andy Shevchenko

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web