Received: by 2002:ab2:2441:0:b0:1f3:1f8c:d0c6 with SMTP id k1csp119855lqe; Thu, 4 Apr 2024 01:11:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX3q3Pt8oJ1eu7XbzlFoisVk2JuXPb+MEt7yXw1DbdSu+y6aOnhcEd7IqTuSiauhmY2hLOTiKQTHnVIukVnA33MxyTcn2ofV1wsODUPrQ== X-Google-Smtp-Source: AGHT+IF0rDqaPpBgyOAPAonP/cvSchuG27hMMz3b/JkOzE82Pi1AdMkUR33WgyWnnyqwOvQdKStU X-Received: by 2002:a05:6a21:9201:b0:1a7:23ae:f002 with SMTP id tl1-20020a056a21920100b001a723aef002mr2345981pzb.25.1712218285992; Thu, 04 Apr 2024 01:11:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712218285; cv=pass; d=google.com; s=arc-20160816; b=a+429RFDRQ6sXGDRt3NXX9Ps2MD1p0NoUEqzrX/Qu9XYlx3GhlbsEYgrp/9uM709wz 4uudcKMQuie0IMHfgAMS2oJmErkq8US5nSnqwd2P7ePOJFky+Tv+XdXd5++ok5L1+kuB t0LSCLcM8dmnG4kQ4y6kXlY5jUmo7fG3ck4+rErlB+RDvpiHNx2hpWQ2PUm3u0sU8C1N fHpCBeclixYVmz+zpMdtcW/bgiwxHH9bH1LKdzCpecIwrLyNhrDEJc19TjwoTjLEbDLG 4eipq5Hgy1Lz2ho6lGnUqDSuFgoM1Tx7b/prAFqul1aNNT36fvlJIe8IBdO3qpbZDSWW /UFA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id; bh=gY1+8Ba0IUhV47SSlluAbb3kKLO9jgkMvgMyme1VXC8=; fh=rNw8log5ZiLb61KwlkcVqZM0HQuVojQUzbzgFDCHjjY=; b=VUbtslkmI9nSPbZxLLPByaypcwSzKPzHUg6MJJreFXbaBPc+0p8/N9TBZIdL7P3Hzh OdKLXvqXCuOWguyXPLKvAf09ujXg4b+wjL7fkhFwGdZj47AyBvQbDDay1a6TKRUvAvhP fol76SZIZXOxvXMv6njNF3EVUKs7nx/6KfteS6Gy6kcqw5dPlQ69/p1VjBKw+9AGjUKi l+9Iy/ZiRsVohz5Oh7639ZCyDcCDn0tUg1IumOMcp6DftoYK6zELYHtFq+/4dCCqkVLO spCP5HGEU7k8T9tdj0y+tP1/BP7X7JN5XMSVYsPqlNSzoTD8kzXbSUzDMIcA+zeC0ruF hxpQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-131083-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131083-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9-20020a170902654900b001e0afd270d8si1618137pln.302.2024.04.04.01.11.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 01:11:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-131083-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-131083-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131083-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id A62AE2891C9 for ; Thu, 4 Apr 2024 08:11:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5E5B56773D; Thu, 4 Apr 2024 08:11:20 +0000 (UTC) Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.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 1E9A75CDE4 for ; Thu, 4 Apr 2024 08:11:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712218279; cv=none; b=K/C+wtd+48EZX1LZEb6q/pX8zj+1XLYKgBqt19mUKKA0XyregQDh4KipC8gc7JBZxNNVAnTYKgIVq1kSviWThbENVaAujB0/MVXz5cEU3PGgeVB5GXEcnPWOgOEHE/RLTZGmFCjdNvhPCHuCXB5F79pnkaq/kS3GD2XpOtKLvMY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712218279; c=relaxed/simple; bh=2zcR1ZLOP5P3n/jCwQlW8AS0/zhbXpQTbGoIC+wh9R0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=K9iUn5KzNgo0r+bTQCPu1CNT9OMNpdeoWw3aLic8xycf9z0VZvksscyoUjCdvV9yDBpDVinb0WAzXwpDeaSFoN8uxov9SOsTYilfoOSFKPMa4gOzrL8rHjS8M9SzHGxSxk8Xs50uC+DbYaZRKZqkyWUqW2MceUzhDsMR310xQ8g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.208.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lj1-f173.google.com with SMTP id 38308e7fff4ca-2d6fc3adaacso9091511fa.2 for ; Thu, 04 Apr 2024 01:11:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712218276; x=1712823076; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=gY1+8Ba0IUhV47SSlluAbb3kKLO9jgkMvgMyme1VXC8=; b=c+FmpLSs+DXCWb4cPS1OkTmcIfN/pVj20XMoaflCyU7Si1DxJEyfmpJzv12a2wCjGc WGVoAtSOJjb6kKnxJgi84CVS5nJrQ3uWXFg6DTU3QZMgFHIRRM9uWo5EbyGCWocBSVPv Rbh6prkxFJLQNjEr86Oy8EEMKSnoqmYjEj+JG+89MNoQteCbJzgstplSYMRv6L/d3R29 ytP7o/JFuH6zxjrJX1tE4V6Cy82ysKlC12CSLsCj91o9KRALBHPFaCf6dDm3JYsUCUYP AtO9nycBQGVFV9V6M8kCztwdfsqL/56UtkRIVzYbJYOIMDyTpTgqP/CaRdWEeIkh4tk9 297Q== X-Forwarded-Encrypted: i=1; AJvYcCWzbMpO9jh3pJVRBFqdnKLqO2TmcReqLX1gz4ez7FRefU02ap0XySNA3WEy37A8Y6HtGSMRFoMPyj4GdWqg7WEpuKV8SyGVPmCvq5NE X-Gm-Message-State: AOJu0YxO05MKWAY2nypS8mA112uB66LE/wTW2u2PKVhr8Whvql/Fqnwo uHkMI2fcX1b12d1JsdC1NzxxWrweAcVdNMLYRLEgnNumtl8PfD/OuQ5PJ5oO7Hs= X-Received: by 2002:ac2:48a7:0:b0:513:d3cb:249f with SMTP id u7-20020ac248a7000000b00513d3cb249fmr1244545lfg.52.1712218275986; Thu, 04 Apr 2024 01:11:15 -0700 (PDT) Received: from ?IPV6:2a0b:e7c0:0:107::aaaa:69? ([2a0b:e7c0:0:107::aaaa:69]) by smtp.gmail.com with ESMTPSA id e18-20020adfa452000000b00343c9ce4b50sm356307wra.53.2024.04.04.01.11.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 04 Apr 2024 01:11:15 -0700 (PDT) Message-ID: <593747f1-4256-4931-9d5c-50f1b68d3c2b@kernel.org> Date: Thu, 4 Apr 2024 10:11:14 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3] tty: xtensa/iss: Use min() to fix Coccinelle warning To: Thorsten Blum Cc: chris@zankel.net, gregkh@linuxfoundation.org, jcmvbkbc@gmail.com, linux-kernel@vger.kernel.org References: <528c6824-287e-4be2-82f3-7fcdd254eb15@kernel.org> <20240404075811.6936-3-thorsten.blum@toblux.com> Content-Language: en-US From: Jiri Slaby Autocrypt: addr=jirislaby@kernel.org; keydata= xsFNBE6S54YBEACzzjLwDUbU5elY4GTg/NdotjA0jyyJtYI86wdKraekbNE0bC4zV+ryvH4j rrcDwGs6tFVrAHvdHeIdI07s1iIx5R/ndcHwt4fvI8CL5PzPmn5J+h0WERR5rFprRh6axhOk rSD5CwQl19fm4AJCS6A9GJtOoiLpWn2/IbogPc71jQVrupZYYx51rAaHZ0D2KYK/uhfc6neJ i0WqPlbtIlIrpvWxckucNu6ZwXjFY0f3qIRg3Vqh5QxPkojGsq9tXVFVLEkSVz6FoqCHrUTx wr+aw6qqQVgvT/McQtsI0S66uIkQjzPUrgAEtWUv76rM4ekqL9stHyvTGw0Fjsualwb0Gwdx ReTZzMgheAyoy/umIOKrSEpWouVoBt5FFSZUyjuDdlPPYyPav+hpI6ggmCTld3u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VrrLDAJZ8Y5ioWcm99JtSIIxXxt9FJaGc1Bgsi5K/+dyTKL wLMJgiBzbVx8G+fCJJ9YtlNOPWhbKPlrQ8+AY52Aagi9WNhe6XfJdh5g6ptiOILm330mkR4g W6nEgZVyIyTq3ekOuruftWL99qpP5zi+eNrMmLRQx9iecDNgFr342R9bTDlb1TLuRb+/tJ98 f/bIWIr0cqQmqQ33FgRhrG1+Xml6UXyJ2jExmlO8JljuOGeXYh6ZkIEyzqzffzBLXZCujlYQ DFXpyMNVJ2ZwPmX2mWEoYuaBU0JN7wM+/zWgOf2zRwhEuD3A2cO2PxoiIfyUEfB9SSmffaK/ S4xXoB6wvGENZ85Hg37C7WDNdaAt6Xh2uQIly5grkgvWppkNy4ZHxE+jeNsU7tg= In-Reply-To: <20240404075811.6936-3-thorsten.blum@toblux.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 04. 04. 24, 9:58, Thorsten Blum wrote: > Inline strlen() and use min() to fix the following Coccinelle/coccicheck > warning reported by minmax.cocci: > > WARNING opportunity for min() > > Signed-off-by: Thorsten Blum Reviewed-by: Jiri Slaby Thanks. > --- > Changes in v2: > - Use min() instead of umin() as suggested by Jiri Slaby > > Changes in v3: > - Inline strlen() as suggested by Jiri Slaby > --- > arch/xtensa/platforms/iss/console.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/arch/xtensa/platforms/iss/console.c b/arch/xtensa/platforms/iss/console.c > index 8896e691c051..abec44b687df 100644 > --- a/arch/xtensa/platforms/iss/console.c > +++ b/arch/xtensa/platforms/iss/console.c > @@ -166,10 +166,8 @@ 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); > - } > + if (s && *s != 0) > + simc_write(1, s, min(count, strlen(s))); > } > > static struct tty_driver* iss_console_device(struct console *c, int *index) -- js suse labs