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=-0.7 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 DB0EBC07E95 for ; Fri, 16 Jul 2021 12:12:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C414A613C3 for ; Fri, 16 Jul 2021 12:12:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232672AbhGPMPX (ORCPT ); Fri, 16 Jul 2021 08:15:23 -0400 Received: from mga02.intel.com ([134.134.136.20]:21005 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238234AbhGPMPP (ORCPT ); Fri, 16 Jul 2021 08:15:15 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10046"; a="197908713" X-IronPort-AV: E=Sophos;i="5.84,244,1620716400"; d="scan'208";a="197908713" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jul 2021 05:12:20 -0700 X-IronPort-AV: E=Sophos;i="5.84,244,1620716400"; d="scan'208";a="631056040" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jul 2021 05:12:18 -0700 Received: from andy by smile with local (Exim 4.94.2) (envelope-from ) id 1m4MhP-00EDdj-Lk; Fri, 16 Jul 2021 15:12:11 +0300 Date: Fri, 16 Jul 2021 15:12:11 +0300 From: Andy Shevchenko To: Sakari Ailus Cc: kernel test robot , Nick Desaulniers , clang-built-linux , kbuild-all@lists.01.org, Linux Kernel Mailing List , Thomas Zimmermann , Petr Mladek 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: References: <202107150148.RpWnKapX-lkp@intel.com> <20210716114105.GF3@paasikivi.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210716114105.GF3@paasikivi.fi.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 16, 2021 at 02:41:05PM +0300, Sakari Ailus wrote: > 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. What holes can you think about in the above mention structure? In case if you are going to extend it you will need anyway changes somewhere else as well. -- With Best Regards, Andy Shevchenko