From patchwork Tue Nov 22 13:35:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 24378 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2205849wrr; Tue, 22 Nov 2022 05:43:45 -0800 (PST) X-Google-Smtp-Source: AA0mqf5s9+BF/yVlXG+IRbnpX1L8GYjaze2ISgF6TwZ+qPyG8Nk1B7gEc4bMLXIgjTe4GUOohxE7 X-Received: by 2002:a17:907:c208:b0:7ad:79c0:547a with SMTP id ti8-20020a170907c20800b007ad79c0547amr9782812ejc.41.1669124625271; Tue, 22 Nov 2022 05:43:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669124625; cv=none; d=google.com; s=arc-20160816; b=GCmDjwcPL8IajmyLrJQCax+HwLtxVDs99SGiYrhbuzvcqcVufqsscLTjUtb0bd3OR3 +p4zAW7NXw//15WsduWRpl6zxWQXMu/JCrW3KaSiJG+3uJRTXAVCPG7HxanPWbSrvLMY WVnFdwNpCXCptcmknoRGk8EXOweAFiZ5eMC1B5GMR6fdUZyutLKcgf1Z79jpmwPNUq6F FJVkyO8Smu3bHMH/0slQYUOxPhD7RFrY8CdDAsXnYSwN9RY5gMOj/HxL113T+q2I0daB ys3aSTuJ2oBcg+kRyPPd04C7v+mVuJGjbIEsn/mO00SzcBSQjQY+xw3yErvcPbiL+c+q B74w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=QR6VfoswH2N0Pc3TKbq7MeKrs/jjZw3HZLh2PTXn/SY=; b=oSl+k+6ZBGnbDWX5Ko/NtpjYWAF9KIqJFAnJvl8Q/Qo+jFNQJIRa2IpqoitbJvLbOf cNeGDed/FvYfamTgWSOQf8sKqOJh7Ma1QFmMDW/XPVuktpAKPbuXDRszBBeo1Kq+b/MD 77GGDJ3OUekcj8vP+rBMMYvWYCPa7XfzhF7uRnHkRFXI2FuBxPsaIPfNlOaIgQtV86Kd oi11ZNj/G6FedfQF+abvWO3uVI1jIK7OMf4GH/JYyZ1xJweG3Oaxdm7K4bsmGCFiXzhA j68xzxcAQsdvS3VcswqjWwaGJF7eHSRBdYNrO2Nvys6FsQCsCy5C5BTYNJosd3XB1F4P SewQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="eXv/2YFr"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s23-20020a05640217d700b004692dec65dbsi8226646edy.259.2022.11.22.05.43.21; Tue, 22 Nov 2022 05:43:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="eXv/2YFr"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233829AbiKVNgB (ORCPT + 99 others); Tue, 22 Nov 2022 08:36:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232891AbiKVNfn (ORCPT ); Tue, 22 Nov 2022 08:35:43 -0500 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10DD451C26; Tue, 22 Nov 2022 05:35:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669124143; x=1700660143; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=buFbMo2ULium7j74ddZOqvKKRSi8X7Y7FsUFsVFRKHQ=; b=eXv/2YFrGUTpIdR3r0Aqpa44f8+e1uhNfvyDQGdOzE2Pr/5Sl35YrNvJ SkOuk6BlSQ5B/aHLl1F/HOQdAMStP0N3PyZa0oKjSBhdTZJ5gMzCAPD39 0mqejyxzgr5A8x+SlI+NLyfVoDZ1OktonVQVeXXYHu2A8ym2mBT7Uu6OI p58jQ7WEvnpqXYd5FFhCm9M9vNGPy5gZjDrvhKd01XeZM7bqSerfaBYJb g7lkHKAh1LRuqYhVKxf1xKqgYvZcR60U3C3FWQ2DTic5fw/3psbA05N4w 6ZHHHUZGTuXlMTpVQU6EV23CCEVwRNOtOqGt8RL3E2SJe7dJ/v6x5X1Yx Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10538"; a="311442548" X-IronPort-AV: E=Sophos;i="5.96,184,1665471600"; d="scan'208";a="311442548" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2022 05:35:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10538"; a="672484472" X-IronPort-AV: E=Sophos;i="5.96,184,1665471600"; d="scan'208";a="672484472" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga008.jf.intel.com with ESMTP; 22 Nov 2022 05:35:38 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 6364B128; Tue, 22 Nov 2022 15:36:04 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Heikki Krogerus , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Daniel Scally , Sakari Ailus , Greg Kroah-Hartman , "Rafael J. Wysocki" Subject: [PATCH v4 1/4] device property: Get rid of __PROPERTY_ENTRY_ARRAY_EL*SIZE*() Date: Tue, 22 Nov 2022 15:35:57 +0200 Message-Id: <20221122133600.49897-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750204022823459749?= X-GMAIL-MSGID: =?utf-8?q?1750204022823459749?= First of all, _ELEMENT_SIZE() repeats existing sizeof_field() macro. Second, usage of _ARRAY_ELSIZE_LEN() adds unnecessary indirection to the data layout. It's more understandable when the data structure is placed explicitly. That said, get rid of those macros by replacing them with the existing helper and explicit data structure layout. Signed-off-by: Andy Shevchenko Acked-by: Heikki Krogerus --- v4: added tag (Heikki) v3: fixed typo in PROPERTY_ENTRY_REF_ARRAY_LEN() impl (LKP) v2: rebased on latest Linux Next, fixed anon union assignment include/linux/property.h | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/include/linux/property.h b/include/linux/property.h index 5d840299146d..0eab13a5c7df 100644 --- a/include/linux/property.h +++ b/include/linux/property.h @@ -12,6 +12,7 @@ #include #include +#include #include struct device; @@ -311,24 +312,14 @@ struct property_entry { * crafted to avoid gcc-4.4.4's problems with initialization of anon unions * and structs. */ - -#define __PROPERTY_ENTRY_ELEMENT_SIZE(_elem_) \ - sizeof(((struct property_entry *)NULL)->value._elem_[0]) - -#define __PROPERTY_ENTRY_ARRAY_ELSIZE_LEN(_name_, _elsize_, _Type_, \ - _val_, _len_) \ -(struct property_entry) { \ - .name = _name_, \ - .length = (_len_) * (_elsize_), \ - .type = DEV_PROP_##_Type_, \ - { .pointer = _val_ }, \ +#define __PROPERTY_ENTRY_ARRAY_LEN(_name_, _elem_, _Type_, _val_, _len_) \ +(struct property_entry) { \ + .name = _name_, \ + .length = (_len_) * sizeof_field(struct property_entry, value._elem_[0]), \ + .type = DEV_PROP_##_Type_, \ + { .pointer = _val_ }, \ } -#define __PROPERTY_ENTRY_ARRAY_LEN(_name_, _elem_, _Type_, _val_, _len_)\ - __PROPERTY_ENTRY_ARRAY_ELSIZE_LEN(_name_, \ - __PROPERTY_ENTRY_ELEMENT_SIZE(_elem_), \ - _Type_, _val_, _len_) - #define PROPERTY_ENTRY_U8_ARRAY_LEN(_name_, _val_, _len_) \ __PROPERTY_ENTRY_ARRAY_LEN(_name_, u8_data, U8, _val_, _len_) #define PROPERTY_ENTRY_U16_ARRAY_LEN(_name_, _val_, _len_) \ @@ -340,9 +331,12 @@ struct property_entry { #define PROPERTY_ENTRY_STRING_ARRAY_LEN(_name_, _val_, _len_) \ __PROPERTY_ENTRY_ARRAY_LEN(_name_, str, STRING, _val_, _len_) #define PROPERTY_ENTRY_REF_ARRAY_LEN(_name_, _val_, _len_) \ - __PROPERTY_ENTRY_ARRAY_ELSIZE_LEN(_name_, \ - sizeof(struct software_node_ref_args), \ - REF, _val_, _len_) +(struct property_entry) { \ + .name = _name_, \ + .length = (_len_) * sizeof(struct software_node_ref_args), \ + .type = DEV_PROP_REF, \ + { .pointer = _val_ }, \ +} #define PROPERTY_ENTRY_U8_ARRAY(_name_, _val_) \ PROPERTY_ENTRY_U8_ARRAY_LEN(_name_, _val_, ARRAY_SIZE(_val_)) @@ -360,7 +354,7 @@ struct property_entry { #define __PROPERTY_ENTRY_ELEMENT(_name_, _elem_, _Type_, _val_) \ (struct property_entry) { \ .name = _name_, \ - .length = __PROPERTY_ENTRY_ELEMENT_SIZE(_elem_), \ + .length = sizeof_field(struct property_entry, value._elem_[0]), \ .is_inline = true, \ .type = DEV_PROP_##_Type_, \ { .value = { ._elem_[0] = _val_ } }, \ From patchwork Tue Nov 22 13:35:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 24376 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2205823wrr; Tue, 22 Nov 2022 05:43:40 -0800 (PST) X-Google-Smtp-Source: AA0mqf7RtAjv3Ef6almqO3BEfmmtyvJKottgymsV4RMui/RyTvxkEZ1nSRTRr1vpVHDVXbYrTVDK X-Received: by 2002:a17:906:a291:b0:782:9b27:94aa with SMTP id i17-20020a170906a29100b007829b2794aamr18932791ejz.542.1669124620639; Tue, 22 Nov 2022 05:43:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669124620; cv=none; d=google.com; s=arc-20160816; b=HC0IFflyQ1yy3idfbqqr0m0zSbOhjHmraFGLL56ZmLb7zkuszwZHrHvPU04/wiSqLL on4YOgSxRVlZGuflLbPhujW53/ya59xLSxmSkbJdJdSF/bQCCCpCtGFiu5WS5Msx0UYT 1GUPHRdBAX0JSOiVfwZxQsMVHoAMpMFJfnVyp8RFWqumyLdhXFsPMvV/pdhiKvj+HCOn HHS6lU1VJD1ZjYi1Iu4ExE1jX/7J8U17yG50Ha/ngVl21BXg7MWY+TlxVaB4kSXT6u7m qPKwn0YfPtYiDu3LgCiBtx3pRXuDWVYsXKv6zmy2eAV1QmbWEI+jsytR2FtBpUETrMBY 4ehw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=/7OyR+IjIRRjgojIjPIuSyhGX9yCW5NFDncA28XJUmE=; b=ZnfoR264ZfbxRla6EW0jH6fvYNJ2VODw3FDufeEToWMXIeu2aVeKUaw+6APV7tHZNK gw9xJCBAJuvp4E4khRSFz5dLo1kXAW2wjabZx1HLAMhTMxlbXPJ/LT0hJHh3udKu9Yi7 QwrhstcPpguZe4PNU130XgWWRXiNca6zUx/LNXnEb0gMtmQtbVjkNdfwcHc2oFnZqgfQ ca4nZJKrgJHcVLEuiF+883GfUJ0If4DL8MulAjfnCHW1s8eWGcimoTdgMU+8WP87L3BF EsACxxNI59Hmgfl0S7yGPmjgXccg57qBSlgN41oCTcMBhCgFD0BiMWBI/e/nos5u3F2U uplw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=gVgYLCTD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b13-20020a056402350d00b004636ec90769si13032043edd.33.2022.11.22.05.43.16; Tue, 22 Nov 2022 05:43:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=gVgYLCTD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233814AbiKVNfy (ORCPT + 99 others); Tue, 22 Nov 2022 08:35:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232654AbiKVNfn (ORCPT ); Tue, 22 Nov 2022 08:35:43 -0500 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2444C64A3B; Tue, 22 Nov 2022 05:35:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669124143; x=1700660143; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=fGu2hTzlLDo6mDb92nh0Ze6X0ZVQ7fgf0cePRRQXgwg=; b=gVgYLCTDurcUypLwCoQ8NXrBXSnNVPzckb8sqfN5FoFgNutxqRYHnbqT OVyWPN4H3Uun375USl2waKGCT3jeBijUMQWOd9yILEkt+uxt+18zJEEco xB8/qSFotthpVPpjKGQcom+01TBJHC6a56zjvSpQPI2zYK4inW42dtVdT bzbpenjeuQsZxAujYPf3Jr7dS+gU18VtweOi93LaMlMix/6lp36IkIjMM XfeMlIsBVUwhP66NJ0M9mQVruh09xnSlBATIYUqZscKpbT7jRjh4sU6yg IoBeqyzGIEvXAPcLqzY5A8LlCUK/SsXEDQ+DVlfKjQmjG+Xgi1tuNRkxz w==; X-IronPort-AV: E=McAfee;i="6500,9779,10538"; a="311442549" X-IronPort-AV: E=Sophos;i="5.96,184,1665471600"; d="scan'208";a="311442549" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2022 05:35:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10538"; a="672484474" X-IronPort-AV: E=Sophos;i="5.96,184,1665471600"; d="scan'208";a="672484474" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga008.jf.intel.com with ESMTP; 22 Nov 2022 05:35:38 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 6F32EF7; Tue, 22 Nov 2022 15:36:04 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Heikki Krogerus , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Daniel Scally , Sakari Ailus , Greg Kroah-Hartman , "Rafael J. Wysocki" Subject: [PATCH v4 2/4] device property: Move PROPERTY_ENTRY_BOOL() a bit down Date: Tue, 22 Nov 2022 15:35:58 +0200 Message-Id: <20221122133600.49897-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221122133600.49897-1-andriy.shevchenko@linux.intel.com> References: <20221122133600.49897-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750204018378260250?= X-GMAIL-MSGID: =?utf-8?q?1750204018378260250?= Let's order ARRAY and non-ARRAY macros in the same way. The PROPERTY_ENTRY_BOOL() is special, move it a bit down in the code so it won't break ordering of the rest. Signed-off-by: Andy Shevchenko Acked-by: Heikki Krogerus --- v4: added tag (Heikki) v3: no changes v2: rebased on latest Linux Next include/linux/property.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/include/linux/property.h b/include/linux/property.h index 0eab13a5c7df..37179e3abad5 100644 --- a/include/linux/property.h +++ b/include/linux/property.h @@ -330,6 +330,7 @@ struct property_entry { __PROPERTY_ENTRY_ARRAY_LEN(_name_, u64_data, U64, _val_, _len_) #define PROPERTY_ENTRY_STRING_ARRAY_LEN(_name_, _val_, _len_) \ __PROPERTY_ENTRY_ARRAY_LEN(_name_, str, STRING, _val_, _len_) + #define PROPERTY_ENTRY_REF_ARRAY_LEN(_name_, _val_, _len_) \ (struct property_entry) { \ .name = _name_, \ @@ -348,7 +349,7 @@ struct property_entry { PROPERTY_ENTRY_U64_ARRAY_LEN(_name_, _val_, ARRAY_SIZE(_val_)) #define PROPERTY_ENTRY_STRING_ARRAY(_name_, _val_) \ PROPERTY_ENTRY_STRING_ARRAY_LEN(_name_, _val_, ARRAY_SIZE(_val_)) -#define PROPERTY_ENTRY_REF_ARRAY(_name_, _val_) \ +#define PROPERTY_ENTRY_REF_ARRAY(_name_, _val_) \ PROPERTY_ENTRY_REF_ARRAY_LEN(_name_, _val_, ARRAY_SIZE(_val_)) #define __PROPERTY_ENTRY_ELEMENT(_name_, _elem_, _Type_, _val_) \ @@ -371,12 +372,6 @@ struct property_entry { #define PROPERTY_ENTRY_STRING(_name_, _val_) \ __PROPERTY_ENTRY_ELEMENT(_name_, str, STRING, _val_) -#define PROPERTY_ENTRY_BOOL(_name_) \ -(struct property_entry) { \ - .name = _name_, \ - .is_inline = true, \ -} - #define PROPERTY_ENTRY_REF(_name_, _ref_, ...) \ (struct property_entry) { \ .name = _name_, \ @@ -385,9 +380,14 @@ struct property_entry { { .pointer = &SOFTWARE_NODE_REFERENCE(_ref_, ##__VA_ARGS__), }, \ } +#define PROPERTY_ENTRY_BOOL(_name_) \ +(struct property_entry) { \ + .name = _name_, \ + .is_inline = true, \ +} + struct property_entry * property_entries_dup(const struct property_entry *properties); - void property_entries_free(const struct property_entry *properties); bool device_dma_supported(const struct device *dev); From patchwork Tue Nov 22 13:35:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 24377 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2205827wrr; Tue, 22 Nov 2022 05:43:41 -0800 (PST) X-Google-Smtp-Source: AA0mqf6henEjOYJxDVxUcWPbFDYAHjNHE+5Xs7AgBCre2jf3ijHtUsTpZLuXpI4dkCXCy6NB6Ha1 X-Received: by 2002:a05:6402:294d:b0:467:6b55:3cf5 with SMTP id ed13-20020a056402294d00b004676b553cf5mr21366356edb.22.1669124621388; Tue, 22 Nov 2022 05:43:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669124621; cv=none; d=google.com; s=arc-20160816; b=N+10fCNsE6RZqaZ5su+V3rcSYX7oO0rZS11AvveSpU3AzqDctDAqYRWyTKx57mHa24 nsHh1J5h2sNxoUMiERA0AU/aVAssqo4C2LzCLkvRtAWLH0+S7Ao/pldKmNfQmIGR2q+s DegCqf5FzWBq7hYmda+2DE0PXFsgGoLS+0Zmi0ZJF91dmHiIQJwjyH6KscXerohGdSb8 TZhpJL3YnAb525cRWs4rkuIFbx83+4IebB6lJsPjU0nK0tlYgFPOR4ARj/7+4goZY5sQ ya38hhz3o0EZVEbVQT/Y+Wu75bC4GGj+jU+zZusCnLwyiA12ZklfWXoJ9gZLh8HzXas6 EV0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=JgxGEDGTchkK17aLeUsq5k3z34vL/hep5eG4Xe9bUlc=; b=izr83gizOF10/X9aFxLxJWSEJEoOhIB6j8c8n0ZMmRBfBdFvnzEPsA5suT0RwrS3QY gY6PvWorecZzxauP6i1w/Zgh6rQAGq0PfLloWsrcjCpxu8vIIEIjI7GRIMITmomt4wxa HEOb3mGFeqIsbRhuUz2H3qk9uOQ03e8BKjnp/LYAFLpfYxM2Qn9JWOX7R69ltJvz89R0 sKN9Gd02K+Gr2qtjfRU1Tg9c7wKYY+B9M6WwNo3ZMnN+rqbB2JODnnVSLoFSNEF9VpBP L5mgj8KTaoz4SfJyOSrL/Ya5nY+EfIikq1ZjZ544eiJEf3vNzljHPFRGQtapdERCM5zI Jc9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=bsahibRU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m2-20020a056402430200b0045c97ee2b01si12384026edc.616.2022.11.22.05.43.17; Tue, 22 Nov 2022 05:43:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=bsahibRU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233823AbiKVNf6 (ORCPT + 99 others); Tue, 22 Nov 2022 08:35:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233422AbiKVNfo (ORCPT ); Tue, 22 Nov 2022 08:35:44 -0500 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6D4C51C1D; Tue, 22 Nov 2022 05:35:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669124143; x=1700660143; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Yd43EAZ8yFG+UVVrj0IDOTJiGeWfCBxtGeYjjE4QLKQ=; b=bsahibRUZSCcBwHECal1SPvf8SRA4rF1yIOWDtOBTHX2bJCk36tN4edZ r8gK7YSeJgEJB6DjCnVCwHD2xQn7zszq4ooNPij+t7WmMtrZn/YxfvdJm kc2aFVoGYKgdByugmJBbBd4h5/U4QWdlaTjQT9UQw/+Lk7LrQittdhq0a ECkFQZbzjZl2jXj9VUBfWHSJ44xbdM117SLRsUHsSl7viL6lF3ZylQO1Z PNaDiMxyxBzC/b4dwK4BhYCValeGvBnCZWFncZ6Neb64RBn4xcSUImTRw 9w2Ckth6aTBthpRcCOCbjiAOR2n8FK2D8cRTc8Etg0j17wilaCm+iav3f Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10538"; a="311442551" X-IronPort-AV: E=Sophos;i="5.96,184,1665471600"; d="scan'208";a="311442551" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2022 05:35:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10538"; a="672484471" X-IronPort-AV: E=Sophos;i="5.96,184,1665471600"; d="scan'208";a="672484471" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga008.jf.intel.com with ESMTP; 22 Nov 2022 05:35:38 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 834A5184; Tue, 22 Nov 2022 15:36:04 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Heikki Krogerus , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Daniel Scally , Sakari Ailus , Greg Kroah-Hartman , "Rafael J. Wysocki" Subject: [PATCH v4 3/4] device property: Rename goto label to be more precise Date: Tue, 22 Nov 2022 15:35:59 +0200 Message-Id: <20221122133600.49897-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221122133600.49897-1-andriy.shevchenko@linux.intel.com> References: <20221122133600.49897-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750204019114898740?= X-GMAIL-MSGID: =?utf-8?q?1750204019114898740?= In the fwnode_property_match_string() the goto label out has an additional task. Rename the label to be more precise on what is going to happen if goto it. Signed-off-by: Andy Shevchenko --- v4: new patch drivers/base/property.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/base/property.c b/drivers/base/property.c index f7b5aa8fcf28..ed74083c179d 100644 --- a/drivers/base/property.c +++ b/drivers/base/property.c @@ -482,12 +482,13 @@ int fwnode_property_match_string(const struct fwnode_handle *fwnode, ret = fwnode_property_read_string_array(fwnode, propname, values, nval); if (ret < 0) - goto out; + goto out_free; ret = match_string(values, nval, string); if (ret < 0) ret = -ENODATA; -out: + +out_free: kfree(values); return ret; } From patchwork Tue Nov 22 13:36:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 24375 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2205742wrr; Tue, 22 Nov 2022 05:43:28 -0800 (PST) X-Google-Smtp-Source: AA0mqf7CV4zYMyVp3QuoygQAhIo6euNxsMJMS4Rf5GFwYoZfkTRZGtWaPFlgGzD7y/DqGctOQv0H X-Received: by 2002:a17:906:a147:b0:7b2:7b45:2cd2 with SMTP id bu7-20020a170906a14700b007b27b452cd2mr20104167ejb.615.1669124608216; Tue, 22 Nov 2022 05:43:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669124608; cv=none; d=google.com; s=arc-20160816; b=TV+bL94DnPEekun8OGyDUixk1biiuFeQ2wvqhNzl9/eKdidq1lcOsD3rpkw16uDIhw JCw6TxdveRly1+6eOgMrbeT82XvFX5oKoPSPawkPDlyI2rgDBsigNsgfvBRxx25OIBxx plyGctmS7DCPcyjYgsloB88VvM9W8e4kqvDywr8r9THJVQxTHVDQJZrTnD9n7pgJwHtM ZCm2ny3vF5aKyeh7bBSEouklrCLUimYfszS0M4Veg+jQDd4m1Mmd/zyfN2yJi0VXmB1V sVMTRKxelS9JeH4/JBQdnKjyuKC2CuqqWZUl/Bg987r75Sc7Ap3ehZINO4SBwV7hcjti y6CA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=DL5sAK8i9fiyRl+c1taLSV7KCH0hkfAMFVRCm65wuYA=; b=FCCsJgRyIr0HvUrWkMavcwWDLH13bn1WYDfpOMtSBTeHfvdu1N6N5JXz7MBNidVG2d OCK3+3oGoLVyAk5lr6lXWP9cLxo66ath8bAgRQV5A9WetAb3euFam4slD2taP1vvlEUl HcSbd2kcsVqD+CIezUNDk7X2z4HLGi1PnpkAPguIuB+BC5IVGkfHH3NVOHQ+xDVzqT15 9aWrPc6Dm+uptwUs/iLez/mCE4aSwBU60mU3cPcFyqwyV4VNp9fkrPez8WpILOaXi0zn 9BwWD/hP+z2fKlBOXLgYO2+7Vf8Jgk9upAzqTu9/aIavYTaNCD8yxwWDJ4YqRFH7CGx+ ZroQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fwvfdyQU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ae9-20020a17090725c900b007ad88f87f07si13914142ejc.599.2022.11.22.05.43.02; Tue, 22 Nov 2022 05:43:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fwvfdyQU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233752AbiKVNfq (ORCPT + 99 others); Tue, 22 Nov 2022 08:35:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231475AbiKVNfn (ORCPT ); Tue, 22 Nov 2022 08:35:43 -0500 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74CD351C1D; Tue, 22 Nov 2022 05:35:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669124141; x=1700660141; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=E2o75a0dR2r76pyJZbgE/pHYuyelnQX13nzZY5Ng3hk=; b=fwvfdyQUp6NJPUHdjzezC7gOeMznS51dLKg5c1q0X/M2DmGZPvYccSK8 xtxGX2nC7nKZjn8RmlNZ9qiOWsbaA8TmKvICNhTUUwjAVEbrbdEKzpJC9 Ezgu2K7PHFrBdYD72Ng+ewavoyCAl34GnuicXfV6NexF16/pdO4p4ItOv g8yBGdCNfuUDNASVrdkANCft7mg9TMUCBhQ+uvPGHcT0qFLMTAUq0nX0k 5I7QEvtSvXeIs6sORm8oryUJNCfFDzFerv7X7yk8lyaQ92a6wTIYh1QEj IoPKwNNYIAMgLax52k5R5nNaxKqMPh1IyxIB3ZUqP48Z+KhfT1x/xIfMY g==; X-IronPort-AV: E=McAfee;i="6500,9779,10538"; a="311442547" X-IronPort-AV: E=Sophos;i="5.96,184,1665471600"; d="scan'208";a="311442547" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2022 05:35:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10538"; a="672484470" X-IronPort-AV: E=Sophos;i="5.96,184,1665471600"; d="scan'208";a="672484470" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga008.jf.intel.com with ESMTP; 22 Nov 2022 05:35:38 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 8DC4A12B; Tue, 22 Nov 2022 15:36:04 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Heikki Krogerus , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Daniel Scally , Sakari Ailus , Greg Kroah-Hartman , "Rafael J. Wysocki" Subject: [PATCH v4 4/4] device property: Add a blank line in Kconfig of tests Date: Tue, 22 Nov 2022 15:36:00 +0200 Message-Id: <20221122133600.49897-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221122133600.49897-1-andriy.shevchenko@linux.intel.com> References: <20221122133600.49897-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750204005009417337?= X-GMAIL-MSGID: =?utf-8?q?1750204005009417337?= Seems the blank line to separate entries in Kconfig was missing. Add it. Signed-off-by: Andy Shevchenko Acked-by: Heikki Krogerus --- v4: added tag (Heikki) v3: new patch drivers/base/test/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/base/test/Kconfig b/drivers/base/test/Kconfig index 2f3fa31a948e..610a1ba7a467 100644 --- a/drivers/base/test/Kconfig +++ b/drivers/base/test/Kconfig @@ -8,6 +8,7 @@ config TEST_ASYNC_DRIVER_PROBE The module name will be test_async_driver_probe.ko If unsure say N. + config DRIVER_PE_KUNIT_TEST bool "KUnit Tests for property entry API" if !KUNIT_ALL_TESTS depends on KUNIT=y