Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4572324ybv; Mon, 17 Feb 2020 01:39:35 -0800 (PST) X-Google-Smtp-Source: APXvYqzUV85OXDKJAt6MZWY8COZJZhaJrzcN3G3P51shPP0aIACixmH+8Rdo1d2mo947UVSptmNF X-Received: by 2002:a9d:7e8c:: with SMTP id m12mr12038735otp.346.1581932374821; Mon, 17 Feb 2020 01:39:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581932374; cv=none; d=google.com; s=arc-20160816; b=kXLEMvDwWtQ1rMt7g50XPR3XNCFsnVHB16Jp+VxUhhZjFAvSN/M9xH/oxW+yKN+Fca DwFaj0oVNsLYXqq5sohQtXk7w6fAkjHPRshfmvg4xq1s30FXe3zzhutlO5zsq2D9zWv8 uzhxfc8P49yYm1LgSP2SCdlVawo5R7wck3BFFeVQjOwlIsC9TQUuSxH05uEz3zjYMD5D uBxHJCyep16aZgemukWBlX6LX3c4xTfze9IbIWd9z2zV5B++e4kRw3yUNyH10zSIJ3do 0UiIqE+FJYhOiKfgdXOP5i47tOjFgYpEyph3OSlX/sdfoBqdJFQs9qpJQvKVc5e2dTOK +X6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Afwt3f5haicc54NjifQPcLwy6vygZPMQ4dpzw9cQKTs=; b=uGCCBhP9As3U7fxCvsE9uW1nb4mxKc4bXyRETDwPcC+6C1nvMNFSDt2HzYo8tMS9tL gg6wktReWygs4Dub3VU4+JSZYia1ByQrir5JP1qGFstXIqQYXYHlsYvppkWFLtVNM+x4 rGnHlZNCMQeleCsx+EjBy6MgF79Z2bN69B2c1hO66dJMRik41v6UgQuti4wZkl3CVXN1 Qzv97zI1wzV/yly4RhQ+rZGSsjWaRPkO7OIcCr040tHKDtK9eLdu24sdSk+QwXOrXEmY QmnBmuKR7XRhiyRXfEABjRhLyq0nhIi+7iQBgJ00ezHsGxy46fhMS+t9D+7HIxPlJL/k OkJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=0FeSRJlL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 9si5306164oiq.104.2020.02.17.01.39.22; Mon, 17 Feb 2020 01:39:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=0FeSRJlL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728967AbgBQJiz (ORCPT + 99 others); Mon, 17 Feb 2020 04:38:55 -0500 Received: from mail-qk1-f193.google.com ([209.85.222.193]:38264 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728849AbgBQJiy (ORCPT ); Mon, 17 Feb 2020 04:38:54 -0500 Received: by mail-qk1-f193.google.com with SMTP id z19so15565075qkj.5 for ; Mon, 17 Feb 2020 01:38:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=Afwt3f5haicc54NjifQPcLwy6vygZPMQ4dpzw9cQKTs=; b=0FeSRJlLGZWcE4RRPtM4gSIGicjoUxKa7odOoqFd72hdA+O7Xh2FTW49Fm7Lpsu7Mi lh9RJGPKS+YWQzILdfhjbg2+ReSx1iyh/T9kJ1u7/SJZ6cgpgnWRAj/aO1VsoeNMHsj9 4tbh6ZUDZ9kxXD6jidbjINrLnHYHzPbiO/uF0q9hQWRzKnuE0Gdv9DEGu6I1nZCgpBMa IDiuVxZw031QBeoBhdhzfbPD6PdckAYJJjHUP5h4WH7M5YpAij0mqLKV58ZdYBbzUb+z GTs0x/6AOtVfey0ERi+0yuJiGWyYX9Lk6Tp27N3EfBD+oPIIYXmO6rJ9UttLRpQc0KuK 8KQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=Afwt3f5haicc54NjifQPcLwy6vygZPMQ4dpzw9cQKTs=; b=mYmGfhanaxbiqpyYvEU0t3Yv9Z5ZDfRVPK3oFDRxJ92njZa6Ljf8vRYHlSzMTa2Ycn iaNfP2OdD+MgQROjvE3u12jo2Cg/ClwbXF5ND43WhDy5Iw2IxnZp4fdjF/SHwplKv0Re PwWZFPnZ3XdQ3hiKiD2CxfDux5h+caFRrrr6/wC5H7jWUBYmDW8SeUOeI/zbH4FFeoa7 g+bGPH+K21G7SFQlmva4gopZLHXKnBTOUfc8xEHrhNsbKnM5T0eG6FuP4K1IzQddfsRF 2zP7jRhVi15pzhM+J9cKIAAlfvsFjx4yh6S1xMvjYeufsOWYlHyXv0UGkmY9omwKW932 TSkg== X-Gm-Message-State: APjAAAXhzxrupFDHIwSAv1PnkLg+Cj52zS93lcFbd6r3bIcZsGYfyAKs XK6yjq379KxTyBNvR/uUG38VwkkeYHjP+vAyS+2xxQ== X-Received: by 2002:a37:8343:: with SMTP id f64mr12901966qkd.21.1581932333854; Mon, 17 Feb 2020 01:38:53 -0800 (PST) MIME-Version: 1.0 References: <20200211210618.GA29823@embeddedor> In-Reply-To: <20200211210618.GA29823@embeddedor> From: Bartosz Golaszewski Date: Mon, 17 Feb 2020 10:38:43 +0100 Message-ID: Subject: Re: [PATCH] gpio: uniphier: Replace zero-length array with flexible-array member To: "Gustavo A. R. Silva" Cc: Linus Walleij , Masahiro Yamada , linux-gpio , arm-soc , LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org wt., 11 lut 2020 o 22:03 Gustavo A. R. Silva napisa=C5=82(a): > > The current codebase makes use of the zero-length array language > extension to the C90 standard, but the preferred mechanism to declare > variable-length types such as these ones is a flexible array member[1][2]= , > introduced in C99: > > struct foo { > int stuff; > struct boo array[]; > }; > > By making use of the mechanism above, we will get a compiler warning > in case the flexible array does not occur last in the structure, which > will help us prevent some kind of undefined behavior bugs from being > inadvertenly introduced[3] to the codebase from now on. > > This issue was found with the help of Coccinelle. > > [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html > [2] https://github.com/KSPP/linux/issues/21 > [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") > > Signed-off-by: Gustavo A. R. Silva Patch applied, thanks! Bartosz