From patchwork Fri Sep 27 09:42:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 831245 Received: from mail-qt1-f171.google.com (mail-qt1-f171.google.com [209.85.160.171]) (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 7F4AC1BB694 for ; Fri, 27 Sep 2024 09:42:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727430142; cv=none; b=YA0ggDJK22qNbhU3TKoDy57xsCudMRMmR9qyR7yK8L3pxaGYB3qG3+1QC4cyAEoF8NQNWd8v7o25kdOCTr1JtgzA9PsiGkka8KDqWatbdQ4M9cDZCL2GTP0kWz4aq7rQgIwQw+ptwCOa2L4bgs7//05/kOV7OkbQ2NC7+8+6ztA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727430142; c=relaxed/simple; bh=NzGO/n5w0inQUSk9Mrg2JWrHNdom3NBH7egriAh15og=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=O2KPkpBNyH2wAUEUzD2zJQs7R6u5PpGvtUIbHeFpSZ6KdFRE3n0wpUkIXfTXYDgERVCrEZFfne6yjDgVXtVhgIuKfklt23EHy28h7wqpNh3ah0wH9YFgx2TOOsy3pBHvgmqIWvhqDsrK0Kwnhlmy1jZsFbnFNJg6VRS753Zw1yI= 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=bgxBW2XG; arc=none smtp.client-ip=209.85.160.171 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="bgxBW2XG" Received: by mail-qt1-f171.google.com with SMTP id d75a77b69052e-4582760b79cso9914571cf.2 for ; Fri, 27 Sep 2024 02:42:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727430139; x=1728034939; 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=YwJYpIvOPMah9ocVmXZ/vnejPzGmcFsHFsHmC+ou0no=; b=bgxBW2XG1nkeaFkLtiLwwW/ZrInM6i1enQVEFDZqz104Fc6EOuNCRje4+0W2PGRZMl 4CxozEV8VpsUiRzFHN39VAw3DaejLCS2StWRb281CMkpCqj8QAaeLRFhDKK/CI00v101 P0NbTvT4PypcAQ7zlKSZiit+55Ffo6yJkhN7s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727430139; x=1728034939; 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=YwJYpIvOPMah9ocVmXZ/vnejPzGmcFsHFsHmC+ou0no=; b=J71QymF3Xu/KgRGq5vQCumprvcEBzkhkjJ7TzP7tAXewHbk71SkHcrNvXW80sWI1mV TcQyO1zaN8/1rwDfFoBKOz8q64IUuQlQlqMX+m9XZfXoXSP2NACBXWRCcHFbba19riGU mj7goaPYOfiyjYYtMl/6qwtaLZIczVOuBuem6qeFYOEXzDtM/CqRAZjJvbi4Zg4zZFTl vNHM32fZkw/1IvopA+0kXXqa835s55LyfDCOhHUIKXbISEx8IpsqT1/oDa7qQRxUf3/G BbbVhcrS8hydWZcHArxj0wAG7Kc2XUoC4sM7/455BnP8qiWkch7DxS/fRQHSFHQcrxYY zekQ== X-Gm-Message-State: AOJu0YzJqxZjAwSfh9XWc1Fg9C6AtQJxPsaUMdq6l9gU76cFj+cSQuCP 02CEFgUe/GD+ds57ptMrbThTC/hnXZVhCJwRHKOCLD+3Qf1K2qCvIw/uNsUitUbJU/75Gf4hvjI = X-Google-Smtp-Source: AGHT+IEnh+IrKYShpTgUNIZMuZaNaBR2/h1owwwElW96gX0SdsoHqfJeYKcEmzOAdy8nirRvvS/+Hg== X-Received: by 2002:a05:6214:5789:b0:6c5:32a5:567a with SMTP id 6a1803df08f44-6cb3b5b93ddmr40210646d6.1.1727430139367; Fri, 27 Sep 2024 02:42:19 -0700 (PDT) Received: from denia.c.googlers.com (76.224.245.35.bc.googleusercontent.com. [35.245.224.76]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6cb3b5ff594sm7231606d6.14.2024.09.27.02.42.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Sep 2024 02:42:17 -0700 (PDT) From: Ricardo Ribalda Date: Fri, 27 Sep 2024 09:42:13 +0000 Subject: [PATCH 1/3] media: ti: cal: Use str_up_down() Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240927-cocci-6-12-v1-1-a318d4e6a19d@chromium.org> References: <20240927-cocci-6-12-v1-0-a318d4e6a19d@chromium.org> In-Reply-To: <20240927-cocci-6-12-v1-0-a318d4e6a19d@chromium.org> To: Benoit Parrot , Mauro Carvalho Chehab , Sakari Ailus , Bingbu Cao , Tianshu Qiu , Greg Kroah-Hartman , Hans de Goede , Andy Shevchenko , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev, Ricardo Ribalda X-Mailer: b4 0.13.0 The str_up_down() helper simplifies the code and fixes the following cocci warning: drivers/media/platform/ti/cal/cal-camerarx.c:194:3-9: opportunity for str_up_down(enable) Signed-off-by: Ricardo Ribalda --- drivers/media/platform/ti/cal/cal-camerarx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/ti/cal/cal-camerarx.c b/drivers/media/platform/ti/cal/cal-camerarx.c index 42dfe08b765f..ba8c4743f539 100644 --- a/drivers/media/platform/ti/cal/cal-camerarx.c +++ b/drivers/media/platform/ti/cal/cal-camerarx.c @@ -191,7 +191,7 @@ static void cal_camerarx_power(struct cal_camerarx *phy, bool enable) if (i == 10) phy_err(phy, "Failed to power %s complexio\n", - enable ? "up" : "down"); + str_up_down(enable); } static void cal_camerarx_wait_reset(struct cal_camerarx *phy) From patchwork Fri Sep 27 09:42:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 831121 Received: from mail-qv1-f51.google.com (mail-qv1-f51.google.com [209.85.219.51]) (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 3F7B61BB6B9 for ; Fri, 27 Sep 2024 09:42:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727430144; cv=none; b=ox66iYWbk0lzLlRIJKTDdZhpbX8sd3gjnmkK+0qNUoXNRJ1TvThmVA28Ih6q5cjN8fJMclLtZ99J/nIJQ1Sw9FXiMrDdy+sR9MXxRA0/6+w+Yf+/UkQNQ51+mBpZFSir89ScwYEQKrlN6vCXU9l0mki3ELTpKN15yetmhYwA89U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727430144; c=relaxed/simple; bh=kCl1YSqZuUUZDtGA+QAZtwsRUo5HY0IPZiSWxLVmfm4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qwAPCEhjfS7vcatM6wX3oE9fQEf8+3bm5pBjvVnteSGTA4LkAKBCKMvFkFHTajJzKBn8ldywYBHiF8svGhGHM4rYKX3nmMw2XVoR6je87yHhpxPhS9kJPTPu1+bpgCz17G2SkLsbQ0STgXjedraW6ALNzOniWt0ZxZqBKxl+17Q= 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=YGXwi1ry; arc=none smtp.client-ip=209.85.219.51 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="YGXwi1ry" Received: by mail-qv1-f51.google.com with SMTP id 6a1803df08f44-6cb2f271043so17064256d6.0 for ; Fri, 27 Sep 2024 02:42:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727430141; x=1728034941; 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=VINaQxL9vW722McPbfM1p2Q0+fZYKttm/dJVtWO/GI0=; b=YGXwi1ryz/iwZd1v/SFBTCTDFiXFExify3cBGmCo0OfzMABIMNt60KaPc7ASh7PzaN ZowxDlIk11m91E/gw/vahA2iGqFR4R4EAmyfhCdIQp5NdNLa692lCVF51/NXxMz0LI7+ Htdhwr4ReSp+veUnh6GLRHuwURaquvGVI3hK8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727430141; x=1728034941; 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=VINaQxL9vW722McPbfM1p2Q0+fZYKttm/dJVtWO/GI0=; b=HpBUTaAl68ujSG5pUVe/I0koxSIsj8/VQyRqRJpWyonAF7gp7C5e+eqU+YhDo5/Zvk JLIg4AG8Y5bDnrRQu9F4x/mj51OmMlv0m/hhUv2PEPPIk2aLT5lsDHht5bl6nRGMPcS2 v+Py7ti0vGpqQf7pCUR0MSf7CgW+wXh8OW+MaKbadAuJ3cpr2KziKpYwr7qRjz8Bt9p4 NjOvditEDFO+y8GtMHsrGzKpLstvYpwtSUFYrhR6eRNLODkS0Q7TyffgHT6Tj2e+foqG Qu+G5ErlJXbRicqBbeIrgVTZ5L911ePJiKfK0aRg1C5Wpln3s8SHv+5SX3OgPaA5mCIg nl2w== X-Gm-Message-State: AOJu0YyrNQu1HS7N610t1w6SZv35w1i41fx0w5Uc0p+zLovH10eKWKUR kgvTVbOq8GFCrr1Xkl278Sii1ST80mMg/G7+xxldhW+kHSJdDPpXySTIoWVOA+3mGKXkoCssgy4 = X-Google-Smtp-Source: AGHT+IGGsdMZl/i8EG8b5Z1JmOsFAyZ9WklfULMXZz5d7lRQYLgXR1nLV+QVTf216ds3TwRWII3bkw== X-Received: by 2002:a05:6214:320d:b0:6c3:5a89:9998 with SMTP id 6a1803df08f44-6cb3b60fa9cmr33792876d6.23.1727430141573; Fri, 27 Sep 2024 02:42:21 -0700 (PDT) Received: from denia.c.googlers.com (76.224.245.35.bc.googleusercontent.com. [35.245.224.76]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6cb3b5ff594sm7231606d6.14.2024.09.27.02.42.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Sep 2024 02:42:20 -0700 (PDT) From: Ricardo Ribalda Date: Fri, 27 Sep 2024 09:42:14 +0000 Subject: [PATCH 2/3] staging: media: ipu3:Use str_down_up() Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240927-cocci-6-12-v1-2-a318d4e6a19d@chromium.org> References: <20240927-cocci-6-12-v1-0-a318d4e6a19d@chromium.org> In-Reply-To: <20240927-cocci-6-12-v1-0-a318d4e6a19d@chromium.org> To: Benoit Parrot , Mauro Carvalho Chehab , Sakari Ailus , Bingbu Cao , Tianshu Qiu , Greg Kroah-Hartman , Hans de Goede , Andy Shevchenko , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev, Ricardo Ribalda X-Mailer: b4 0.13.0 The str_down_up() helper simplifies the code and fixes the following cocci warning: drivers/staging/media/ipu3/ipu3-css.c:229:18-47: opportunity for str_down_up(state & IMGU_STATE_POWER_DOWN) Signed-off-by: Ricardo Ribalda Reviewed-by: Andy Shevchenko --- drivers/staging/media/ipu3/ipu3-css.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/ipu3/ipu3-css.c b/drivers/staging/media/ipu3/ipu3-css.c index 1b0a59b78949..bb22375481a0 100644 --- a/drivers/staging/media/ipu3/ipu3-css.c +++ b/drivers/staging/media/ipu3/ipu3-css.c @@ -226,7 +226,7 @@ int imgu_css_set_powerup(struct device *dev, void __iomem *base, state = readl(base + IMGU_REG_STATE); dev_dbg(dev, "CSS pm_ctrl 0x%x state 0x%x (power %s)\n", - pm_ctrl, state, state & IMGU_STATE_POWER_DOWN ? "down" : "up"); + pm_ctrl, state, str_down_up(state & IMGU_STATE_POWER_DOWN)); /* Power up CSS using wrapper */ if (state & IMGU_STATE_POWER_DOWN) { From patchwork Fri Sep 27 09:42:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 831244 Received: from mail-qv1-f42.google.com (mail-qv1-f42.google.com [209.85.219.42]) (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 6F2A61BBBFA for ; Fri, 27 Sep 2024 09:42:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727430146; cv=none; b=p9PlRFaN3uLUS5rkJ+hWpvOtnAgmWgg1f5O7fSjtz2HypNUSFEqLL9t2VBPBunetCx2Wbk55LysPsm81yqwAJDqNXyQWyA78l2nLSj3aBb+XX74HMueiqhEjFys5zQv4ZD9vSbmQgzPucaCawx81m4DdpkLd7rErg3cUj4aljak= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727430146; c=relaxed/simple; bh=VyNnQQDdJJNeW/LwMh2KTy2Bsd63Uen2yuUOk3ftr40=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=U7Ifapjt9b/VicV/NrkPUuEgL3rIS+MzDkIS24qsJKkDjJUYPa5F5vtjZDC5BOA3t4NbHeK+Y7BWTxLY5y+lIdlQjLD+pfEozX1AlPkji+f8SYHgZ1VgseIM42VhtFOlr5JrAc1nAiJ4afI46Tep3AG4jRApGCEYLncSQZpX/fk= 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=cbwUDazH; arc=none smtp.client-ip=209.85.219.42 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="cbwUDazH" Received: by mail-qv1-f42.google.com with SMTP id 6a1803df08f44-6cb321145easo13611296d6.1 for ; Fri, 27 Sep 2024 02:42:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727430143; x=1728034943; 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=H5LcjuiiFLMydGICnxC7Y1POK5qtShnTkO1KY/L5xYc=; b=cbwUDazH20b8HMp8EGF0fOP96luAgSBMpuH1hE0sevSaIbuiNgkKpr5ftXbh9Jhn2T MeKCtMsHrH1+ulUYePGX975CYMBrOqcY4IXqEW4yTTro+PlWVn6CkBb3/kinKDk3AwMw qYU3P5cUtXASC9KeVP8Dp3j5bJFKKIHsmEXqo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727430143; x=1728034943; 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=H5LcjuiiFLMydGICnxC7Y1POK5qtShnTkO1KY/L5xYc=; b=RPkIGkFvRcCF7cg2zVWmkSfAVbU0HjW82nQ8iNUWPMxATfUOz0r/af1QxYwz/3vcye Vsut2x9fVpUy/9/2hL2d/cb8FbWEiiwM31r5ciepndiZAu4nHPQOxaIZo+vnO1SgTNLN kBykKCQ7rxDHdWPdxuvIRGpDiwP/fM0X+Mhb0FmiagC3IYhNicaKqMi0IhE2wP6hpRA0 gjA5A4D/P4kRsiWsOdBYFvrxILl2+5NtORjehY/XHYLL023bpjBexTrcrNzWkFiwCr1F m8O2SRJpvO2pJjJMUvRKQQ8Eb8nci4/c9WwupCoRuT5WlJPAFQKUTJmgktBgYIOrNL5L b+gw== X-Gm-Message-State: AOJu0Yxan4nxK1CzO9M0GwYTnQ4cfRyBBU8Jif6E/WK1MbuBgE4Rxvqf WK/2isE1obivGwIciz0LvFZdy8S9HmPtQygZHVhsid9gkgC5gBxFPr/HG/ln6M8H3T77oH5xgqE = X-Google-Smtp-Source: AGHT+IHqAWy4X2erODR4y6wB6ll6Vg8M7MrsnkD9K4fU/rxNaepW2iQICN+JlQ+jvD6Nif1cTzZ8/A== X-Received: by 2002:a05:6214:2583:b0:6cb:46b4:5771 with SMTP id 6a1803df08f44-6cb46b45b01mr7123196d6.13.1727430143583; Fri, 27 Sep 2024 02:42:23 -0700 (PDT) Received: from denia.c.googlers.com (76.224.245.35.bc.googleusercontent.com. [35.245.224.76]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6cb3b5ff594sm7231606d6.14.2024.09.27.02.42.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Sep 2024 02:42:21 -0700 (PDT) From: Ricardo Ribalda Date: Fri, 27 Sep 2024 09:42:15 +0000 Subject: [PATCH 3/3] media: atomisp: Use max() macros Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240927-cocci-6-12-v1-3-a318d4e6a19d@chromium.org> References: <20240927-cocci-6-12-v1-0-a318d4e6a19d@chromium.org> In-Reply-To: <20240927-cocci-6-12-v1-0-a318d4e6a19d@chromium.org> To: Benoit Parrot , Mauro Carvalho Chehab , Sakari Ailus , Bingbu Cao , Tianshu Qiu , Greg Kroah-Hartman , Hans de Goede , Andy Shevchenko , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev, Ricardo Ribalda X-Mailer: b4 0.13.0 The max() macro produce nicer code and also fixes the following cocci errors: drivers/staging/media/atomisp/pci/sh_css_frac.h:40:17-18: WARNING opportunity for max() drivers/staging/media/atomisp/pci/sh_css_frac.h:50:17-18: WARNING opportunity for max() Signed-off-by: Ricardo Ribalda --- drivers/staging/media/atomisp/pci/sh_css_frac.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/sh_css_frac.h b/drivers/staging/media/atomisp/pci/sh_css_frac.h index 8ba65161f7a9..9642506d2388 100644 --- a/drivers/staging/media/atomisp/pci/sh_css_frac.h +++ b/drivers/staging/media/atomisp/pci/sh_css_frac.h @@ -37,7 +37,7 @@ static inline int sDIGIT_FITTING(int v, int a, int b) int fit_shift = sFRACTION_BITS_FITTING(a) - b; v >>= sSHIFT; - v >>= fit_shift > 0 ? fit_shift : 0; + v >>= max(fit_shift, 0); return clamp_t(int, v, sISP_VAL_MIN, sISP_VAL_MAX); } @@ -47,7 +47,7 @@ static inline unsigned int uDIGIT_FITTING(unsigned int v, int a, int b) int fit_shift = uFRACTION_BITS_FITTING(a) - b; v >>= uSHIFT; - v >>= fit_shift > 0 ? fit_shift : 0; + v >>= max(fit_shift, 0); return clamp_t(unsigned int, v, uISP_VAL_MIN, uISP_VAL_MAX); }