Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp7648rwb; Fri, 12 Aug 2022 13:11:50 -0700 (PDT) X-Google-Smtp-Source: AA6agR7Tjhw/Qc797nhlrqFJ4kcJ3SHDC1ZAhLig7XGSOKctPTQ0u6ujTKmhVSfV6hMP9S97Kypn X-Received: by 2002:a17:907:c12:b0:731:6473:baf6 with SMTP id ga18-20020a1709070c1200b007316473baf6mr3554101ejc.522.1660335110544; Fri, 12 Aug 2022 13:11:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660335110; cv=none; d=google.com; s=arc-20160816; b=Oggxh2eebqLRMbed8oj66XDYWF9APs3D1jhXwSvm/wyREteGhzQbGrV1Dzefdvk0X3 Ebi8FOE9bnMhwF/KOSwnLRqTmKQkZhnlTgbirldo8krzWOcNN59UMOK87PaQrB2ju+J3 tuxRpBfeJPROke1ubYu5d7vBCBQFFtQGz8eD06EKmFJ3SGXBYvWJF89uMb7uHZSh0XlR g6qxBGsq0ufjqdKB8diLhEEY4mfTjC+Lr+OApz8wEgOvMhqncc2wx/V0UNYF5PYpAptI 76Af7tmrwqFzdE8DTJYZ+ci7ht86gHT5CDpKlPZ6y+4w+A4q9P7W3zPA4Tlz//DrcrFj ML0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=bUnjAxiIvO/D7lZHLU2E1jHWWS387aFSR+D3BGdpYi4=; b=xADZN38VzwOotAtckbzh1XunsXerC+HYG+h2q0hU0UdX4VRbYN5qfCwosidXLjI432 k5uVVOlT8SlGjXo/YMmgdPMLkl6cFHWMhLQ3iJYdHemYm9S5b0KaC617w52GHFlj3Y+5 WmjyXhtaZJMrjV+K7AkY2csaqGLw2Cab1AyxVSCaSrD68JXWJYilYetRiOvIMcTtzKmA gOFPO9HowcBV13HM78iBbMGlCJwDtXLHOlSCvBkl+n4/BLILiMXf4hs5K/BQ2M9aQfen xxh4OtBOlBAwRDzWs3EqgWoZMZ/9ErGlxk6MJIKxkp+ziY+DQEPE/2GfnXHd9mVJcJsF 4POg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=b1m4teSD; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j18-20020a05640211d200b0043e47007ba4si2829728edw.254.2022.08.12.13.11.25; Fri, 12 Aug 2022 13:11:50 -0700 (PDT) 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=b1m4teSD; 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 S237450AbiHLTmd (ORCPT + 99 others); Fri, 12 Aug 2022 15:42:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236815AbiHLTmb (ORCPT ); Fri, 12 Aug 2022 15:42:31 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33CA6B285C; Fri, 12 Aug 2022 12:42:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660333351; x=1691869351; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=UVh9wGe4sOwL5XUI0lWCSw73ZdAjh9fY5902G/5LxJ4=; b=b1m4teSDulRi26HrMogOC7ryV2mbr0bmqdJSetENJujF4g0+J9XJWQ7k yuhSHMrl3d86Chuc/rvlGm9xXAENb/8kIDSGBTFQnINmGcfHUWtkDcY7x bwF0S94vql9+tW14ZmhdfavSDKcGtSWEbeImxFxF23ry49Si/RRbOyNgQ GRaR8sBPdc4h6hKcmeA/gsZflTrv56YtnFm347r2Fj2ABZaMF9mJf5WYE f+1TQ+gmM0AKQaKJl5JKeIie5o/NKy72vTpMUt6fv3fL+eb3S/GGKmKRt SG7nU7hJiuU8ZOodYplw4gueqZFJbVIU45b3S0s3wRpcYKE3aBI8s3HOI g==; X-IronPort-AV: E=McAfee;i="6400,9594,10437"; a="271447681" X-IronPort-AV: E=Sophos;i="5.93,233,1654585200"; d="scan'208";a="271447681" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Aug 2022 12:42:30 -0700 X-IronPort-AV: E=Sophos;i="5.93,233,1654585200"; d="scan'208";a="556636122" Received: from punajuuri.fi.intel.com (HELO paasikivi.fi.intel.com) ([10.237.72.43]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Aug 2022 12:42:28 -0700 Received: from paasikivi.fi.intel.com (localhost [127.0.0.1]) by paasikivi.fi.intel.com (Postfix) with SMTP id D3F5420371; Fri, 12 Aug 2022 22:42:26 +0300 (EEST) Date: Fri, 12 Aug 2022 19:42:26 +0000 From: Sakari Ailus To: Stefan Binding Cc: "Rafael J . Wysocki" , Andy Shevchenko , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com Subject: Re: [PATCH v1] ACPI: Property: Fix type detection of unified integer reading functions Message-ID: References: <20220812130645.14710-1-sbinding@opensource.cirrus.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220812130645.14710-1-sbinding@opensource.cirrus.com> X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, SPF_NONE,T_SCC_BODY_TEXT_LINE 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 Hi Stefan, On Fri, Aug 12, 2022 at 02:06:45PM +0100, Stefan Binding wrote: > The current code expects the type of the value to be an integer type, > instead the value passed to the macro is a pointer. > Ensure the size comparison uses the correct pointer type to choose the > max value, instead of using the integer type. > > Fixes: 923044133367 ("ACPI: property: Unify integer value reading functions") > > Signed-off-by: Stefan Binding > --- > drivers/acpi/property.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c > index 7b3ad8ed2f4e..b1d4a8db89df 100644 > --- a/drivers/acpi/property.c > +++ b/drivers/acpi/property.c > @@ -1043,10 +1043,10 @@ static int acpi_data_prop_read_single(const struct acpi_device_data *data, > break; \ > } \ > if (__items[i].integer.value > _Generic(__val, \ > - u8: U8_MAX, \ > - u16: U16_MAX, \ > - u32: U32_MAX, \ > - u64: U64_MAX, \ > + u8 *: U8_MAX, \ > + u16 *: U16_MAX, \ > + u32 *: U32_MAX, \ > + u64 *: U64_MAX, \ > default: 0U)) { \ > ret = -EOVERFLOW; \ > break; \ Thanks for the patch. I prefer this fix over the other as it uses the pointer type (rather than value at a given index). Both have the same effect though. Reviewed-by: Sakari Ailus -- Kind regards, Sakari Ailus