public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@kernel.org>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Andy Gross <agross@kernel.org>,
	Jassi Brar <jassisinghbrar@gmail.com>,
	Niklas Cassel <niklas.cassel@linaro.org>,
	Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Jassi Brar <jaswinder.singh@linaro.org>,
	linux-arm-msm <linux-arm-msm@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mbox: qcom: avoid unused-variable warning
Date: Thu, 03 Oct 2019 14:16:00 -0700	[thread overview]
Message-ID: <20191003211601.56450207FF@mail.kernel.org> (raw)
In-Reply-To: <CAMuHMdUW0UcPDJcw8A4imPfVc5ywbMGuORungaeSk9j0omAjfQ@mail.gmail.com>

Quoting Geert Uytterhoeven (2019-09-27 12:10:13)
> On Fri, Sep 27, 2019 at 8:26 PM Stephen Boyd <sboyd@kernel.org> wrote:
> > Quoting Geert Uytterhoeven (2019-09-26 06:07:13)
> > > On Fri, Sep 20, 2019 at 11:06 PM Stephen Boyd <sboyd@kernel.org> wrote:
> > > > Quoting Arnd Bergmann (2019-09-20 12:27:50)
> > > > > On Fri, Sep 20, 2019 at 6:45 PM Stephen Boyd <sboyd@kernel.org> wrote:
> > >
> > > > --- a/drivers/leds/leds-pca9532.c
> > > > +++ b/drivers/leds/leds-pca9532.c
> > > > @@ -472,7 +472,7 @@ pca9532_of_populate_pdata(struct device *dev, struct device_node *np)
> > > >         int i = 0;
> > > >         const char *state;
> > > >
> > > > -       match = of_match_device(of_pca9532_leds_match, dev);
> > > > +       match = of_match_device(of_match_ptr(of_pca9532_leds_match), dev);
> > > >         if (!match)
> > > >                 return ERR_PTR(-ENODEV);
> > >
> > > Please convert to of_device_get_match_data() instead of adding
> > > of_match_ptr() invocations...
> >
> > How is this workable? I left it as of_match_device() because the value
> > returned may be 0 for the enum and that looks the same as NULL.
> 
> This function is used for the DT case only, so there will always be a match.
> Hence you can do devid = (int)(uintptr_t)of_device_get_match_data(dev).
> 

Ok. Let me send out a pile of patches.


      reply	other threads:[~2019-10-03 21:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-20 14:55 [PATCH] mbox: qcom: avoid unused-variable warning Arnd Bergmann
2019-09-20 16:45 ` Stephen Boyd
2019-09-20 19:27   ` Arnd Bergmann
     [not found]     ` <20190920210622.51382205F4@mail.kernel.org>
2019-09-26 13:07       ` Geert Uytterhoeven
2019-09-27 18:26         ` Stephen Boyd
2019-09-27 19:10           ` Geert Uytterhoeven
2019-10-03 21:16             ` Stephen Boyd [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=20191003211601.56450207FF@mail.kernel.org \
    --to=sboyd@kernel.org \
    --cc=agross@kernel.org \
    --cc=arnd@arndb.de \
    --cc=bjorn.andersson@linaro.org \
    --cc=geert+renesas@glider.be \
    --cc=geert@linux-m68k.org \
    --cc=jassisinghbrar@gmail.com \
    --cc=jaswinder.singh@linaro.org \
    --cc=jorge.ramirez-ortiz@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=niklas.cassel@linaro.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