Commit c0119e62 authored by Jakub Kicinski's avatar Jakub Kicinski

tools: ynl-gen: change spacing around __attribute__

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: default avatarStanislav Fomichev <sdf@google.com>
Reviewed-by: default avatarAmritha Nambiar <amritha.nambiar@intel.com>
Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
Link: https://lore.kernel.org/r/20231020221827.3436697-1-kuba@kernel.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent b7c4f573
......@@ -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);
......@@ -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);
......@@ -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);
......@@ -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);
......@@ -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
......@@ -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
......@@ -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);
......@@ -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);
......@@ -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);
......@@ -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
......@@ -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);
......@@ -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);
......@@ -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
......@@ -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);
......@@ -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);
......@@ -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);
......
This diff is collapsed.
......@@ -333,7 +333,7 @@ struct fou_get_rsp *fou_get(struct ynl_sock *ys, struct fou_get_req *req);
/* FOU_CMD_GET - dump */
struct fou_get_list {
struct fou_get_list *next;
struct fou_get_rsp obj __attribute__ ((aligned (8)));
struct fou_get_rsp obj __attribute__((aligned(8)));
};
void fou_get_list_free(struct fou_get_list *rsp);
......
......@@ -90,7 +90,7 @@ struct handshake_accept_ntf {
__u8 cmd;
struct ynl_ntf_base_type *next;
void (*free)(struct handshake_accept_ntf *ntf);
struct handshake_accept_rsp obj __attribute__ ((aligned (8)));
struct handshake_accept_rsp obj __attribute__((aligned(8)));
};
void handshake_accept_ntf_free(struct handshake_accept_ntf *rsp);
......
......@@ -69,7 +69,7 @@ netdev_dev_get(struct ynl_sock *ys, struct netdev_dev_get_req *req);
/* NETDEV_CMD_DEV_GET - dump */
struct netdev_dev_get_list {
struct netdev_dev_get_list *next;
struct netdev_dev_get_rsp obj __attribute__ ((aligned (8)));
struct netdev_dev_get_rsp obj __attribute__((aligned(8)));
};
void netdev_dev_get_list_free(struct netdev_dev_get_list *rsp);
......@@ -82,7 +82,7 @@ struct netdev_dev_get_ntf {
__u8 cmd;
struct ynl_ntf_base_type *next;
void (*free)(struct netdev_dev_get_ntf *ntf);
struct netdev_dev_get_rsp obj __attribute__ ((aligned (8)));
struct netdev_dev_get_rsp obj __attribute__((aligned(8)));
};
void netdev_dev_get_ntf_free(struct netdev_dev_get_ntf *rsp);
......
......@@ -157,7 +157,7 @@ struct ynl_parse_arg {
struct ynl_dump_list_type {
struct ynl_dump_list_type *next;
unsigned char data[] __attribute__ ((aligned (8)));
unsigned char data[] __attribute__((aligned(8)));
};
extern struct ynl_dump_list_type *YNL_LIST_END;
......@@ -187,7 +187,7 @@ struct ynl_ntf_base_type {
__u8 cmd;
struct ynl_ntf_base_type *next;
void (*free)(struct ynl_ntf_base_type *ntf);
unsigned char data[] __attribute__ ((aligned (8)));
unsigned char data[] __attribute__((aligned(8)));
};
extern mnl_cb_t ynl_cb_array[NLMSG_MIN_TYPE];
......
......@@ -1872,7 +1872,7 @@ def print_wrapped_type(ri):
ri.cw.p('__u8 cmd;')
ri.cw.p('struct ynl_ntf_base_type *next;')
ri.cw.p(f"void (*free)({type_name(ri, 'reply')} *ntf);")
ri.cw.p(f"{type_name(ri, 'reply', deref=True)} obj __attribute__ ((aligned (8)));")
ri.cw.p(f"{type_name(ri, 'reply', deref=True)} obj __attribute__((aligned(8)));")
ri.cw.block_end(line=';')
ri.cw.nl()
print_free_prototype(ri, 'reply')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment