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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6E936C433F5 for ; Mon, 8 Nov 2021 12:08:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5B7B46120D for ; Mon, 8 Nov 2021 12:08:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239409AbhKHMLf (ORCPT ); Mon, 8 Nov 2021 07:11:35 -0500 Received: from mga05.intel.com ([192.55.52.43]:8780 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239399AbhKHMLe (ORCPT ); Mon, 8 Nov 2021 07:11:34 -0500 X-IronPort-AV: E=McAfee;i="6200,9189,10161"; a="318411634" X-IronPort-AV: E=Sophos;i="5.87,218,1631602800"; d="scan'208";a="318411634" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Nov 2021 04:08:48 -0800 X-IronPort-AV: E=Sophos;i="5.87,218,1631602800"; d="scan'208";a="502992384" Received: from chenyu-desktop.sh.intel.com (HELO chenyu-desktop) ([10.239.158.186]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Nov 2021 04:08:44 -0800 Date: Mon, 8 Nov 2021 20:08:00 +0800 From: Chen Yu To: Andy Shevchenko Cc: linux-acpi@vger.kernel.org, Greg Kroah-Hartman , "Rafael J. Wysocki" , Ard Biesheuvel , Len Brown , Ashok Raj , Mike Rapoport , Aubrey Li , linux-kernel@vger.kernel.org Subject: Re: [PATCH v8 2/4] drivers/acpi: Introduce Platform Firmware Runtime Update device driver Message-ID: <20211108120800.GA619906@chenyu-desktop> References: <01f8f7d23926dcdb054e5ac170ddcbbdb0aed560.1635953446.git.yu.c.chen@intel.com> <20211106151456.GA570347@chenyu-desktop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org On Mon, Nov 08, 2021 at 11:20:22AM +0200, Andy Shevchenko wrote: > On Sat, Nov 06, 2021 at 11:14:56PM +0800, Chen Yu wrote: > > On Wed, Nov 03, 2021 at 07:32:09PM +0200, Andy Shevchenko wrote: > > > On Wed, Nov 03, 2021 at 11:43:50PM +0800, Chen Yu wrote: > > ... > > > > > +enum cap_index { > > > > + CAP_STATUS_IDX = 0, > > > > + CAP_UPDATE_IDX = 1, > > > > + CAP_CODE_TYPE_IDX = 2, > > > > + CAP_FW_VER_IDX = 3, > > > > + CAP_CODE_RT_VER_IDX = 4, > > > > + CAP_DRV_TYPE_IDX = 5, > > > > + CAP_DRV_RT_VER_IDX = 6, > > > > + CAP_DRV_SVN_IDX = 7, > > > > + CAP_PLAT_ID_IDX = 8, > > > > + CAP_OEM_ID_IDX = 9, > > > > + CAP_OEM_INFO_IDX = 10, > > > > > > > + CAP_NR_IDX = 11 > > > > > > Assignment here doesn't make any sense (it just adds unneeded churn and > > > burden). Same to the rest of similar cases below. > > > > > Greg mentioned that, we might need to "explicit about the numbers here, because it > > is uncerntain this is guaranteed by all C compilers or not." > > https://lore.kernel.org/lkml/YXj+QaMcCeV71XbI@kroah.com/ > > My understanding is that, this applys to both uapi headers and the kernel internal > > headers. > > I was talking only about the last item. This is guaranteed to be LAST+1 by the > C standard and any deviation from that is a compiler bug that must be fixed. > > The first elements may be explicitly defined so we will be sure they are always > stay. Greg is right about it. > Ok, got it. Previously I've sent a v9 patch set that addressed the issues in v8, except for this enum issue. I'll wait for a day or two, if there is no further comments on v9, I'll send a refreshed v10 with this enum issue fixed. thanks, Chenyu