From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C89AC07E95 for ; Fri, 16 Jul 2021 11:41:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 06ECB613F6 for ; Fri, 16 Jul 2021 11:41:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232690AbhGPLoM (ORCPT ); Fri, 16 Jul 2021 07:44:12 -0400 Received: from mga05.intel.com ([192.55.52.43]:23836 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231386AbhGPLoF (ORCPT ); Fri, 16 Jul 2021 07:44:05 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10046"; a="296361729" X-IronPort-AV: E=Sophos;i="5.84,244,1620716400"; d="scan'208";a="296361729" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jul 2021 04:41:09 -0700 X-IronPort-AV: E=Sophos;i="5.84,244,1620716400"; d="scan'208";a="573640178" Received: from paasikivi.fi.intel.com ([10.237.72.42]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jul 2021 04:41:07 -0700 Received: from paasikivi.fi.intel.com (localhost [127.0.0.1]) by paasikivi.fi.intel.com (Postfix) with SMTP id 41509204C0; Fri, 16 Jul 2021 14:41:05 +0300 (EEST) Date: Fri, 16 Jul 2021 14:41:05 +0300 From: Sakari Ailus To: Andy Shevchenko Cc: kernel test robot , Nick Desaulniers , clang-built-linux , kbuild-all@lists.01.org, Linux Kernel Mailing List , Thomas Zimmermann , Petr Mladek , Andy Shevchenko Subject: Re: drivers/media/v4l2-core/v4l2-ioctl.c:303:28: warning: taking address of packed member 'pixelformat' of class or structure 'v4l2_pix_format_mplane' may result in an unaligned pointer value Message-ID: <20210716114105.GF3@paasikivi.fi.intel.com> References: <202107150148.RpWnKapX-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andy, On Wed, Jul 14, 2021 at 10:45:26PM +0300, Andy Shevchenko wrote: > > >> drivers/media/v4l2-core/v4l2-ioctl.c:347:37: warning: taking address of packed member 'pixelformat' of class or structure 'v4l2_sdr_format' may result in an unaligned pointer value [-Waddress-of-packed-member] > > Why is it packed in the first place? Is it used on unaligned addresses > in other structures? But even so, why should it matter? It's packed since we wanted to avoid having holes in the structs. There are other ways to do that but it's ABI dependent and is prone to human errors, too. -- Sakari Ailus