2022-02-03 17:17:08

by Michał Lowas-Rzechonek

[permalink] [raw]
Subject: [PATCH BlueZ] mesh: Remove unused io caps

---
mesh/mesh-io-api.h | 2 --
mesh/mesh-io-generic.c | 14 --------------
mesh/mesh-io-unit.c | 14 --------------
mesh/mesh-io.c | 10 ----------
mesh/mesh-io.h | 7 -------
mesh/mesh.c | 4 ----
6 files changed, 51 deletions(-)

diff --git a/mesh/mesh-io-api.h b/mesh/mesh-io-api.h
index 7a50937da..a20d470fc 100644
--- a/mesh/mesh-io-api.h
+++ b/mesh/mesh-io-api.h
@@ -14,7 +14,6 @@ typedef bool (*mesh_io_init_t)(struct mesh_io *io, void *opts,
struct l_dbus *dbus, mesh_io_ready_func_t cb,
void *user_data);
typedef bool (*mesh_io_destroy_t)(struct mesh_io *io);
-typedef bool (*mesh_io_caps_t)(struct mesh_io *io, struct mesh_io_caps *caps);
typedef bool (*mesh_io_send_t)(struct mesh_io *io,
struct mesh_io_send_info *info,
const uint8_t *data, uint16_t len);
@@ -29,7 +28,6 @@ typedef bool (*mesh_io_tx_cancel_t)(struct mesh_io *io, const uint8_t *pattern,
struct mesh_io_api {
mesh_io_init_t init;
mesh_io_destroy_t destroy;
- mesh_io_caps_t caps;
mesh_io_send_t send;
mesh_io_register_t reg;
mesh_io_deregister_t dereg;
diff --git a/mesh/mesh-io-generic.c b/mesh/mesh-io-generic.c
index 27cb4cf5f..a9d7f8ae5 100644
--- a/mesh/mesh-io-generic.c
+++ b/mesh/mesh-io-generic.c
@@ -473,19 +473,6 @@ static bool dev_destroy(struct mesh_io *io)
return true;
}

-static bool dev_caps(struct mesh_io *io, struct mesh_io_caps *caps)
-{
- struct mesh_io_private *pvt = io->pvt;
-
- if (!pvt || !caps)
- return false;
-
- caps->max_num_filters = 255;
- caps->window_accuracy = 50;
-
- return true;
-}
-
static void send_cancel_done(const void *buf, uint8_t size,
void *user_data)
{
@@ -893,7 +880,6 @@ static bool recv_deregister(struct mesh_io *io, const uint8_t *filter,
const struct mesh_io_api mesh_io_generic = {
.init = dev_init,
.destroy = dev_destroy,
- .caps = dev_caps,
.send = send_tx,
.reg = recv_register,
.dereg = recv_deregister,
diff --git a/mesh/mesh-io-unit.c b/mesh/mesh-io-unit.c
index a3cba747e..4e754c77e 100644
--- a/mesh/mesh-io-unit.c
+++ b/mesh/mesh-io-unit.c
@@ -284,19 +284,6 @@ static bool unit_destroy(struct mesh_io *io)
return true;
}

-static bool unit_caps(struct mesh_io *io, struct mesh_io_caps *caps)
-{
- struct mesh_io_private *pvt = io->pvt;
-
- if (!pvt || !caps)
- return false;
-
- caps->max_num_filters = 255;
- caps->window_accuracy = 50;
-
- return true;
-}
-
static bool simple_match(const void *a, const void *b)
{
return a == b;
@@ -527,7 +514,6 @@ static bool recv_deregister(struct mesh_io *io, const uint8_t *filter,
const struct mesh_io_api mesh_io_unit = {
.init = unit_init,
.destroy = unit_destroy,
- .caps = unit_caps,
.send = send_tx,
.reg = recv_register,
.dereg = recv_deregister,
diff --git a/mesh/mesh-io.c b/mesh/mesh-io.c
index dfd9e43d9..8c860f28f 100644
--- a/mesh/mesh-io.c
+++ b/mesh/mesh-io.c
@@ -102,16 +102,6 @@ void mesh_io_destroy(struct mesh_io *io)
}
}

-bool mesh_io_get_caps(struct mesh_io *io, struct mesh_io_caps *caps)
-{
- io = l_queue_find(io_list, match_by_io, io);
-
- if (io && io->api && io->api->caps)
- return io->api->caps(io, caps);
-
- return false;
-}
-
bool mesh_io_register_recv_cb(struct mesh_io *io, const uint8_t *filter,
uint8_t len, mesh_io_recv_func_t cb,
void *user_data)
diff --git a/mesh/mesh-io.h b/mesh/mesh-io.h
index 8a4b2e8ee..43215b7b0 100644
--- a/mesh/mesh-io.h
+++ b/mesh/mesh-io.h
@@ -57,11 +57,6 @@ struct mesh_io_send_info {
} u;
};

-struct mesh_io_caps {
- uint8_t max_num_filters;
- uint8_t window_accuracy;
-};
-
typedef void (*mesh_io_recv_func_t)(void *user_data,
struct mesh_io_recv_info *info,
const uint8_t *data, uint16_t len);
@@ -78,8 +73,6 @@ struct mesh_io *mesh_io_new(enum mesh_io_type type, void *opts,
void *user_data);
void mesh_io_destroy(struct mesh_io *io);

-bool mesh_io_get_caps(struct mesh_io *io, struct mesh_io_caps *caps);
-
bool mesh_io_register_recv_cb(struct mesh_io *io, const uint8_t *filter,
uint8_t len, mesh_io_recv_func_t cb,
void *user_data);
diff --git a/mesh/mesh.c b/mesh/mesh.c
index 1d3451cf4..4c6fa94a9 100644
--- a/mesh/mesh.c
+++ b/mesh/mesh.c
@@ -57,7 +57,6 @@ struct bt_mesh {
uint16_t algorithms;
uint16_t req_index;
uint8_t friend_queue_sz;
- uint8_t max_filters;
bool initialized;
};

@@ -254,7 +253,6 @@ bool mesh_init(struct l_dbus *dbus, const char *config_dir,
const char *mesh_conf_fname, enum mesh_io_type type, void *opts,
mesh_ready_func_t cb, void *user_data)
{
- struct mesh_io_caps caps;
struct mesh_init_request *req;

if (mesh.io)
@@ -291,8 +289,6 @@ bool mesh_init(struct l_dbus *dbus, const char *config_dir,
}

l_debug("io %p", mesh.io);
- mesh_io_get_caps(mesh.io, &caps);
- mesh.max_filters = caps.max_num_filters;

pending_queue = l_queue_new();

--
2.25.1


2022-02-04 05:25:06

by bluez.test.bot

[permalink] [raw]
Subject: RE: [BlueZ] mesh: Remove unused io caps

This is an automated email and please do not reply to this email.

Dear Submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
While preparing the CI tests, the patches you submitted couldn't be applied to the current HEAD of the repository.

----- Output -----
error: patch failed: mesh/mesh-io-api.h:14
error: mesh/mesh-io-api.h: patch does not apply
error: patch failed: mesh/mesh-io.h:78
error: mesh/mesh-io.h: patch does not apply
error: patch failed: mesh/mesh.c:254
error: mesh/mesh.c: patch does not apply
hint: Use 'git am --show-current-patch' to see the failed patch


Please resolve the issue and submit the patches again.


---
Regards,
Linux Bluetooth

2022-02-06 16:21:12

by Gix, Brian

[permalink] [raw]
Subject: Re: [PATCH BlueZ] mesh: Remove unused io caps

Hi Michał,

I think we are fine with this patch, but it does not appear to be stand-alone.
We are looking closer at your *other* patch regarding using DBUS from mesh-io, but have not reached a
conclusion just yet. This patch seems to depend on that patch.

If you refactor this as a stand-alone patch on the current master, it will be directly appliable.


On Thu, 2022-02-03 at 15:39 +0100, Michał Lowas-Rzechonek wrote:
> ---
>  mesh/mesh-io-api.h     |  2 --
>  mesh/mesh-io-generic.c | 14 --------------
>  mesh/mesh-io-unit.c    | 14 --------------
>  mesh/mesh-io.c         | 10 ----------
>  mesh/mesh-io.h         |  7 -------
>  mesh/mesh.c            |  4 ----
>  6 files changed, 51 deletions(-)
>
> diff --git a/mesh/mesh-io-api.h b/mesh/mesh-io-api.h
> index 7a50937da..a20d470fc 100644
> --- a/mesh/mesh-io-api.h
> +++ b/mesh/mesh-io-api.h
> @@ -14,7 +14,6 @@ typedef bool (*mesh_io_init_t)(struct mesh_io *io, void *opts,
>                                 struct l_dbus *dbus, mesh_io_ready_func_t cb,
>                                 void *user_data);
>  typedef bool (*mesh_io_destroy_t)(struct mesh_io *io);
> -typedef bool (*mesh_io_caps_t)(struct mesh_io *io, struct mesh_io_caps *caps);
>  typedef bool (*mesh_io_send_t)(struct mesh_io *io,
>                                         struct mesh_io_send_info *info,
>                                         const uint8_t *data, uint16_t len);
> @@ -29,7 +28,6 @@ typedef bool (*mesh_io_tx_cancel_t)(struct mesh_io *io, const uint8_t *pattern,
>  struct mesh_io_api {
>         mesh_io_init_t          init;
>         mesh_io_destroy_t       destroy;
> -       mesh_io_caps_t          caps;
>         mesh_io_send_t          send;
>         mesh_io_register_t      reg;
>         mesh_io_deregister_t    dereg;
> diff --git a/mesh/mesh-io-generic.c b/mesh/mesh-io-generic.c
> index 27cb4cf5f..a9d7f8ae5 100644
> --- a/mesh/mesh-io-generic.c
> +++ b/mesh/mesh-io-generic.c
> @@ -473,19 +473,6 @@ static bool dev_destroy(struct mesh_io *io)
>         return true;
>  }
>  
> -static bool dev_caps(struct mesh_io *io, struct mesh_io_caps *caps)
> -{
> -       struct mesh_io_private *pvt = io->pvt;
> -
> -       if (!pvt || !caps)
> -               return false;
> -
> -       caps->max_num_filters = 255;
> -       caps->window_accuracy = 50;
> -
> -       return true;
> -}
> -
>  static void send_cancel_done(const void *buf, uint8_t size,
>                                                         void *user_data)
>  {
> @@ -893,7 +880,6 @@ static bool recv_deregister(struct mesh_io *io, const uint8_t *filter,
>  const struct mesh_io_api mesh_io_generic = {
>         .init = dev_init,
>         .destroy = dev_destroy,
> -       .caps = dev_caps,
>         .send = send_tx,
>         .reg = recv_register,
>         .dereg = recv_deregister,
> diff --git a/mesh/mesh-io-unit.c b/mesh/mesh-io-unit.c
> index a3cba747e..4e754c77e 100644
> --- a/mesh/mesh-io-unit.c
> +++ b/mesh/mesh-io-unit.c
> @@ -284,19 +284,6 @@ static bool unit_destroy(struct mesh_io *io)
>         return true;
>  }
>  
> -static bool unit_caps(struct mesh_io *io, struct mesh_io_caps *caps)
> -{
> -       struct mesh_io_private *pvt = io->pvt;
> -
> -       if (!pvt || !caps)
> -               return false;
> -
> -       caps->max_num_filters = 255;
> -       caps->window_accuracy = 50;
> -
> -       return true;
> -}
> -
>  static bool simple_match(const void *a, const void *b)
>  {
>         return a == b;
> @@ -527,7 +514,6 @@ static bool recv_deregister(struct mesh_io *io, const uint8_t *filter,
>  const struct mesh_io_api mesh_io_unit = {
>         .init = unit_init,
>         .destroy = unit_destroy,
> -       .caps = unit_caps,
>         .send = send_tx,
>         .reg = recv_register,
>         .dereg = recv_deregister,
> diff --git a/mesh/mesh-io.c b/mesh/mesh-io.c
> index dfd9e43d9..8c860f28f 100644
> --- a/mesh/mesh-io.c
> +++ b/mesh/mesh-io.c
> @@ -102,16 +102,6 @@ void mesh_io_destroy(struct mesh_io *io)
>         }
>  }
>  
> -bool mesh_io_get_caps(struct mesh_io *io, struct mesh_io_caps *caps)
> -{
> -       io = l_queue_find(io_list, match_by_io, io);
> -
> -       if (io && io->api && io->api->caps)
> -               return io->api->caps(io, caps);
> -
> -       return false;
> -}
> -
>  bool mesh_io_register_recv_cb(struct mesh_io *io, const uint8_t *filter,
>                                 uint8_t len, mesh_io_recv_func_t cb,
>                                 void *user_data)
> diff --git a/mesh/mesh-io.h b/mesh/mesh-io.h
> index 8a4b2e8ee..43215b7b0 100644
> --- a/mesh/mesh-io.h
> +++ b/mesh/mesh-io.h
> @@ -57,11 +57,6 @@ struct mesh_io_send_info {
>         } u;
>  };
>  
> -struct mesh_io_caps {
> -       uint8_t max_num_filters;
> -       uint8_t window_accuracy;
> -};
> -
>  typedef void (*mesh_io_recv_func_t)(void *user_data,
>                                         struct mesh_io_recv_info *info,
>                                         const uint8_t *data, uint16_t len);
> @@ -78,8 +73,6 @@ struct mesh_io *mesh_io_new(enum mesh_io_type type, void *opts,
>                                 void *user_data);
>  void mesh_io_destroy(struct mesh_io *io);
>  
> -bool mesh_io_get_caps(struct mesh_io *io, struct mesh_io_caps *caps);
> -
>  bool mesh_io_register_recv_cb(struct mesh_io *io, const uint8_t *filter,
>                                         uint8_t len, mesh_io_recv_func_t cb,
>                                         void *user_data);
> diff --git a/mesh/mesh.c b/mesh/mesh.c
> index 1d3451cf4..4c6fa94a9 100644
> --- a/mesh/mesh.c
> +++ b/mesh/mesh.c
> @@ -57,7 +57,6 @@ struct bt_mesh {
>         uint16_t algorithms;
>         uint16_t req_index;
>         uint8_t friend_queue_sz;
> -       uint8_t max_filters;
>         bool initialized;
>  };
>  
> @@ -254,7 +253,6 @@ bool mesh_init(struct l_dbus *dbus, const char *config_dir,
>                 const char *mesh_conf_fname, enum mesh_io_type type, void *opts,
>                 mesh_ready_func_t cb, void *user_data)
>  {
> -       struct mesh_io_caps caps;
>         struct mesh_init_request *req;
>  
>         if (mesh.io)
> @@ -291,8 +289,6 @@ bool mesh_init(struct l_dbus *dbus, const char *config_dir,
>         }
>  
>         l_debug("io %p", mesh.io);
> -       mesh_io_get_caps(mesh.io, &caps);
> -       mesh.max_filters = caps.max_num_filters;
>  
>         pending_queue = l_queue_new();
>