Re: [PATCH v2][next] net/smc: Avoid -Wflex-array-member-not-at-end warnings

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

 




diff --git a/net/smc/smc_clc.c b/net/smc/smc_clc.c
index e55026c7529c..63bb5745ab54 100644
--- a/net/smc/smc_clc.c
+++ b/net/smc/smc_clc.c
@@ -853,8 +853,9 @@ int smc_clc_send_proposal(struct smc_sock *smc, struct smc_init_info *ini)
      pclc_smcd = &pclc->pclc_smcd;
      pclc_prfx = &pclc->pclc_prfx;
      ipv6_prfx = pclc->pclc_prfx_ipv6;
-    v2_ext = &pclc->pclc_v2_ext;
-    smcd_v2_ext = &pclc->pclc_smcd_v2_ext;
+    v2_ext = container_of(&pclc->pclc_v2_ext, struct smc_clc_v2_extension, fixed);
checkpatch complained 'WARNING: line length of 86 exceeds 80 columns' here.

I could probably change this.


It can be reproduced by:

./scripts/checkpatch.pl --strict --max-line-length=80 --ignore=COMMIT_LOG_LONG_LINE,MACRO_ARG_REUSE,ALLOC_SIZEOF_STRUCT,NO_AUTHOR_SIGN_OFF,GIT_COMMIT_ID,CAMELCASE xxx.patch

+    smcd_v2_ext = container_of(&pclc->pclc_smcd_v2_ext,
+                   struct smc_clc_smcd_v2_extension, fixed);
      gidchids = pclc->pclc_gidchids;
      trl = &pclc->pclc_trl;
diff --git a/net/smc/smc_clc.h b/net/smc/smc_clc.h
index 7cc7070b9772..2bfb51daf468 100644
--- a/net/smc/smc_clc.h
+++ b/net/smc/smc_clc.h
@@ -134,12 +134,14 @@ struct smc_clc_smcd_gid_chid {
               */
  struct smc_clc_v2_extension {
-    struct smc_clnt_opts_area_hdr hdr;
-    u8 roce[16];        /* RoCEv2 GID */
-    u8 max_conns;
-    u8 max_links;
-    __be16 feature_mask;
-    u8 reserved[12];
+    struct_group_tagged(smc_clc_v2_extension_fixed, fixed,
+        struct smc_clnt_opts_area_hdr hdr;

checkpatch: 'CHECK: Alignment should match open parenthesis'

I think the code looks better as is --without aligning to match the parenthesis.

--
Gustavo




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux