Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp734720ybh; Wed, 22 Jul 2020 11:46:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJylbPKyPFyYTekFneXIe3O4hNUO12DIfh+e/n10im+EvsOatCjjk6aIn+Ff4ejsotSvT5/x X-Received: by 2002:a17:906:26c3:: with SMTP id u3mr856865ejc.483.1595443596962; Wed, 22 Jul 2020 11:46:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595443596; cv=none; d=google.com; s=arc-20160816; b=WRCo0CNydKN9jI58DUQO/7iL/OfIUqLaP4wBC8rfWON6Yuj9/2UTlOelw1mCyRwtuZ WlNsPo+MmBhdx6GEc6+jZnuaPhE7rGtBBHBRfv4XIqROSDuo9+BLPYL7W1fgSBq9WI5N 52iDGPhlrKWK1HmSu0E19OsiAiD9tuFZXKdAyA3AxEY7IWbPE94fUmmudYLNJqQ7mDoi vqN8MWjpPmaN22dnmMzBZXqoqOsuEP/tGYMR6F2Y/e9JWKUsoOM8fII/Q4Pdrkv7FVke +RpK4oNRqLN5lPxdx/8tvlMWN2U9fwCpJAJSufSFvXPcdCy2d+MDtfVvQYbadAZWbT7u Stgw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:from:references:cc:to:subject:dkim-signature; bh=6Hf0hTi79QqH5wR+v5/kTejIjdPdaSCv8dlz4gt17UM=; b=gZG52mcKNCP7i+fiTKlBN9j8S8eBEXwuGMex1BXA9fhRQsCMLQdoeCrAngtJGJCW/5 0GIgmIPNB4KKtTXqVX5dOEE/6ag2yVMJaFisAwdDy8vr/UIt4TIk4MIAK3NEVwlrm3if LshpV1MINx8q4brqHy8+Qjiu3SxwuIHc8wBakbrmNXCpz0mquL5CJyohswQjYW/bSnbR 6NcitO6yPpMY4/+Vr7o8PJStO6KhtxOl93owVqAHwP/wo9vt2IXZmBjpqvfJA0i2I0ax GhDlntYYr/e2uWHFBBqSwpqPsprr4R2rha4fsu/G59aqzNOQgeDzEM31Zhi5NYXVUEMN Zwww== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@embeddedor.com header.s=default header.b=v8AxR96u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n15si554426eje.289.2020.07.22.11.46.14; Wed, 22 Jul 2020 11:46:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@embeddedor.com header.s=default header.b=v8AxR96u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732111AbgGVSpN (ORCPT + 99 others); Wed, 22 Jul 2020 14:45:13 -0400 Received: from gateway36.websitewelcome.com ([192.185.199.121]:24431 "EHLO gateway36.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728497AbgGVSpN (ORCPT ); Wed, 22 Jul 2020 14:45:13 -0400 Received: from cm11.websitewelcome.com (cm11.websitewelcome.com [100.42.49.5]) by gateway36.websitewelcome.com (Postfix) with ESMTP id 2A93340518271 for ; Wed, 22 Jul 2020 12:44:33 -0500 (CDT) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id yJMxjbdjYhmVTyJMxjxzMC; Wed, 22 Jul 2020 13:21:31 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=embeddedor.com; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=6Hf0hTi79QqH5wR+v5/kTejIjdPdaSCv8dlz4gt17UM=; b=v8AxR96umy1MXj0UJP1Arx9x6i C05xPI4UXW8Ci9rVEuMAIxomfp6Ob7j1WoouyGrh5MlLQ7Av84xedFTiAtAJ99FuwjzvETkFIgOxj SYus5ybjOXpEw+03zStnM9RDB8RR05XWSy43l3/GDAm2biscWtP9wEQs4yViFHdlXnO5sABXw17cq esjKQMNZxsD2E6ujU4UCBjYhr4de9H9YeBUpzmK2l9fSucDO1dR1LQ4tm3nT8KDDK2VzN3KIgbp8r CuK93EA+yt6277MdedE1J51SfbfJRURIoC/MeexR3xUXt1/SsonsRCMHW86oKd3ApzOvOAMr3Y1KS 5IIKivLg==; Received: from [201.166.157.48] (port=39362 helo=[192.168.43.132]) by gator4166.hostgator.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1jyJMw-000Wnz-BS; Wed, 22 Jul 2020 13:21:30 -0500 Subject: Re: [PATCH v2] mei: Avoid the use of one-element arrays To: "Gustavo A. R. Silva" , Tomas Winkler , Arnd Bergmann , Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org References: <20200714214516.GA1040@embeddedor> From: "Gustavo A. R. Silva" Autocrypt: addr=gustavo@embeddedor.com; keydata= xsFNBFssHAwBEADIy3ZoPq3z5UpsUknd2v+IQud4TMJnJLTeXgTf4biSDSrXn73JQgsISBwG 2Pm4wnOyEgYUyJd5tRWcIbsURAgei918mck3tugT7AQiTUN3/5aAzqe/4ApDUC+uWNkpNnSV tjOx1hBpla0ifywy4bvFobwSh5/I3qohxDx+c1obd8Bp/B/iaOtnq0inli/8rlvKO9hp6Z4e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UMebQRFjKavw XB/xE7fTt2ahuhHT8qQ/lWuRQedg4baInw9nhoPE+VenOzhGeGlsJ0Ys52sdXvUjUocKgUQq 6ekOHbcw919nO5L9J2ejMf/VC/quN3r3xijgRtmuuwZjmmi8ct24TpGeoBK4WrZGh/1hAYw4 ieARvKvgjXRstcEqM5thUNkOOIheud/VpY+48QcccPKbngy//zNJWKbRbeVnimua0OpqRXhC rEVm/xomeOvl1WK1BVO7z8DjSdEBGzbV76sPDJb/fw+y+VWrkEiddD/9CSfgfBNOb1p1jVnT 2mFgGneIWbU0zdDGhleI9UoQTr0e0b/7TU+Jo6TqwosP9nbk5hXw6uR5k5PF8ieyHVq3qatJ 9K1jPkBr8YWtI5uNwJJjTKIA1jHlj8McROroxMdI6qZ/wZ1ImuylpJuJwCDCORYf5kW61fcr HEDlIvGc371OOvw6ejF8ksX5+L2zwh43l/pKkSVGFpxtMV6d6J3eqwTafL86YJWH93PN+ZUh 6i6Rd2U/i8jH5WvzR57UeWxE4P8bQc0hNGrUsHQH6bpHV2lbuhDdqo+cM9ehGZEO3+gCDFmK rjspZjkJbB5Gadzvts5fcWGOXEvuT8uQSvl+vEL0g6vczsyPBtqoBLa9SNrSVtSixD1uOgyt AP7RWS474w== Message-ID: <5198b29f-2e62-4910-4a4d-52c7991915c5@embeddedor.com> Date: Wed, 22 Jul 2020 13:27:10 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200714214516.GA1040@embeddedor> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 201.166.157.48 X-Source-L: No X-Exim-ID: 1jyJMw-000Wnz-BS X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: ([192.168.43.132]) [201.166.157.48]:39362 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 9 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, Friendly ping: who can take this? :) Thanks -- Gustavo On 7/14/20 16:45, Gustavo A. R. Silva wrote: > One-element arrays are being deprecated[1]. Replace the one-element > arrays with a simple value type u8 reserved, once this is just a > placeholder for alignment. > > Also, while there, use the preferred form for passing a size of a struct. > The alternative form where struct name is spelled out hurts readability > and introduces an opportunity for a bug when the variable type is changed > but the corresponding sizeof that is passed as argument is not. > > [1] https://github.com/KSPP/linux/issues/79 > > Signed-off-by: Gustavo A. R. Silva > --- > Changes in v2: > - Use a more concise changelog text. > > drivers/misc/mei/hbm.c | 4 ++-- > drivers/misc/mei/hw.h | 6 +++--- > 2 files changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/misc/mei/hbm.c b/drivers/misc/mei/hbm.c > index a44094cdbc36..f020d5594154 100644 > --- a/drivers/misc/mei/hbm.c > +++ b/drivers/misc/mei/hbm.c > @@ -408,14 +408,14 @@ static int mei_hbm_add_cl_resp(struct mei_device *dev, u8 addr, u8 status) > { > struct mei_msg_hdr mei_hdr; > struct hbm_add_client_response resp; > - const size_t len = sizeof(struct hbm_add_client_response); > + const size_t len = sizeof(resp); > int ret; > > dev_dbg(dev->dev, "adding client response\n"); > > mei_hbm_hdr(&mei_hdr, len); > > - memset(&resp, 0, sizeof(struct hbm_add_client_response)); > + memset(&resp, 0, len); > resp.hbm_cmd = MEI_HBM_ADD_CLIENT_RES_CMD; > resp.me_addr = addr; > resp.status = status; > diff --git a/drivers/misc/mei/hw.h b/drivers/misc/mei/hw.h > index b1a8d5ec88b3..8c0297f0e7f3 100644 > --- a/drivers/misc/mei/hw.h > +++ b/drivers/misc/mei/hw.h > @@ -346,13 +346,13 @@ struct hbm_add_client_request { > * @hbm_cmd: bus message command header > * @me_addr: address of the client in ME > * @status: if HBMS_SUCCESS then the client can now accept connections. > - * @reserved: reserved > + * @reserved: reserved for alignment. > */ > struct hbm_add_client_response { > u8 hbm_cmd; > u8 me_addr; > u8 status; > - u8 reserved[1]; > + u8 reserved; > } __packed; > > /** > @@ -461,7 +461,7 @@ struct hbm_notification { > u8 hbm_cmd; > u8 me_addr; > u8 host_addr; > - u8 reserved[1]; > + u8 reserved; > } __packed; > > /** >