From patchwork Fri Nov 22 09:47:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 845007 Received: from mail-qt1-f170.google.com (mail-qt1-f170.google.com [209.85.160.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D4F0A1DC1B7 for ; Fri, 22 Nov 2024 09:48:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732268902; cv=none; b=W3AMHjy6Spytkt9RqOoyq+qNy2+mnCwVTTxS07QwAQaQSpSkwB6/ibfsBBB1KA3DDLxCBfZ7YGigNXxbYXCuoixYGolfIhFgjnQYJNA8dS38a0SzN8yTwfENeALGLr5EDMP2hgbiJKokg0CNMGgA2HnCW377eFm29A8FAvRq/Ck= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732268902; c=relaxed/simple; bh=w9LCIWUOMl/uTKpIvXEyGapEo1u86swQRW6MRCHY3D0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gve27xEComAkbAUvDfWT+9GfVruwKCVkTVHJj/Gi3vjyZmeFKAVH/DfrUt+4ncxbVl43eMz3IsK43chsBnbwglTm1UVVRJZ57y2SPOTzfYeQyigaayD0AkxmGLyqI5BDxjPmjcYfP3Z6wuixAGXl4RShXPQWN2xFw+/12CA9Imo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=bxophegV; arc=none smtp.client-ip=209.85.160.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="bxophegV" Received: by mail-qt1-f170.google.com with SMTP id d75a77b69052e-460a415633fso10709901cf.2 for ; Fri, 22 Nov 2024 01:48:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1732268900; x=1732873700; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=I/BFNmnXBO58C7oe88M+ixtZQGuz6wm+Rt7+horX5NE=; b=bxophegV0qAeFpYhJAVl/AFaeEm2uRTWoPgNLgEsKfH2O5EzErr1+Bfjb6NHusm4E6 bEQFa2oH9nq3H8m/zfMspitRKAbdH2ddonPWyO+7HSOEnmZNVpqTUM/CAM1wkYIkOxyi 5aY1cwcHKHAGpj9ZoVFgRo5XEk+ZriS8B9z1s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732268900; x=1732873700; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=I/BFNmnXBO58C7oe88M+ixtZQGuz6wm+Rt7+horX5NE=; b=goRvdeph7BM8CVHeuHSypgJED1XWd0NUTfm1+nv8Ac+YpKPeP4DxqfQTK3mB4mLVYl jATtA25A5zU/671c06lt2H6S2Knrppf16/4ZVMewXf3JJMao44eFN6zdEUQayPKlPKJT aOcw9COz8IeR4fUACmSh771aIIMYQ4qyVV/r1dHiCy6RMGk05MAjHcL6xbLbQi2x7BfX OUdqRa9WwOOALOAKmj27tyiamQd90pNN0ERd5FTeycoNqmvnwOTVp8Pry7/VVFDaQb3T xdJHZT74RQwiyCmaOAvZHTRTfu6QzI2Fovtrn6EEvABr/ghnP6nV11i2xrX8hwmQ1ziD rXGQ== X-Forwarded-Encrypted: i=1; AJvYcCXc2H7tPiZplMDqkg0OT42WG2zYAbF9hvpdIzy8KrIGDQ43JaTGB+BfZS1RP9aPzUkx+C3pQImafIiB+g==@vger.kernel.org X-Gm-Message-State: AOJu0Yx3qjtcJhn9VYWZ76libB36pxcxMnpaOeE4o8tk0qjk9AVvj3CK xa0UMxJdn4vsHpnR1TRshkPBw8aUxsgOQ8MklJ8l4N6HLNs9y1+AOt8XVCJc2g== X-Gm-Gg: ASbGncuMwVoQ4OmdtXlVmothZbqItWpz3XGdupVjlAlhodLGhq90jQr49WqpDqWbnbO X/6GJWKsaTNjsYX53Pax+vx6UdT4iX0fcczfgAW4zlE9AyyGcROsnwGvjXeStrpww+vGj1XV5Us jdsml+XbdowmaHOLhRGfGh1UY3BxZm7pKB0MArB053g8krVDCTpK7PKMShjBl8nQYeaapjCEe7U LLojEkz4oR8ynhRyhF5K73RNFgFZEFAtSLCqULpakMUW5/tEk4/StjFwReFVtDeyKjujKJ3I4xe Lqg1LKd/aYzWOfdlb/9lcL8X X-Google-Smtp-Source: AGHT+IHHdb/bCzojxcLvKgiZFS7wveq70HirCmNUp9dbcD65FOXFHZVsY9GQS/ctk0cY1TQI6tOweA== X-Received: by 2002:a05:622a:1e8e:b0:460:ab29:e6b1 with SMTP id d75a77b69052e-4653d617eb8mr30106331cf.44.1732268899812; Fri, 22 Nov 2024 01:48:19 -0800 (PST) Received: from denia.c.googlers.com (5.236.236.35.bc.googleusercontent.com. [35.236.236.5]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-4653c47f124sm9282731cf.62.2024.11.22.01.48.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Nov 2024 01:48:19 -0800 (PST) From: Ricardo Ribalda Date: Fri, 22 Nov 2024 09:47:58 +0000 Subject: [PATCH v2 1/7] media: ipu-bridge: Fix warning when !ACPI Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241122-fix-ipu-v2-1-bba65856e9ff@chromium.org> References: <20241122-fix-ipu-v2-0-bba65856e9ff@chromium.org> In-Reply-To: <20241122-fix-ipu-v2-0-bba65856e9ff@chromium.org> To: Mauro Carvalho Chehab , "Rafael J. Wysocki" , Len Brown , Robert Moore , "Rafael J. Wysocki" Cc: Sakari Ailus , Dan Carpenter , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, acpica-devel@lists.linux.dev, Ricardo Ribalda , kernel test robot X-Mailer: b4 0.13.0 One of the quirks that we introduced to build with !ACPI && COMPILE_TEST throws the following smatch warning: drivers/media/pci/intel/ipu-bridge.c:752 ipu_bridge_ivsc_is_ready() warn: iterator 'i' not incremented Fix it by replacing the condition. Reported-by: kernel test robot Closes: https://lore.kernel.org/r/202411221147.N6w23gDo-lkp@intel.com/ Reported-by: Dan Carpenter Closes: https://lore.kernel.org/r/202411221147.N6w23gDo-lkp@intel.com/ Signed-off-by: Ricardo Ribalda --- drivers/media/pci/intel/ipu-bridge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/intel/ipu-bridge.c b/drivers/media/pci/intel/ipu-bridge.c index a0e9a71580b5..be82bc3e27d0 100644 --- a/drivers/media/pci/intel/ipu-bridge.c +++ b/drivers/media/pci/intel/ipu-bridge.c @@ -774,7 +774,7 @@ static int ipu_bridge_ivsc_is_ready(void) for_each_acpi_dev_match(sensor_adev, cfg->hid, NULL, -1) { #else - while (true) { + while (false) { sensor_adev = NULL; #endif if (!ACPI_PTR(sensor_adev->status.enabled)) From patchwork Fri Nov 22 09:48:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 845006 Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 34EAF1DE4D4 for ; Fri, 22 Nov 2024 09:48:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732268907; cv=none; b=ba2cva/Guw3fmPSBbL57mdGXYG9X9Fg1i775KGH9RS8s13L+WmPTIdoV8nsqKzARmrTgd+UTw6dp/rzMJWdsAcKh47XKOM11fEyt8xos/Dpmcdo9jzHW0Iv4AYogs6UkzD3dmZnCCSMGg0pMTclOOUR3+9uGALIDA3LjEHKIMIc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732268907; c=relaxed/simple; bh=s/RFQ8hC9e/8cn1SLTw55cw7d/tVQKC4RIk8exh03Y4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=V6z3LyH2/qZdKxwUulPWxikrAgWbz0dgI7lE4z61rtOppjJWaqyk6l9gqqxNY5n3NJjyqvzEpvk5cb8e1a3/8DRJrUFlpjLZlIIPbHyFjJSwfCWrERN7HzoGxjzZ1TCsi+uIa09ic0UKR5Smrex1mw3yno5Kb8sbJe5beMUvVxU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=SHtnu3GG; arc=none smtp.client-ip=209.85.160.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="SHtnu3GG" Received: by mail-qt1-f175.google.com with SMTP id d75a77b69052e-460af1a1154so11558601cf.0 for ; Fri, 22 Nov 2024 01:48:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1732268903; x=1732873703; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=zG7I43DMEh4GfUqzQUdimZGvwsrcdmhPZLNEbgcg8ic=; b=SHtnu3GGz5BW3ctFws7PPU9Y6sM2ikaYQwI90aL4/KAKHuMxMisBrBzHwgN41RkxO/ ID+aTiMzKpRKVkjwWxFjnDP4NSzWp87Z45FqEhRp8vGcOAMOlaw/vy+cEh3y8LzXKjE5 t/AmNzdpP99aY9TjJtU7KUHlhbvU8vtItYTSU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732268903; x=1732873703; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zG7I43DMEh4GfUqzQUdimZGvwsrcdmhPZLNEbgcg8ic=; b=N/25ETMtv16mgBnxagqFtitM6RjgurovQcEZbOqws3wOwyudec3AqJHQ03sPSClpSK u+qukg6N/ZBrT2QSUwTd00G/KmatLqciSVPUXrhy21Ekutm+kehH7i3wQ2B6cl94EIrV USKoRaidn2tHmaLA+b40/GZFvGJgAcMVBTGAuI6gROiNI7vcyXUKLD1L+UTc127+JNtc KSHSxSG+oefcVhnpGIJACx4cNRbYmyLLaPVDp0CoR/4XKuH04QROjAWtOaB3Du/PmSps iFXfHMjvH8GGSRs4LIfnM3yS+LPyxWWgIMtl6Q3IMPucCjja35+G1ECvg8RSiu2Iy/KC VxXg== X-Forwarded-Encrypted: i=1; AJvYcCVwftqoF5AUDyYnQMuJo3/s8U06FhwueYJtJKqDtK5H9LWwg3H5wIYUg024Tc3CTRAap1pFxoOFK70C+g==@vger.kernel.org X-Gm-Message-State: AOJu0YzIz+MAuWV+W2PJYxA/AJcZu6dqplpEwSAmc3663I+4n/0JHF1O Sm+z+ZgVm99cEoi6i4zjE9ScEg4v9nAJBe8TDvZfEg2AzyHYSK3+/CXmoz44hg== X-Gm-Gg: ASbGnctvzmzhcPYsfhaYi9pKiltBT3njdEB+tLXzJcXsxHjgjV5vuNzTFs0LVwt8rnQ mRC/LN8QXYdmGLw7qX2ov5RZEykRtXNADVm0v1bNKtZOTnx161txX0f2esw52xALoGcaQkxCL/d awHxPB4Y2WVRjS/ZuoS65321FId4jUcsL4JnlmFTR7gn0df2D7hvo6jOxXb2+q9//zarcbma0sH /jyKpz0WZhpfNssiPmg4lWlcNCvaDpiOf45q2wXsQa+90eb5/JhPdKfz0jpN7UeXQdjaUkTRqU1 RKbZG1mwolWGmt/d0pD8JfL+ X-Google-Smtp-Source: AGHT+IGMlQYEruhIl1CbTQvmldwCNjhRHjn9f7tEPvnZRJBnvQVCS4h0diiDqwqoJ+Hs/FtxPNpzMg== X-Received: by 2002:a05:622a:5919:b0:460:c2f3:7343 with SMTP id d75a77b69052e-4653d5af2dcmr28382081cf.28.1732268903212; Fri, 22 Nov 2024 01:48:23 -0800 (PST) Received: from denia.c.googlers.com (5.236.236.35.bc.googleusercontent.com. [35.236.236.5]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-4653c47f124sm9282731cf.62.2024.11.22.01.48.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Nov 2024 01:48:22 -0800 (PST) From: Ricardo Ribalda Date: Fri, 22 Nov 2024 09:48:00 +0000 Subject: [PATCH v2 3/7] ACPI: bus: implement acpi_get_physical_device_location when !ACPI Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241122-fix-ipu-v2-3-bba65856e9ff@chromium.org> References: <20241122-fix-ipu-v2-0-bba65856e9ff@chromium.org> In-Reply-To: <20241122-fix-ipu-v2-0-bba65856e9ff@chromium.org> To: Mauro Carvalho Chehab , "Rafael J. Wysocki" , Len Brown , Robert Moore , "Rafael J. Wysocki" Cc: Sakari Ailus , Dan Carpenter , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, acpica-devel@lists.linux.dev, Ricardo Ribalda X-Mailer: b4 0.13.0 Provide an implementation of acpi_get_physical_device_location that can be used when CONFIG_ACPI is not set. Signed-off-by: Ricardo Ribalda --- include/acpi/acpi_bus.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index eaafca41cf02..4888231422ea 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -43,9 +43,6 @@ acpi_status acpi_evaluate_ost(acpi_handle handle, u32 source_event, u32 status_code, struct acpi_buffer *status_buf); -acpi_status -acpi_get_physical_device_location(acpi_handle handle, struct acpi_pld_info **pld); - bool acpi_has_method(acpi_handle handle, char *name); acpi_status acpi_execute_simple_method(acpi_handle handle, char *method, u64 arg); @@ -60,6 +57,9 @@ bool acpi_check_dsm(acpi_handle handle, const guid_t *guid, u64 rev, u64 funcs); union acpi_object *acpi_evaluate_dsm(acpi_handle handle, const guid_t *guid, u64 rev, u64 func, union acpi_object *argv4); #ifdef CONFIG_ACPI +acpi_status +acpi_get_physical_device_location(acpi_handle handle, struct acpi_pld_info **pld); + static inline union acpi_object * acpi_evaluate_dsm_typed(acpi_handle handle, const guid_t *guid, u64 rev, u64 func, union acpi_object *argv4, @@ -1003,6 +1003,8 @@ static inline int unregister_acpi_bus_type(void *bus) { return 0; } static inline int acpi_wait_for_acpi_ipmi(void) { return 0; } +#define acpi_get_physical_device_location(handle, pld) (AE_ERROR) + #define for_each_acpi_dev_match(adev, hid, uid, hrv) \ for (adev = NULL; false && (hid) && (uid) && (hrv);) From patchwork Fri Nov 22 09:48:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 845005 Received: from mail-qt1-f173.google.com (mail-qt1-f173.google.com [209.85.160.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4B2EF1DED6C for ; Fri, 22 Nov 2024 09:48:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732268909; cv=none; b=fIqE2PN79bhIwd2D+DcFhQVhkjBlnJyVwsRWEyLYoYFpVuLQm0eFJjlhUXc6Q/UKQ4hBvqHjezAt1vYalnGw4CG1kl07XCnlnk2VQdji/tocRZhun+4b+ir8fLbe2Vups+PW31E218ld/LGZ6f3TEmKF2DYCY86dTXXIHRGYaCA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732268909; c=relaxed/simple; bh=4H1xI8rZic7uj8BVAr4deS1lVj9r+ITu7MlYRDSB8Ik=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=sItbOQ1gYHfGlPYESrLT0ClCZ8yBpuLrdBVfSc6qmMs92AzHQ9vqYy74iRFCiy6QxCdZEmctRIpxO2/bBrBWskAU8K2igjBWDzxbY2nNbDAP4V/iBrZ69pdrwrRBM7BPGGi+orI/dKMtJzHPuCTEi3CMc+JkwxIbWutipUOIdOY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=A/sY87vJ; arc=none smtp.client-ip=209.85.160.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="A/sY87vJ" Received: by mail-qt1-f173.google.com with SMTP id d75a77b69052e-460e6d331d6so11571801cf.2 for ; Fri, 22 Nov 2024 01:48:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1732268906; x=1732873706; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=VrSmAj2jkvytw0rNLCddg1aexjt2xHCHXsrUaR3oGCc=; b=A/sY87vJxtLNW3pnMxjNevbIQvdRjQ4qjdxdDwQOBUUB4T7cEX9oxWyKrlDGKyfKRN Rk3LMSBF4ln1WUQLoY8ED0ux27iR8uspjKKZfg+K2LL14MmUks9R61PUn16FBb5ryQZF GWDPKk2ShrGJjhKngu+NSbYVjROvh+Mpyz9cg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732268906; x=1732873706; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VrSmAj2jkvytw0rNLCddg1aexjt2xHCHXsrUaR3oGCc=; b=AGcBlYhJfmY9Xj9951tT3BPErEYbrbtYH2jvVfr+G5Pz2lihWKQ9mBFpkJsa8c2nR0 VoNj79Aqjipmwvs31n+z6lPzTG1Rksa3w3cRaOTMQQ2V54h7PDUT+1ycUU7Lm8iqa/+0 vwAz6st3Y5UilLVdR2piByb42Ydv4WqrHdtn/0rwFTayH1TSlHE0wgbrfS3Y2w3S5HHF KIuF0gGbW+k3MDFd0MVZKWEb/nN8OJo5on+44F9atfyzkH0mBPDSGUbnO8Wv/n8/2d1b mWVfpBTyAomqftJ8G90Ag7KT2AFp4J9xcpMKAHIG+EFZa9f7smQctmN9xHzxrQWSflQX olSA== X-Forwarded-Encrypted: i=1; AJvYcCWDrphV9YKZh/cu7QqkubQe5uX8bmSYVGyVzEA+naGbzcaRTM4mXuHO/V4eGpi0jSDhwVsv37I1pdXLug==@vger.kernel.org X-Gm-Message-State: AOJu0YyfXyw9X5/uL+gNaROZ34usuC3SHadwWw0uVjuGV4RKnC9gNW+L xwzY1eIlX6Ej31VcTKrPec+oa+m/NYhPLO9qntBW3MBm+9yrsCPv/fKjLqtrew== X-Gm-Gg: ASbGncvjJpNuS9IugXol3afMScY3rIutIMcZHzXinhYt8pKZozhGBewvMhRs4UZGa8W 8ZfpM1iRtxlP74A83OLUWG5O7ODkZMx4egeEvzfFDYR9HBDc4YNIF2J6voFAJOlpdqhz8q5r95R f62ukiDIlH1zAK6nLxbDuoEUkJZGBT7W8cptXAgGJPsn6NiYbwZNOj5tv+3R1KTbi+9I2/tyi4m Wx63/KdYmWNJr2L/w43EOXKX0z5PMweXQLJwL7boBjOPRME2zrcZBPX1pzktlGCdAxgfYEYmWHs F0O4vOCWjoJuQPQr/TSAKQrf X-Google-Smtp-Source: AGHT+IFru2WAUE4DOiSVjGZ5la48og7nHQB/1X/SGFbEnNNed0D8aT6/FZPgrfye+Wt1XXhUhzTTyw== X-Received: by 2002:a05:622a:2d2:b0:45d:9357:1cca with SMTP id d75a77b69052e-4653d57be12mr23934371cf.14.1732268906271; Fri, 22 Nov 2024 01:48:26 -0800 (PST) Received: from denia.c.googlers.com (5.236.236.35.bc.googleusercontent.com. [35.236.236.5]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-4653c47f124sm9282731cf.62.2024.11.22.01.48.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Nov 2024 01:48:25 -0800 (PST) From: Ricardo Ribalda Date: Fri, 22 Nov 2024 09:48:02 +0000 Subject: [PATCH v2 5/7] ACPI: bus: implement for_each_acpi_consumer_dev when !ACPI Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241122-fix-ipu-v2-5-bba65856e9ff@chromium.org> References: <20241122-fix-ipu-v2-0-bba65856e9ff@chromium.org> In-Reply-To: <20241122-fix-ipu-v2-0-bba65856e9ff@chromium.org> To: Mauro Carvalho Chehab , "Rafael J. Wysocki" , Len Brown , Robert Moore , "Rafael J. Wysocki" Cc: Sakari Ailus , Dan Carpenter , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, acpica-devel@lists.linux.dev, Ricardo Ribalda X-Mailer: b4 0.13.0 Provide an implementation of for_each_acpi_consumer_dev that can be use used when CONFIG_ACPI is not set. The expression `false && supplier` is used to avoid "variable not used" warnings. Signed-off-by: Ricardo Ribalda --- include/acpi/acpi_bus.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 4888231422ea..57298c7cfb5d 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -1005,6 +1005,9 @@ static inline int acpi_wait_for_acpi_ipmi(void) { return 0; } #define acpi_get_physical_device_location(handle, pld) (AE_ERROR) +#define for_each_acpi_consumer_dev(supplier, consumer) \ + for (consumer = NULL; false && (supplier);) + #define for_each_acpi_dev_match(adev, hid, uid, hrv) \ for (adev = NULL; false && (hid) && (uid) && (hrv);) From patchwork Fri Nov 22 09:48:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 845004 Received: from mail-qt1-f173.google.com (mail-qt1-f173.google.com [209.85.160.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A6F951DEFF7 for ; Fri, 22 Nov 2024 09:48:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732268912; cv=none; b=XU8THN3T+nVAier2rZfYcD6xFYO2g+WCeRfkoCnkfTu86Sq5xEo9JhFjQOjXVFn6++QxeGDHC3SltPC+ZAbWaT8lzE7SLT9txuTYADukNjXMTTKYzKjK7OcF3Ak6qwG8m3LjpWbAyg0NFCEXsUsALlAG2lsF1arTrUlUpDqdDck= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732268912; c=relaxed/simple; bh=/xyrOk13WfYwXnzGF1BEMgqEZvLsICd5gWhhYG2cImQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=KQnUkGdzyP5wxmsrzD6eXnOQrjSLPnSKyARPmFSS3cedYMbLbn9Oxsa4NBMJE5R2pIHn6NJbrCDx1SsU8O9a/d4m1VLn3YEmUYvGwSz+HGuxXGmNYxaOh26z8kySo1DPI4eNyr9u5KarvfOXM6c7h1Pefmhb8BgJ0aVUj0vFJZw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=K4JcKc1e; arc=none smtp.client-ip=209.85.160.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="K4JcKc1e" Received: by mail-qt1-f173.google.com with SMTP id d75a77b69052e-460b16d4534so11782621cf.3 for ; Fri, 22 Nov 2024 01:48:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1732268909; x=1732873709; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=uKV0qKpenqq8YefMBn8axPBP/1pf6x8COWK/EGNLUhk=; b=K4JcKc1emtFZL8AasidnVN6IgGI894tWJKkBfVZw+HSi3ezVGLAwmrBzMWDkck6+iW pDdzQo5o7QbSRic9VOi/pDSh2Ds0S34oDo/CrG4pTvpaQ8fpk2yy1D7UonxKxXh9njAE OZCJpJ4o2hbYu1CN8gTr0RubqdaQQawl0rriQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732268909; x=1732873709; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uKV0qKpenqq8YefMBn8axPBP/1pf6x8COWK/EGNLUhk=; b=bP9S7hUdsHkoM+X/iQzR6FcnWVlPY5xRjd61j4mekkX89ApptggJz7mTQaIgURW0EY V5eEgnOv985R1AgXnwzGLNcOoqcdXrWHGdftmMkov1Y0Om1s1pIye4ayvgXQ/VTRFWfw Nt1vU2to/GEz3iZWJk+VcXcWWpgoPca6JlYaldNe6xRoyTzmWtZ9t2sGXKTh9fxtQbkj IDly9jLkfmhMkyXWFCZLN1YLWIuwmi71/TnqpDUO2kaMPaXHi6ekRkyUJk3r3ngrofk6 B8h9LtrSZeIKW7YAiQ7zmztSd9nHVD8uiGjZnwZk8XHu+UKRthr6v0gcCEt4pzOjJQeD AXKg== X-Forwarded-Encrypted: i=1; AJvYcCXPfyctiMhYqZGryMCs/TZIa/liKpyUp981TgpJSxUbIzuaFzLxSpo7XmO6U/MvwWnn6iUSaKAoiuL+aA==@vger.kernel.org X-Gm-Message-State: AOJu0Yx0XvtV1wU3n4qSl7XjJMfXL3JZSwkfsGHg5ioXc0KqrlM7rzab T6qCTkbAWXna0kGUrvommelGSJv4cribC0b7KEXNuTR990+oI2wP34961OiQgQ== X-Gm-Gg: ASbGncspDvwLMBL6cHnBUMUREENyPj808xGJG3Pp0aLywETPOwHagLsDR+08HeTn/f9 J8vJfuEic5x5vbKlM0nWAx4sRjHkO511TYMJxZejX4xvNWcARDgBfIxvMC9Tpne0uQdtDGbkEb6 fitmbJGELDblxNjdWmyR/FJkaKQ0BGE20jhCdP+1Qqnr5/FCp8FR7vFCLI5k7niXqvsTH3idXme hPH+6ZEcWxYjSvlQT00kig6ea2PrnCefVDuC9H0Cse+WXwd8UcDV0J93hhyvZlEGBJ0J+NASDKR tjgQUY+MNkme1SLtAO3t5vB5 X-Google-Smtp-Source: AGHT+IGkqqWnODk2xignRvaov7QmeTL3jw/lsAM7Pyz5eBZ/ng+3qbMNUUQf4HXvA77w2WK8NKWLDQ== X-Received: by 2002:ac8:5ac6:0:b0:461:1532:d769 with SMTP id d75a77b69052e-4653d63aebamr22893621cf.54.1732268909452; Fri, 22 Nov 2024 01:48:29 -0800 (PST) Received: from denia.c.googlers.com (5.236.236.35.bc.googleusercontent.com. [35.236.236.5]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-4653c47f124sm9282731cf.62.2024.11.22.01.48.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Nov 2024 01:48:28 -0800 (PST) From: Ricardo Ribalda Date: Fri, 22 Nov 2024 09:48:04 +0000 Subject: [PATCH v2 7/7] media: ipu-bridge: Remove unneeded conditional compilations Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241122-fix-ipu-v2-7-bba65856e9ff@chromium.org> References: <20241122-fix-ipu-v2-0-bba65856e9ff@chromium.org> In-Reply-To: <20241122-fix-ipu-v2-0-bba65856e9ff@chromium.org> To: Mauro Carvalho Chehab , "Rafael J. Wysocki" , Len Brown , Robert Moore , "Rafael J. Wysocki" Cc: Sakari Ailus , Dan Carpenter , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, acpica-devel@lists.linux.dev, Ricardo Ribalda X-Mailer: b4 0.13.0 The ACPI headers have introduced implementations for some of their functions when the kernel is not configured with ACPI. Let's use them instead of our conditional compilation. It is easier to maintain and less prone to errors. Signed-off-by: Ricardo Ribalda --- drivers/media/pci/intel/ipu-bridge.c | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/drivers/media/pci/intel/ipu-bridge.c b/drivers/media/pci/intel/ipu-bridge.c index be82bc3e27d0..6bdf42f6769f 100644 --- a/drivers/media/pci/intel/ipu-bridge.c +++ b/drivers/media/pci/intel/ipu-bridge.c @@ -2,6 +2,7 @@ /* Author: Dan Scally */ #include +#include #include #include #include @@ -107,7 +108,6 @@ static const char * const ipu_vcm_types[] = { "lc898212axb", }; -#if IS_ENABLED(CONFIG_ACPI) /* * Used to figure out IVSC acpi device by ipu_bridge_get_ivsc_acpi_dev() * instead of device and driver match to probe IVSC device. @@ -131,7 +131,7 @@ static struct acpi_device *ipu_bridge_get_ivsc_acpi_dev(struct acpi_device *adev for_each_acpi_dev_match(ivsc_adev, acpi_id->id, NULL, -1) /* camera sensor depends on IVSC in DSDT if exist */ for_each_acpi_consumer_dev(ivsc_adev, consumer) - if (consumer->handle == handle) { + if (ACPI_PTR(consumer->handle) == handle) { acpi_dev_put(consumer); return ivsc_adev; } @@ -139,12 +139,6 @@ static struct acpi_device *ipu_bridge_get_ivsc_acpi_dev(struct acpi_device *adev return NULL; } -#else -static struct acpi_device *ipu_bridge_get_ivsc_acpi_dev(struct acpi_device *adev) -{ - return NULL; -} -#endif static int ipu_bridge_match_ivsc_dev(struct device *dev, const void *adev) { @@ -261,9 +255,7 @@ static enum v4l2_fwnode_orientation ipu_bridge_parse_orientation(struct acpi_dev struct acpi_pld_info *pld = NULL; acpi_status status = AE_ERROR; -#if IS_ENABLED(CONFIG_ACPI) status = acpi_get_physical_device_location(adev->handle, &pld); -#endif if (ACPI_FAILURE(status)) { dev_warn(ADEV_DEV(adev), "_PLD call failed, using default orientation\n"); return V4L2_FWNODE_ORIENTATION_EXTERNAL; @@ -498,9 +490,7 @@ static void ipu_bridge_create_connection_swnodes(struct ipu_bridge *bridge, if (sensor->csi_dev) { const char *device_hid = ""; -#if IS_ENABLED(CONFIG_ACPI) device_hid = acpi_device_hid(sensor->ivsc_adev); -#endif snprintf(sensor->ivsc_name, sizeof(sensor->ivsc_name), "%s-%u", device_hid, sensor->link); @@ -671,11 +661,7 @@ static int ipu_bridge_connect_sensor(const struct ipu_sensor_config *cfg, struct acpi_device *adev = NULL; int ret; -#if IS_ENABLED(CONFIG_ACPI) for_each_acpi_dev_match(adev, cfg->hid, NULL, -1) { -#else - while (true) { -#endif if (!ACPI_PTR(adev->status.enabled)) continue; @@ -768,15 +754,10 @@ static int ipu_bridge_ivsc_is_ready(void) unsigned int i; for (i = 0; i < ARRAY_SIZE(ipu_supported_sensors); i++) { -#if IS_ENABLED(CONFIG_ACPI) const struct ipu_sensor_config *cfg = &ipu_supported_sensors[i]; for_each_acpi_dev_match(sensor_adev, cfg->hid, NULL, -1) { -#else - while (false) { - sensor_adev = NULL; -#endif if (!ACPI_PTR(sensor_adev->status.enabled)) continue;