Skip to content

Commit

Permalink
tools: ynl-gen: change spacing around __attribute__
Browse files Browse the repository at this point in the history
checkpatch gets confused and treats __attribute__ as a function call.
It complains about white space before "(":

WARNING:SPACING: space prohibited between function name and open parenthesis '('
+	struct netdev_queue_get_rsp obj __attribute__ ((aligned (8)));

No spaces wins in the kernel:

  $ git grep 'attribute__((.*aligned(' | wc -l
  480
  $ git grep 'attribute__ ((.*aligned (' | wc -l
  110
  $ git grep 'attribute__ ((.*aligned(' | wc -l
  94
  $ git grep 'attribute__((.*aligned (' | wc -l
  63

So, whatever, change the codegen.

Note that checkpatch also thinks we should use __aligned(),
but this is user space code.

Link: https://lore.kernel.org/all/202310190900.9Dzgkbev-lkp@intel.com/
Acked-by: Stanislav Fomichev <sdf@google.com>
Reviewed-by: Amritha Nambiar <amritha.nambiar@intel.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Link: https://lore.kernel.org/r/20231020221827.3436697-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Jakub Kicinski committed Oct 23, 2023
1 parent b7c4f57 commit c0119e6
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 64 deletions.
32 changes: 16 additions & 16 deletions tools/net/ynl/generated/devlink-user.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ devlink_get(struct ynl_sock *ys, struct devlink_get_req *req);
/* DEVLINK_CMD_GET - dump */
struct devlink_get_list {
struct devlink_get_list *next;
struct devlink_get_rsp obj __attribute__ ((aligned (8)));
struct devlink_get_rsp obj __attribute__((aligned(8)));
};

void devlink_get_list_free(struct devlink_get_list *rsp);
Expand Down Expand Up @@ -262,7 +262,7 @@ struct devlink_port_get_rsp_dump {

struct devlink_port_get_rsp_list {
struct devlink_port_get_rsp_list *next;
struct devlink_port_get_rsp_dump obj __attribute__ ((aligned (8)));
struct devlink_port_get_rsp_dump obj __attribute__((aligned(8)));
};

void devlink_port_get_rsp_list_free(struct devlink_port_get_rsp_list *rsp);
Expand Down Expand Up @@ -379,7 +379,7 @@ devlink_sb_get_req_dump_set_dev_name(struct devlink_sb_get_req_dump *req,

struct devlink_sb_get_list {
struct devlink_sb_get_list *next;
struct devlink_sb_get_rsp obj __attribute__ ((aligned (8)));
struct devlink_sb_get_rsp obj __attribute__((aligned(8)));
};

void devlink_sb_get_list_free(struct devlink_sb_get_list *rsp);
Expand Down Expand Up @@ -509,7 +509,7 @@ devlink_sb_pool_get_req_dump_set_dev_name(struct devlink_sb_pool_get_req_dump *r

struct devlink_sb_pool_get_list {
struct devlink_sb_pool_get_list *next;
struct devlink_sb_pool_get_rsp obj __attribute__ ((aligned (8)));
struct devlink_sb_pool_get_rsp obj __attribute__((aligned(8)));
};

void devlink_sb_pool_get_list_free(struct devlink_sb_pool_get_list *rsp);
Expand Down Expand Up @@ -654,7 +654,7 @@ devlink_sb_port_pool_get_req_dump_set_dev_name(struct devlink_sb_port_pool_get_r

struct devlink_sb_port_pool_get_list {
struct devlink_sb_port_pool_get_list *next;
struct devlink_sb_port_pool_get_rsp obj __attribute__ ((aligned (8)));
struct devlink_sb_port_pool_get_rsp obj __attribute__((aligned(8)));
};

void
Expand Down Expand Up @@ -811,7 +811,7 @@ devlink_sb_tc_pool_bind_get_req_dump_set_dev_name(struct devlink_sb_tc_pool_bind

struct devlink_sb_tc_pool_bind_get_list {
struct devlink_sb_tc_pool_bind_get_list *next;
struct devlink_sb_tc_pool_bind_get_rsp obj __attribute__ ((aligned (8)));
struct devlink_sb_tc_pool_bind_get_rsp obj __attribute__((aligned(8)));
};

void
Expand Down Expand Up @@ -933,7 +933,7 @@ devlink_param_get_req_dump_set_dev_name(struct devlink_param_get_req_dump *req,

struct devlink_param_get_list {
struct devlink_param_get_list *next;
struct devlink_param_get_rsp obj __attribute__ ((aligned (8)));
struct devlink_param_get_rsp obj __attribute__((aligned(8)));
};

void devlink_param_get_list_free(struct devlink_param_get_list *rsp);
Expand Down Expand Up @@ -1065,7 +1065,7 @@ devlink_region_get_req_dump_set_dev_name(struct devlink_region_get_req_dump *req

struct devlink_region_get_list {
struct devlink_region_get_list *next;
struct devlink_region_get_rsp obj __attribute__ ((aligned (8)));
struct devlink_region_get_rsp obj __attribute__((aligned(8)));
};

void devlink_region_get_list_free(struct devlink_region_get_list *rsp);
Expand Down Expand Up @@ -1144,7 +1144,7 @@ devlink_info_get(struct ynl_sock *ys, struct devlink_info_get_req *req);
/* DEVLINK_CMD_INFO_GET - dump */
struct devlink_info_get_list {
struct devlink_info_get_list *next;
struct devlink_info_get_rsp obj __attribute__ ((aligned (8)));
struct devlink_info_get_rsp obj __attribute__((aligned(8)));
};

void devlink_info_get_list_free(struct devlink_info_get_list *rsp);
Expand Down Expand Up @@ -1288,7 +1288,7 @@ devlink_health_reporter_get_req_dump_set_port_index(struct devlink_health_report

struct devlink_health_reporter_get_list {
struct devlink_health_reporter_get_list *next;
struct devlink_health_reporter_get_rsp obj __attribute__ ((aligned (8)));
struct devlink_health_reporter_get_rsp obj __attribute__((aligned(8)));
};

void
Expand Down Expand Up @@ -1410,7 +1410,7 @@ devlink_trap_get_req_dump_set_dev_name(struct devlink_trap_get_req_dump *req,

struct devlink_trap_get_list {
struct devlink_trap_get_list *next;
struct devlink_trap_get_rsp obj __attribute__ ((aligned (8)));
struct devlink_trap_get_rsp obj __attribute__((aligned(8)));
};

void devlink_trap_get_list_free(struct devlink_trap_get_list *rsp);
Expand Down Expand Up @@ -1534,7 +1534,7 @@ devlink_trap_group_get_req_dump_set_dev_name(struct devlink_trap_group_get_req_d

struct devlink_trap_group_get_list {
struct devlink_trap_group_get_list *next;
struct devlink_trap_group_get_rsp obj __attribute__ ((aligned (8)));
struct devlink_trap_group_get_rsp obj __attribute__((aligned(8)));
};

void devlink_trap_group_get_list_free(struct devlink_trap_group_get_list *rsp);
Expand Down Expand Up @@ -1657,7 +1657,7 @@ devlink_trap_policer_get_req_dump_set_dev_name(struct devlink_trap_policer_get_r

struct devlink_trap_policer_get_list {
struct devlink_trap_policer_get_list *next;
struct devlink_trap_policer_get_rsp obj __attribute__ ((aligned (8)));
struct devlink_trap_policer_get_rsp obj __attribute__((aligned(8)));
};

void
Expand Down Expand Up @@ -1790,7 +1790,7 @@ devlink_rate_get_req_dump_set_dev_name(struct devlink_rate_get_req_dump *req,

struct devlink_rate_get_list {
struct devlink_rate_get_list *next;
struct devlink_rate_get_rsp obj __attribute__ ((aligned (8)));
struct devlink_rate_get_rsp obj __attribute__((aligned(8)));
};

void devlink_rate_get_list_free(struct devlink_rate_get_list *rsp);
Expand Down Expand Up @@ -1910,7 +1910,7 @@ devlink_linecard_get_req_dump_set_dev_name(struct devlink_linecard_get_req_dump

struct devlink_linecard_get_list {
struct devlink_linecard_get_list *next;
struct devlink_linecard_get_rsp obj __attribute__ ((aligned (8)));
struct devlink_linecard_get_rsp obj __attribute__((aligned(8)));
};

void devlink_linecard_get_list_free(struct devlink_linecard_get_list *rsp);
Expand Down Expand Up @@ -1981,7 +1981,7 @@ devlink_selftests_get(struct ynl_sock *ys,
/* DEVLINK_CMD_SELFTESTS_GET - dump */
struct devlink_selftests_get_list {
struct devlink_selftests_get_list *next;
struct devlink_selftests_get_rsp obj __attribute__ ((aligned (8)));
struct devlink_selftests_get_rsp obj __attribute__((aligned(8)));
};

void devlink_selftests_get_list_free(struct devlink_selftests_get_list *rsp);
Expand Down
Loading

0 comments on commit c0119e6

Please sign in to comment.