From patchwork Thu Feb 22 18:45:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 1902919 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TghsS11r1z23d2 for ; Fri, 23 Feb 2024 05:45:15 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1rdE49-00014H-Ol; Thu, 22 Feb 2024 18:45:05 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1rdE46-000142-Iz for kernel-team@lists.ubuntu.com; Thu, 22 Feb 2024 18:45:02 +0000 Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 5C7573F516 for ; Thu, 22 Feb 2024 18:45:02 +0000 (UTC) Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-a3f865db87aso2414566b.1 for ; Thu, 22 Feb 2024 10:45:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708627502; x=1709232302; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=fLJqklg5c6VM4tbR7udK3/HQY+rC13RwxA641M1zAUs=; b=PZ3mhsjxV8jaVmxBvt3XclQo9byWWAtI+MPxstjpDuRZMiZitktYJePah5hS4SvGJX xLSwX04mN4HpGmsG4GmnNtvu0xYFrVeBNj3Pq3580vA3r4KspmLBGt8XkWuGrGGDp7hZ 3tWtj/+rzJmVCibEc6foDuT/lgZWrVOMbmJhruKzaS+B+E/pElWdTl3xGVgwbMdf7693 /x3TNP5G1K2D4euTG34JGZaN/fEYCl43ysV8pX7m0/LnNxZ6vVRLhqE5H7CX34mhgi6Q rDQbNN6mUDvwA0z1+QM9ozuzn+h5W7UhEvOA/tu1nfreGRRbi2ZiUn0mWIKQ4bK2CKiQ BVFQ== X-Gm-Message-State: AOJu0Yzm7QMciWroyEYtQ05kpLS3qw43ixrAfgJeehNAx0HuU1jGCAzz mUr/39qvoaTKdNTZwAk85qOARC0GyH6XA2+4dotrwOC1bq/lTxs4XclU4qsrLwoyNHBaITD2yIE m8PlyP2m3cGwM/4cE3xpcYuZvUUZOyvo7XQPPlHCJcAIdjryTdsfR8TURPo9HJIOKhJSubj01ey SArcGxFXDJBw== X-Received: by 2002:a17:906:57ca:b0:a3f:ce8:1234 with SMTP id u10-20020a17090657ca00b00a3f0ce81234mr5968360ejr.68.1708627502136; Thu, 22 Feb 2024 10:45:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IEVph+aDb7dpQ3RRNpYbIYt7GBMK8dnGNStre6CSlrDy9PUkI1QFgbHvOnB1qBgHi717d+oXQ== X-Received: by 2002:a17:906:57ca:b0:a3f:ce8:1234 with SMTP id u10-20020a17090657ca00b00a3f0ce81234mr5968349ejr.68.1708627501859; Thu, 22 Feb 2024 10:45:01 -0800 (PST) Received: from localhost ([81.221.247.52]) by smtp.gmail.com with ESMTPSA id vo2-20020a170907a80200b00a3f6eafd7e5sm1097660ejc.11.2024.02.22.10.45.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 10:45:01 -0800 (PST) From: Juerg Haefliger To: kernel-team@lists.ubuntu.com Subject: [Unstable/N][PATCH] UBUNTU: SAUCE: modpost: Replace 0-length array with flex-array member Date: Thu, 22 Feb 2024 19:45:00 +0100 Message-Id: <20240222184500.876596-1-juerg.haefliger@canonical.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" Fake flexible arrays (zero-length and one-element arrays) are deprecated, and should be replaced by flexible-array members. This fixes the following compiler warning: CC kernel/module/version.o ../kernel/module/version.c: In function 'check_version': ../kernel/module/version.c:37:21: warning: 'strcmp' reading 1 or more bytes from a region of size 0 [-Wstringop-overread] 37 | if (strcmp(versions->name, symname) != 0) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from ../kernel/module/version.c:8: ../include/linux/module.h:41:14: note: source object 'name' of size 0 41 | char name[0]; | ^~~~ Fixes: 08bc01030daa ("UBUNTU: SAUCE: modpost: support arbitrary symbol length in modversion") Signed-off-by: Juerg Haefliger --- include/linux/module.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/module.h b/include/linux/module.h index 20b1e8429656..382f2d73afa9 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -38,7 +38,7 @@ struct modversion_info { /* Offset of the next modversion entry in relation to this one. */ u32 next; u32 crc; - char name[0]; + char name[]; /* Flexible array member */ } __packed; struct module;