From nobody Sun Feb 8 05:41:54 2026 Received: from out-179.mta1.migadu.com (out-179.mta1.migadu.com [95.215.58.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A9A5332861C for ; Thu, 16 Oct 2025 11:42:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760614978; cv=none; b=H0DMCp4zuUzKCiUBoMu9FHSTNFodgCmAUnP1PYK7YxoqnTnIRZHdYTEbe42nNeDxETVyiVTPa9EvaZiw3A2IzSzD/pyjEu/xNKn2v4We7W+uddoNZJaLz7Gc4wptsqhJSrIYQFpvgF1M12JL+J1RHRbouRZHfTbwBJdbxv9gajI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760614978; c=relaxed/simple; bh=TNbOWPpjZ96fYdOUei5Za2Ozo+sBYls3OZ4aBgEbuxg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Mo1vIdGXBe17FCf4sqKJOXfFz5B/eEo1jgyrQJ4nT2WDgSLOrzprgGEUWMVIFLjkb6+/pa96jTzQTH3pYoBTD90u5BOr3xPofpESYwN/TLEPiBdvPvxC9HbYhhBW4LwEXut9iaRrq5HnjkI+MOSOuamB9iygBbZH7bCKtY+kqDU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=sr+tvkMG; arc=none smtp.client-ip=95.215.58.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="sr+tvkMG" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1760614973; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=S+Rgc8T+WgHelpY6T/bd66cmIHUndzFo81Kh2h13IJI=; b=sr+tvkMGIjU2DKovstkr43vtcY4GIRTgsUqbvQgypTZNZnY7SX0LdmMN/zyE3YjiontU8l 1UHtzFNKxaGSdMmGLr83zUGAC4QAx1hfh+exKR0GFXzx3EF1GEV9JgE66r8bby1Av++xFn L1J217YzsStJhrYqCpfDPc1JZQJvL1c= From: Thorsten Blum To: Eric Piel , Arnd Bergmann , Greg Kroah-Hartman Cc: Thorsten Blum , linux-kernel@vger.kernel.org Subject: [PATCH] misc: lis3lv02d: Use min to simplify lis3lv02d_misc_read Date: Thu, 16 Oct 2025 13:42:33 +0200 Message-ID: <20251016114234.72221-1-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" Use min() to simplify lis3lv02d_misc_read(). Signed-off-by: Thorsten Blum --- drivers/misc/lis3lv02d/lis3lv02d.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/misc/lis3lv02d/lis3lv02d.c b/drivers/misc/lis3lv02d/li= s3lv02d.c index 6957091ab6de..1a634ac1a241 100644 --- a/drivers/misc/lis3lv02d/lis3lv02d.c +++ b/drivers/misc/lis3lv02d/lis3lv02d.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -629,10 +630,7 @@ static ssize_t lis3lv02d_misc_read(struct file *file, = char __user *buf, schedule(); } =20 - if (data < 255) - byte_data =3D data; - else - byte_data =3D 255; + byte_data =3D min(data, 255); =20 /* make sure we are not going into copy_to_user() with * TASK_INTERRUPTIBLE state */ --=20 2.50.1