From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) (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 B240436728B for ; Thu, 13 Aug 2026 07:56:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786607770; cv=none; b=W09M+ctR68drIzHGj0+WsoNGMFaq7u/7wsoh6Lyu4IM9fjnna4OHG7fsyj7Q980+9SkpHR6MzeIukhM/7sF7oq2DFllgtjzANRgjCfnZjOkXIYNkP70XQ377vrH0ub5YppUw533cgYehyfibOgJd/2KXlqe8/Tq0h3l9JE0NAqg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786607770; c=relaxed/simple; bh=VK4j+xu08h1wN3/o+FlfHYnuyc2SkPv12s7ZOs9MMjY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=A2s2Mag1y6LWuy6sFahlCfLjYTB+H22ujo6glIrpKOyQwp5HAoe/AGkyih+OiYyY4SAB4nFTRBHP6zY9hvJDRXyBbRptVkDz8VYqrxrCuTKcvITS07mpWr5QlEfY3GxF7ksMQ9b+8cwbe6MDBQZgcqxkXQag8sIZRVvBBu8Tk04= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=HHoDOGUJ; arc=none smtp.client-ip=209.85.214.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HHoDOGUJ" Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-2caed617615so5673215ad.3 for ; Thu, 13 Aug 2026 00:56:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786607769; x=1787212569; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=YI19pGDcKtgcxpd8zZLgfvky7dUvBcCdOVpIkb/C0Ow=; b=HHoDOGUJuC3D8l6MjmWMCu4dfWHy/NFIbNVFJ2AbsSUKOSjcfihlRUF2hXD4ikxJc8 DNVpmHI8yavPewBGmCoMKtO9wr5cZWCiqTf540jUNBwMrb21jIT9WS8pRLpQpDYgAjqd +MibLrGePzlYoQXiq25gkqurcFQTDcThoLPo/DDO1hUdtn2aZz3Pz68hCLcCtzrrjcWu 8X4CbDoPEMUv6Y30oy2WwcFzBLl+ckS0kM6d4kdVC3f03eTZsr8MD0bqH6a9ZgkyXdn3 nWZTsM18d6nED/z5crfk2076YEDgJNRjWhUSJH7c6trvanb0R+OiCIJ9brLqyKDU0G8H ZciA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786607769; x=1787212569; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=YI19pGDcKtgcxpd8zZLgfvky7dUvBcCdOVpIkb/C0Ow=; b=mBkP4T3vCU52RWC3AZfZ033+vcCVFnIlHQz3zIMJY17F+0aK3sa22kzJ2k8EreUZz/ 8XyB4F4QQZ29ID+IlZheIfpbI0Um5BXpn5VL/IO6q7YJyVP1T8GEPh9tIAASCIS7Uoex t6o6H3q1EIy5x5S22bQi7hOCSa0H9NzV6FxfHXFgE9Fb28tBDg2ZOLJqiZR7yeuYj8iI XC/WJ9tNliITlb1Wdu8duu4mQZhfZFOkoVIPo/APGfW9ZFi+1YUKhDJjF7Rp2KaYW+87 3dcHzRngLs53NNrOTixNP+dhppSBOJXamQiWnqOMl3v2XsHsbbwIlR4smIQx8/XjAaT/ 6IWw== X-Forwarded-Encrypted: i=1; AHgh+RpqIrB/QTlJphzKgU5ZZ2RN8Vfged3Bpu4u6E//3zlsj6ppus6HJheptieSkkcicFQRvO8Z4YSvuqjjTyI=@vger.kernel.org X-Gm-Message-State: AOJu0YzIL8P5jpMQSWsD0+kAr4e/duHm91LOLhilHFTc1PboZt6An2cC 8LkEvgjfm8vsrcn21Cko1u5c09DS/Jftb49rGqypWPbYlF1hVBgm4T8E X-Gm-Gg: AR+sD101A/SYs8iW+0Nz4yx1Z+5l7XortPKbtY0Vkal8le/X57I064yJNarmsoh7UXJ 5NugQozq4Kr5tHuC9GTDd+sAiiN8NFjK79uVlDUHObT8bpJ9N4BAfHnTLGCyWUxR67Ra9i440SJ b4XOos82FIaItsI0CkkgtznVdzlUm9iveChR+wej+HVxQ+mlXZyUlo9TwuhQzyLXSPi2qT3Dclh DF4PQI8SaD9XpytTIQyhVxy7IfxgFeZYfrjzdHarbzkyCaswq6R0xd00GqUDYycHc1K+kFy0+MR wX4Rze9QMHIlNW7hDxgR8AXfqfekvwWjObg3pSFTSDUh9wHOf9M+XEjY+iPhbYDmQ702tewkNr6 bxcbIC59hFUyd2PnYga1n7o0DkIELvk82caGt3zw6zE2bZHkOX4AzfKdiml39ggwa//K/+ZiUe7 Jz1CgJBPbsF+gMIcjg2NJMXEhojdU+MBqTcteB7wi0GU7Xp/KaC2PDX9U2VaC5PCS5iFW6BD/Bu Yd5QDVWDhTtv6Iyz1/ngb2KzLF1nj03FB1G7jkZfzCiWg== X-Received: by 2002:a05:6a21:3397:b0:3c3:7e9c:e292 with SMTP id adf61e73a8af0-3cc5533a206mr5508818637.25.1786607768959; Thu, 13 Aug 2026 00:56:08 -0700 (PDT) Received: from ubuntu-vm.. (c-73-189-122-63.hsd1.ca.comcast.net. [73.189.122.63]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1412d961e39sm9545397c88.11.2026.08.13.00.56.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Aug 2026 00:56:08 -0700 (PDT) From: Rishab Madhugiri To: hansg@kernel.org, mchehab@kernel.org, gregkh@linuxfoundation.org Cc: dan.carpenter@linaro.org, andy@kernel.org, sakari.ailus@linux.intel.com, linux-staging@lists.linux.dev, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Rishab Madhugiri Subject: [PATCH v2] staging: media: atomisp: Use ARRAY_SIZE macro Date: Thu, 13 Aug 2026 07:55:29 +0000 Message-ID: <20260813075529.153217-1-rishab.madhugiri@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Clean up loop bound calculation by replacing sizeof(bds_factors) / sizeof(struct bayer_ds_factor) with the ARRAY_SIZE() helper macro to improve readability and maintainability. v2: Move loop increment to the same line as the for statement as requested. Signed-off-by: Rishab Madhugiri --- drivers/staging/media/atomisp/pci/atomisp_compat_css20.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c index 0ee52637e..e8734ca1a 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c +++ b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c @@ -2160,8 +2160,7 @@ static void __configure_video_pp_input(struct atomisp_sub_device *asd, bayer_ds_out_res->width = effective_res->width; bayer_ds_out_res->height = effective_res->height; - for (i = 0; i < sizeof(bds_factors) / sizeof(struct bayer_ds_factor); - i++) { + for (i = 0; i < ARRAY_SIZE(bds_factors); i++) { if (effective_res->width >= out_width * bds_factors[i].numerator / bds_factors[i].denominator && effective_res->height >= out_height * -- 2.43.0