Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1756546rwb; Fri, 12 Aug 2022 06:26:39 -0700 (PDT) X-Google-Smtp-Source: AA6agR4dw7KoBXIT0KKi4m9C30m75bJHTbseYjyaYzti8WfEd2JFeSgf0phUZrTE5BP/J1XqPd1O X-Received: by 2002:a17:906:9b09:b0:730:c38c:e11c with SMTP id eo9-20020a1709069b0900b00730c38ce11cmr2650152ejc.684.1660310799125; Fri, 12 Aug 2022 06:26:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660310799; cv=none; d=google.com; s=arc-20160816; b=eRjtuXwSR9lQM75wQ59Oa4vUKtG+b7oaDtt1BSFVUkYn8UvfUOr34I0QoacV3W/ToO uS33IgkDg8fBqCGCGrvg9mSIJWf1ItRt0kO+LhpGc1nC8LxOtf0s7iDfwtbfuLVfyMLH UoWo1G9AF7es4wzz2luIbeAhyJ9cAzZlaw0P2rck3oPm7PV/jroq+d+qy3h8MlX3FCFx iJX9H8q4yUo8xICuKw0XwyR5990hFxwBmSFcTM30vcttoKFwOSp6/4sUG+ZQKPv9bScx OzrrRPaBlgnO9SdLoySIWTq++yzKqmShHgnxcaNFFnJiruE0ZLKoBh59fvd+3gz2WWPq zspw== 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=I9klxWCl20GzOsgSo6Cjo6h4lDJXRQZ68eRcuQxCfKE=; b=Z2wW9RZ45qzKJE+7MyupUDPo/Ic6YdNcnWIqvreaCB7gQj5odz3ymsEV47HIvXt+ul W3PBHNSaH2tC4cxnEOyKORvwYmWZv/S8ZojYnCB7NSkx7MmLFGSsH4yHT2Zp/mKjm3ZW D/zcapTMM/YqRq3djd7YwWDSMSMKKGqywBNufDEXpPAQwdWaYxTTKIBamtfPnHvXSKMa vcr9BMCS3hGcAl5FFVRP8dYK30CGuWSSdMewCODqAfMT4XGI3bbroSgdy/4f0nmJKKk4 JVYyFBbztO3lMawktes6/vUNDmsCepWUMeXfGEGi6nAUaOo//XRydd/6m2GXRjUwlRQZ OIfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=o3UT8W66; 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=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p15-20020a170906a00f00b00730728a82f4si1897589ejy.99.2022.08.12.06.26.12; Fri, 12 Aug 2022 06:26:39 -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=@cirrus.com header.s=PODMain02222019 header.b=o3UT8W66; 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=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238856AbiHLNHH (ORCPT + 99 others); Fri, 12 Aug 2022 09:07:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231637AbiHLNHF (ORCPT ); Fri, 12 Aug 2022 09:07:05 -0400 Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E23D685A86; Fri, 12 Aug 2022 06:07:02 -0700 (PDT) Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27CAU5rU016140; Fri, 12 Aug 2022 08:06:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=PODMain02222019; bh=I9klxWCl20GzOsgSo6Cjo6h4lDJXRQZ68eRcuQxCfKE=; b=o3UT8W665PB+2d68TT8kwsfsJOUJ1xJo/3ApAz3kHXTM+Yx7ZmlVGpBBzbPQPwm8bG03 4z4bYsb4IGPCkXr9j1hvX+36qzq1EzCtYSheUpqD/QYOp++kIdUyMtQnrMGMPszVfBqT 2hjoReYezghjthaMrj+VtH9mxIgoaPJ4SDxbsYQxfE6smzTFTiMlkv8E5XpXlzulYH8D OaXnG08/dw2O0oG7H1NigtB7s8dX5sZd15HnJljlNcFOWwnb2L6/TqQQcA42bFePO4KH gXiFGKKo06DON5bl0NIKp3S6Rd0swy6oKjEVNEZSnTIPKqE04Vbwx8AqwsAi7urKP/cq 7Q== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3huwr3m0ar-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 12 Aug 2022 08:06:52 -0500 Received: from ediex01.ad.cirrus.com (198.61.84.80) by ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.9; Fri, 12 Aug 2022 08:06:50 -0500 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.2.1118.9 via Frontend Transport; Fri, 12 Aug 2022 08:06:50 -0500 Received: from sbinding-cirrus-dsktp2.ad.cirrus.com (unknown [198.90.202.160]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 88D8245D; Fri, 12 Aug 2022 13:06:49 +0000 (UTC) From: Stefan Binding To: "Rafael J . Wysocki" , Sakari Ailus , Andy Shevchenko CC: , , , Stefan Binding Subject: [PATCH v1] ACPI: Property: Fix type detection of unified integer reading functions Date: Fri, 12 Aug 2022 14:06:45 +0100 Message-ID: <20220812130645.14710-1-sbinding@opensource.cirrus.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: dwkhdVRx1rycG4nIQXZuNbNXOgWGMA_J X-Proofpoint-ORIG-GUID: dwkhdVRx1rycG4nIQXZuNbNXOgWGMA_J X-Proofpoint-Spam-Reason: safe X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, 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 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; \ -- 2.34.1