linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] autopair: Fix compiler warning
@ 2020-03-24 19:49 Sonny Sasaka
  2020-03-26 17:20 ` Sonny Sasaka
  0 siblings, 1 reply; 4+ messages in thread
From: Sonny Sasaka @ 2020-03-24 19:49 UTC (permalink / raw)
  To: BlueZ

With clang, comparing an array with NULL generates a warning because the
value is always non-NULL. With maintainer mode enabled, this becomes a
compilation error.
---
 plugins/autopair.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plugins/autopair.c b/plugins/autopair.c
index 043bd9b9d..3089430a8 100644
--- a/plugins/autopair.c
+++ b/plugins/autopair.c
@@ -75,7 +75,7 @@ static ssize_t autopair_pincb(struct btd_adapter *adapter,
         btd_device_get_product (device));

     /* The iCade shouldn't use random PINs like normal keyboards */
-    if (name != NULL && strstr(name, "iCade") != NULL)
+    if (strstr(name, "iCade") != NULL)
         return 0;

     /* This is a class-based pincode guesser. Ignore devices with an
-- 
2.17.1

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

* Re: [PATCH] autopair: Fix compiler warning
  2020-03-24 19:49 [PATCH] autopair: Fix compiler warning Sonny Sasaka
@ 2020-03-26 17:20 ` Sonny Sasaka
  2020-03-26 21:08   ` Luiz Augusto von Dentz
  0 siblings, 1 reply; 4+ messages in thread
From: Sonny Sasaka @ 2020-03-26 17:20 UTC (permalink / raw)
  To: BlueZ

Hi BlueZ maintainers,

Could you take a look at this fix? Thank you!

On Tue, Mar 24, 2020 at 12:49 PM Sonny Sasaka <sonnysasaka@chromium.org> wrote:
>
> With clang, comparing an array with NULL generates a warning because the
> value is always non-NULL. With maintainer mode enabled, this becomes a
> compilation error.
> ---
>  plugins/autopair.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/plugins/autopair.c b/plugins/autopair.c
> index 043bd9b9d..3089430a8 100644
> --- a/plugins/autopair.c
> +++ b/plugins/autopair.c
> @@ -75,7 +75,7 @@ static ssize_t autopair_pincb(struct btd_adapter *adapter,
>          btd_device_get_product (device));
>
>      /* The iCade shouldn't use random PINs like normal keyboards */
> -    if (name != NULL && strstr(name, "iCade") != NULL)
> +    if (strstr(name, "iCade") != NULL)
>          return 0;
>
>      /* This is a class-based pincode guesser. Ignore devices with an
> --
> 2.17.1

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

* Re: [PATCH] autopair: Fix compiler warning
  2020-03-26 17:20 ` Sonny Sasaka
@ 2020-03-26 21:08   ` Luiz Augusto von Dentz
  2020-03-26 21:12     ` Sonny Sasaka
  0 siblings, 1 reply; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2020-03-26 21:08 UTC (permalink / raw)
  To: Sonny Sasaka; +Cc: BlueZ

Hi Sonny,

On Thu, Mar 26, 2020 at 10:23 AM Sonny Sasaka <sonnysasaka@chromium.org> wrote:
>
> Hi BlueZ maintainers,
>
> Could you take a look at this fix? Thank you!
>
> On Tue, Mar 24, 2020 at 12:49 PM Sonny Sasaka <sonnysasaka@chromium.org> wrote:
> >
> > With clang, comparing an array with NULL generates a warning because the
> > value is always non-NULL. With maintainer mode enabled, this becomes a
> > compilation error.
> > ---
> >  plugins/autopair.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/plugins/autopair.c b/plugins/autopair.c
> > index 043bd9b9d..3089430a8 100644
> > --- a/plugins/autopair.c
> > +++ b/plugins/autopair.c
> > @@ -75,7 +75,7 @@ static ssize_t autopair_pincb(struct btd_adapter *adapter,
> >          btd_device_get_product (device));
> >
> >      /* The iCade shouldn't use random PINs like normal keyboards */
> > -    if (name != NULL && strstr(name, "iCade") != NULL)
> > +    if (strstr(name, "iCade") != NULL)
> >          return 0;
> >
> >      /* This is a class-based pincode guesser. Ignore devices with an
> > --
> > 2.17.1

Applied, thanks.

-- 
Luiz Augusto von Dentz

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

* Re: [PATCH] autopair: Fix compiler warning
  2020-03-26 21:08   ` Luiz Augusto von Dentz
@ 2020-03-26 21:12     ` Sonny Sasaka
  0 siblings, 0 replies; 4+ messages in thread
From: Sonny Sasaka @ 2020-03-26 21:12 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: BlueZ

Thanks, Luiz.

On Thu, Mar 26, 2020 at 2:09 PM Luiz Augusto von Dentz
<luiz.dentz@gmail.com> wrote:
>
> Hi Sonny,
>
> On Thu, Mar 26, 2020 at 10:23 AM Sonny Sasaka <sonnysasaka@chromium.org> wrote:
> >
> > Hi BlueZ maintainers,
> >
> > Could you take a look at this fix? Thank you!
> >
> > On Tue, Mar 24, 2020 at 12:49 PM Sonny Sasaka <sonnysasaka@chromium.org> wrote:
> > >
> > > With clang, comparing an array with NULL generates a warning because the
> > > value is always non-NULL. With maintainer mode enabled, this becomes a
> > > compilation error.
> > > ---
> > >  plugins/autopair.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/plugins/autopair.c b/plugins/autopair.c
> > > index 043bd9b9d..3089430a8 100644
> > > --- a/plugins/autopair.c
> > > +++ b/plugins/autopair.c
> > > @@ -75,7 +75,7 @@ static ssize_t autopair_pincb(struct btd_adapter *adapter,
> > >          btd_device_get_product (device));
> > >
> > >      /* The iCade shouldn't use random PINs like normal keyboards */
> > > -    if (name != NULL && strstr(name, "iCade") != NULL)
> > > +    if (strstr(name, "iCade") != NULL)
> > >          return 0;
> > >
> > >      /* This is a class-based pincode guesser. Ignore devices with an
> > > --
> > > 2.17.1
>
> Applied, thanks.
>
> --
> Luiz Augusto von Dentz

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

end of thread, other threads:[~2020-03-26 21:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-24 19:49 [PATCH] autopair: Fix compiler warning Sonny Sasaka
2020-03-26 17:20 ` Sonny Sasaka
2020-03-26 21:08   ` Luiz Augusto von Dentz
2020-03-26 21:12     ` Sonny Sasaka

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