Received: by 2002:ab2:7041:0:b0:1f4:bcc8:f211 with SMTP id x1csp185568lql; Fri, 12 Apr 2024 07:30:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUHgGth1/IGHNU+Sayt6/6GKP78KdJK4gt4WHFlcKOazwm5zEAA7G61XcQRFj6/mb/LB3FBY9O8Q/cmr2PzGyIyFKFpBUirLwM0IICmXw== X-Google-Smtp-Source: AGHT+IF/+qPpt2+OZ+6nM0ksF+YAgy8Qh5LEUlSzkwFbw5Wxy4VO8qfudDnarXFX4r+vEckGqbwE X-Received: by 2002:a05:6a00:10cc:b0:6ed:21c0:986c with SMTP id d12-20020a056a0010cc00b006ed21c0986cmr2964234pfu.24.1712932221643; Fri, 12 Apr 2024 07:30:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712932221; cv=pass; d=google.com; s=arc-20160816; b=RK7V2yfcg7k4hDxQihDjdz842JCJ6mXSCkqmHTetYfO2cauCL7s9qebP+sw3cP5LRN Gjb1IoS8p2O29KdFctE/16NLKiLcZ9ssIEuLFrb4hA5YPJ3VuR6ZW2Vb3scb6HpDxkZm aFaX236ENSaRNtLCAgpATsfo3GLTqXY0q2jtD5ycEJIxCD9SgTHd7YEj4oVBvf6M1NL0 t4VN8Xs2iMAT/PDSdytLKBBZPstqVY/2c4lmNkT7mYhWbDVDHSqyYY7EUz8dYUi53aEi SBeoIc2s6NGppHKd7jcp6MQEipeK+aWR3Rj+gbKaoEFJD5/s7YHZDZ4vVyluho25KL8R cKCg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=5UN8CcJ3P6KOlYZX2J9189th3N84uReUnriG7dDk314=; fh=su4FuyJ/ZKXgHQ6G0P8E9LTS+aC62i2VCpkPCl3O9kk=; b=AyjXIhw6Ke+XJeGjnFliFrL4nsKAb8LakbazkGzFpAY8G54igTv+wfrZzsV2LYL8NZ 9zR7p+7YsWPCq6BrQWYkQr+AZeA2wfJhag6ROtfkjWCRhZWmq8eVbdHfV2UrYAKf1OL3 Ul1cII4RYh2CKhi6swDE7sj47+OtDMoQXnQHCVgxr2qICyHPT6JJou+KeM6NmLEHmtty z5xLkOfm4jv/7618jr6QRmZvr7VvdcFLRIS19JbG/jDR6lhMrrt8RZZfbBzUeQQi5tSG 8y/rIQDjGR2r8sHkwOSTswtBW4Htd2qVQHiaLrAtSBkzSCFhMxkv/oBbEpbWNHvgkhTu ZKmg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-142813-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142813-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xs4all.nl Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id s19-20020a63dc13000000b005df469b4f7asi3348261pgg.489.2024.04.12.07.30.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 07:30:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-142813-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-142813-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142813-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xs4all.nl Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 36C48B25174 for ; Fri, 12 Apr 2024 14:22:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 94B698626D; Fri, 12 Apr 2024 14:21:43 +0000 (UTC) Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1779C55E4A; Fri, 12 Apr 2024 14:21:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712931703; cv=none; b=IfoXcL8CAw2RLpBpqjqCTsWPQbyE0SR0RGpWH8zAeIBjt4puXaLi/gB4J5ho/iNd3SaZ9q/lKmmL32aQKlRorYjOobOgYSLpKscPB0t+Nam62JgNf/dnk1ptOdtQJ1NkA8mYsHhCcRdtPjLxiQUbnZcOTzIeSFzZb1ox2Xs59ho= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712931703; c=relaxed/simple; bh=eMcIJ2tYDEaveTSh0VFnC7/4Ol3w4LLuM1Dwojb9NWQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=GhDulPo8k2gkehVre4ZrJk7coWs5Zu+YuR8niXlJRpQLYoa67Zg4be52+YUvcQBRoqdXlidQPEC5vytz4yTVB6cu5jBcqF/ckfsqkghKo1QsN3I1eksANkkvhQPmO/HHBnLKwz2x9sKF2c/519vBCtHYV2khSzOZvFGBDzSviQw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 98461C113CC; Fri, 12 Apr 2024 14:21:41 +0000 (UTC) Message-ID: Date: Fri, 12 Apr 2024 16:21:40 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/3] media: dvb: Fix dtvs_stats packing. Content-Language: en-US, nl To: Ricardo Ribalda , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240410-pack-v1-0-70f287dd8a66@chromium.org> <20240410-pack-v1-2-70f287dd8a66@chromium.org> From: Hans Verkuil In-Reply-To: <20240410-pack-v1-2-70f287dd8a66@chromium.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 10/04/2024 14:24, Ricardo Ribalda wrote: > The structure is packed, which requires that all its fields need to be > also packed. > > ./include/uapi/linux/dvb/frontend.h:854:2: warning: field within 'struct dtv_stats' is less aligned than 'union dtv_stats::(anonymous at ./include/uapi/linux/dvb/frontend.h:854:2)' and is usually due to 'struct dtv_stats' being packed, which can lead to unaligned accesses [-Wunaligned-access] > > Explicitly set the inner union as packed. > > Signed-off-by: Ricardo Ribalda > --- > include/uapi/linux/dvb/frontend.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/uapi/linux/dvb/frontend.h b/include/uapi/linux/dvb/frontend.h > index 7e0983b987c2d..8d38c6befda8d 100644 > --- a/include/uapi/linux/dvb/frontend.h > +++ b/include/uapi/linux/dvb/frontend.h > @@ -854,7 +854,7 @@ struct dtv_stats { > union { > __u64 uvalue; /* for counters and relative scales */ > __s64 svalue; /* for 0.001 dB measures */ > - }; > + } __attribute__ ((packed)); > } __attribute__ ((packed)); This is used in the public API, and I think this change can cause ABI changes. Can you compare the layouts? Also between gcc and llvm since gcc never warned about this. I'm not going to accept this unless it is clear that there are no ABI changes. Note that the ABI test in the build scripts only tests V4L2 at the moment, not the DVB API. Regards, Hans