From patchwork Thu Apr 6 14:28:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gustavo A. R. Silva" X-Patchwork-Id: 80265 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1071571vqo; Thu, 6 Apr 2023 07:31:38 -0700 (PDT) X-Google-Smtp-Source: AKy350ZAL0zMZpTjq8aBMOsZDdRbC0CB2qi8f8zwouJpXypdfpD4q//pBuAuFJewnWHCOzXlHqPI X-Received: by 2002:a17:906:f9c6:b0:921:5cce:6599 with SMTP id lj6-20020a170906f9c600b009215cce6599mr7118307ejb.41.1680791498079; Thu, 06 Apr 2023 07:31:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680791498; cv=none; d=google.com; s=arc-20160816; b=RCjve1nQWbkjMpJ+aTS5YENCN2+CYfc86jsRJrMkmygJFvQ3X9CJR6vkDw8ibUiRSW P52lFmKCSTJRUVdT0XNWjULgYn06BiSHIzcnH+E2So1XEXZs7zCB6aSlyoLdwIplEWrK NgOK7Fng1SE/2+sX1I1rLHmmBZLrcNXWnrG6voLJQWitjUoGWCCGntUhhlNhZpJK43CX X2rhZlUUqOf+UpN+O/00OhmtN3Y8bx2gmcGkSwT8SDqw2b+vxSWtHWKiM+f+9XstG77I SCYwhxAwbpvtrmgO/qRw1gHTlIsgsiLI0C0R/ME4YDKdyObvYucv5b3wldAeO9Mh23F5 7SFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=BKnwZc4lb3QTRF9F1YrEg5AX+red/Ux7PYCk59Gubyo=; b=Slz68YEZxjuotHaVmU94ufl/6cJ691E+DUl+kEvZ1OReZy9/tiOhPRDZnT7NrGz3xC 8FvBNhBDz9Rbe0sVmOWovweXFjp3eYLttVcRE7BlFXiU3xhqtBuepVZyWJ4+9AG6b/Wq bHEg6tR7YRTK1waLgkBPc6Zg/Q7g1PGFKLnIQ2Z6hGktJx6pCAxbjkWheKSkSPkmbJKz 6X2Hx+gOc08TgjQBSxLrWt7IRxXK3/hPbI8QRcOI+X0zbGBJXgomzKrTZn7VqauFbOnl Y/7dgLuXYi+aoKFWXF4qfmH6D6uDK1XWWVQwZljAJtGapIifooo4ftoqOdG6smvCuZ5F KlQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Zz13cmWj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id rp7-20020a170906d96700b0092606831159si1290593ejb.413.2023.04.06.07.31.12; Thu, 06 Apr 2023 07:31:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Zz13cmWj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239056AbjDFO2M (ORCPT + 99 others); Thu, 6 Apr 2023 10:28:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238965AbjDFO2K (ORCPT ); Thu, 6 Apr 2023 10:28:10 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 926408A51; Thu, 6 Apr 2023 07:28:09 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2F23B6450C; Thu, 6 Apr 2023 14:28:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9B733C4339B; Thu, 6 Apr 2023 14:28:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680791288; bh=jhxfiG+JEN/B7SPCpeaq7cxeMMnz6qoyQOvS5SSFFt0=; h=Date:From:To:Cc:Subject:From; b=Zz13cmWj82aEGrHXBsUl6d2i6L41xOIQlyFWVqKmFZgKD6M904c1r218ROElrMQ9e zFaFbH958fBz/SaFcIwTI83FUGr8lFbeRg8emfKkWGRKE6uB/VH5w7FFUyaBzH/Oyg LBEL0vghIj5G5axIRSasIhhO99Vz25g0l/hYW2Lbzfc/DRcQSv+uHMIhAVcNCItb6x js09de36T1/ugJkwXO/LOwudjUuzWWWZrWSwKQzJXpXlEzP5a+tI7YbjsEg1OZ07pw 3EY8sNNdLZEN+/MrUTpXavu0ePj+aNWo/5sToRYMtvT7MDhnzF6t5QPDnPVHB+01tO JA46rB1hJyiiQ== Date: Thu, 6 Apr 2023 08:28:42 -0600 From: "Gustavo A. R. Silva" To: Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle Cc: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" , linux-hardening@vger.kernel.org Subject: [PATCH][next] s390/diag: Replace zero-length array with flexible-array member Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762437625573045934?= X-GMAIL-MSGID: =?utf-8?q?1762437625573045934?= Zero-length arrays are deprecated [1] and have to be replaced by C99 flexible-array members. This helps with the ongoing efforts to tighten the FORTIFY_SOURCE routines on memcpy() and help to make progress towards globally enabling -fstrict-flex-arrays=3 [2] Link: https://github.com/KSPP/linux/issues/78 [1] Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html [2] Signed-off-by: Gustavo A. R. Silva --- arch/s390/include/asm/diag.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/s390/include/asm/diag.h b/arch/s390/include/asm/diag.h index 674a939f16ee..902e0330dd91 100644 --- a/arch/s390/include/asm/diag.h +++ b/arch/s390/include/asm/diag.h @@ -90,7 +90,7 @@ struct diag8c { u8 num_partitions; u16 width; u16 height; - u8 data[0]; + u8 data[]; } __packed __aligned(4); extern int diag8c(struct diag8c *out, struct ccw_dev_id *devno);