Re: [PATCH 3/3] obexd: Fix comparing array to 0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Andrei,

On Wed, Dec 3, 2014 at 4:08 PM, Andrei Emeltchenko
<Andrei.Emeltchenko.news@xxxxxxxxx> wrote:
> From: Andrei Emeltchenko <andrei.emeltchenko@xxxxxxxxx>
>
> Comparing an arrays to 0 is not useful.

I guess you mean this should never fail so it dead code in practice
since the array will never be NULL, we should probably fix the message
then.

> ---
>  obexd/client/pbap.c | 9 ---------
>  1 file changed, 9 deletions(-)
>
> diff --git a/obexd/client/pbap.c b/obexd/client/pbap.c
> index 57632b4..28203a8 100644
> --- a/obexd/client/pbap.c
> +++ b/obexd/client/pbap.c
> @@ -1111,9 +1111,6 @@ static gboolean get_databaseid(const GDBusPropertyTable *property,
>         char value[33];
>         const char *pvalue = value;
>
> -       if (!pbap->databaseid)
> -               return FALSE;
> -
>         if (u128_to_string(pbap->databaseid, value, sizeof(value)) < 0)
>                 return FALSE;
>
> @@ -1137,9 +1134,6 @@ static gboolean get_primary(const GDBusPropertyTable *property,
>         char value[33];
>         const char *pvalue = value;
>
> -       if (!pbap->primary)
> -               return FALSE;
> -
>         if (u128_to_string(pbap->primary, value, sizeof(value)) < 0)
>                 return FALSE;
>
> @@ -1155,9 +1149,6 @@ static gboolean get_secondary(const GDBusPropertyTable *property,
>         char value[33];
>         const char *pvalue = value;
>
> -       if (!pbap->secondary)
> -               return FALSE;
> -
>         if (u128_to_string(pbap->secondary, value, sizeof(value)) < 0)
>                 return FALSE;
>
> --
> 1.9.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Luiz Augusto von Dentz
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux