Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp3037694lqz; Wed, 3 Apr 2024 16:50:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXzGjsfpnCwKHJKJ8OwtG4dqlayx4bmv93MwUaIhXkGh9nUU5+6E5IxJ75YPVX7YE7mT4V7gCGFyL2ZD2xKiXt5SXN3zCkJPbPjp/tvmg== X-Google-Smtp-Source: AGHT+IGAdCod969R4SYPA88o4lO+ZzidoH3yHj+gpJbzoImVlHhuWOC/xbKc/SLM4n993UVNL/qS X-Received: by 2002:a05:622a:1:b0:434:46d1:9256 with SMTP id x1-20020a05622a000100b0043446d19256mr4046419qtw.25.1712188257597; Wed, 03 Apr 2024 16:50:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712188257; cv=pass; d=google.com; s=arc-20160816; b=C2MqSsUaISs9xnupDp+hzMkD7F81Srw2Ocs0REEJQhXCwVDRp9GZcw/asMcHA1kn7t HhiBEkakZVmmJwFCETuITgRHSy5RGVijljkYZJlNlluX/3hmb5j2HQzLZ7CLnjvx2Icv N3fPSJn7w8uMDwe+9magvOPpGExu2Ho+wbYX4jGWGBAam2EZAAHB/kgkpFYPiOFChMKw cUyWmZZTbOt3jJ1Ynxg32YpqK5hm0hG6/CmWHQKuEbax4jhVxG8W35ZKb4WnBj/UHYks Mhcb4j6C5oq2HXtuO0Z5JQNGmaTOxFWW+BUevDhtOb6xoW+AXUHjgIHGQNh7VgCBBxFV AVtA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=EQVBORnWDSoSM/9COY0BSXBaL72d0LXDp6zNT3sTSJo=; fh=akijxW9uicVztNDZAxy5RDsLC9+J90kjmdXMi5SH+q0=; b=MP/EcVhHG1+8OlkVE9MAFWmJR83NX+yKS2VG9okOC+AE6iau05AbX0bgZDTgkG+epb Jnmd3Y/XQ2ST8lUp3IWqZVnuOPyOU6BVyuqILX9sLidnUBXqaf/xrltiCrQajxkwoT30 XZSQbx50fXO5fTSqwtMsYp9plVvJzXtS3KWVP0yfqhdzJAZ1FCuojXk2gt4q4WG2qeDA fE/tY827NacIQhbNrkGGME6tfB1VkgcNIreuggnd1PlehmxjGVHNSX7i9E9KfFVbiNxO MGl/8QOkIzBmZqOxZ7T/fOOmXVAmiQ7WmY+3aMxa3C/uSedqLstdMdCZRXqlCJIUBT8B Tlhw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@toblux-com.20230601.gappssmtp.com header.s=20230601 header.b=snW0wFie; arc=pass (i=1 dkim=pass dkdomain=toblux-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-130750-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130750-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id h13-20020ac87d4d000000b004313ec88970si15645341qtb.718.2024.04.03.16.50.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 16:50:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-130750-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@toblux-com.20230601.gappssmtp.com header.s=20230601 header.b=snW0wFie; arc=pass (i=1 dkim=pass dkdomain=toblux-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-130750-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130750-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 54FB71C26350 for ; Wed, 3 Apr 2024 23:50:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 04867156871; Wed, 3 Apr 2024 23:48:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=toblux-com.20230601.gappssmtp.com header.i=@toblux-com.20230601.gappssmtp.com header.b="snW0wFie" Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) (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 4FDB7139D for ; Wed, 3 Apr 2024 23:48:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712188112; cv=none; b=ttDFJkdYJ7c3BrQ9Sdk7u19/tWmjEqad/NO22wr26ySB8/1ROWXzkXolmHf7daTwQqzZfCFVp8VIxKyO6htlWS8ew2xlpN7pjLYPqoV0cUup4lof2x0A2jwbB/B0ezToZu6h4mV2zZL6nZlw7Z1yyODVGfha1h7jBA8pz67QV5s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712188112; c=relaxed/simple; bh=whGfHs27slueugGyED6fbvzc6tFJFZGWIsW0JD5Q82k=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=fF6zc0kAGaVyxt9OvBXpeb3Gc5pjMka9gTYoklunt3M2BZCKrUsLQjvEhqXHYTiFLwMexnPa9wolNsXYpV/jWL0ZGi7M9BaD9pNSYS5qWuZHF7V9+VQsECBdIHFxy9foTb6MNNf1KP4Z1FX+jHr4HcTM61+pPOiDZGm7CG0ECVA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=toblux.com; spf=none smtp.mailfrom=toblux.com; dkim=pass (2048-bit key) header.d=toblux-com.20230601.gappssmtp.com header.i=@toblux-com.20230601.gappssmtp.com header.b=snW0wFie; arc=none smtp.client-ip=209.85.218.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=toblux.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=toblux.com Received: by mail-ej1-f44.google.com with SMTP id a640c23a62f3a-a4644bde1d4so54914266b.3 for ; Wed, 03 Apr 2024 16:48:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toblux-com.20230601.gappssmtp.com; s=20230601; t=1712188108; x=1712792908; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=EQVBORnWDSoSM/9COY0BSXBaL72d0LXDp6zNT3sTSJo=; b=snW0wFiebLzhsTxh5fipDby85/SIs8Oq6ThdRKKVBV0P581LGe7S2vGkfnC+BCoTVj DPaOEQFyV3ahGqAORpXaVIMyGaIKx21eVQwVOkB2oltv1sv/r8pHW35CCWzGCtdBh9GO uzgO5thSRJqLGmwpFnTZRp5M2iuBT3nDSKOVqFp5LB1I2jXb6rXJMw20BN8xgbFgyOyW Jmd6cwYxJWODdXL/xgwt5HHc883vRGve75775a7zUjfCM8i0g08q9O42Ap5lnNuv+OO+ nDaw1Hf5VzXm4EVfmft3VM0Uqmdo/zL4dZz2aKKdVADcpUC2eflJTX2X56gbJfgAW1pJ RAHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712188108; x=1712792908; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=EQVBORnWDSoSM/9COY0BSXBaL72d0LXDp6zNT3sTSJo=; b=vugJaMbTDXYMzGmHim2T7YwX3ygG6k8gafgLE2qCYmlbaDFmm4YuVj4jLT/+41GqWt jeuFnLOjEfI1xE9z8QZ2r6wswyjxCs01T8HnNmVL0b/YeibHBWK5J3sTacsAEsB5Kepq nnbfB0lJfcDhYUMEGq6VV3cfUIl9fWP4eS9DjCU0rlFQO3JWdEZC1JHFRFqNl7NRZuPj gg3w+AFHNn+TisG9Y72rsXKWlKq2aMEG2TH9lYJSrGp1kzxb+6kI3S/dh5zjs0HNTsWM 5gByZSnUePBO2lKXfgWtChxxxRn85jVptK4vLBpThkxiGj4BUIeWBE0qLuGZ8RbA/yjo pCbQ== X-Forwarded-Encrypted: i=1; AJvYcCUon1s8j6pGgUbZhWZ6j39HyGrnGcGR2lbi4w8cdT/Vyc0iHIOHAXNS/APHpbd9XnrOrdkFtBnh3Qn80BcFBH0Lkbo/d7gDmVhQw5yD X-Gm-Message-State: AOJu0YziOx4Ttzu8GqOpuUJKgszkZK7RKkHKT3SVlVPKDeECD9fgG5LS EJcrzA+pW37jBhnjtG2tKvNRp69U04QFmUD+yEL+pFCHCDopkgsgeLIpWjXVfFQ= X-Received: by 2002:a17:907:2d8f:b0:a4e:2ad3:60ff with SMTP id gt15-20020a1709072d8f00b00a4e2ad360ffmr556549ejc.47.1712188108518; Wed, 03 Apr 2024 16:48:28 -0700 (PDT) Received: from fedora.fritz.box (aftr-82-135-80-212.dynamic.mnet-online.de. [82.135.80.212]) by smtp.gmail.com with ESMTPSA id q17-20020a1709060e5100b00a4623030893sm8158308eji.126.2024.04.03.16.48.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 16:48:28 -0700 (PDT) From: Thorsten Blum To: Chris Zankel , Max Filippov Cc: Greg Kroah-Hartman , "Jiri Slaby (SUSE)" , linux-kernel@vger.kernel.org, Thorsten Blum Subject: [PATCH] tty: xtensa/iss: Use umin() to fix Coccinelle warning Date: Thu, 4 Apr 2024 01:47:30 +0200 Message-ID: <20240403234729.175168-2-thorsten.blum@toblux.com> X-Mailer: git-send-email 2.44.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Use unsigned size_t to improve len data type and umin() to fix the following Coccinelle/coccicheck warning reported by minmax.cocci: WARNING opportunity for min() Signed-off-by: Thorsten Blum --- arch/xtensa/platforms/iss/console.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/xtensa/platforms/iss/console.c b/arch/xtensa/platforms/iss/console.c index 8896e691c051..b493fc50933d 100644 --- a/arch/xtensa/platforms/iss/console.c +++ b/arch/xtensa/platforms/iss/console.c @@ -167,8 +167,9 @@ late_initcall(rs_init); static void iss_console_write(struct console *co, const char *s, unsigned count) { if (s && *s != 0) { - int len = strlen(s); - simc_write(1, s, count < len ? count : len); + size_t len = strlen(s); + + simc_write(1, s, umin(count, len)); } } -- 2.44.0