Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp588192rbb; Sat, 24 Feb 2024 14:28:52 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXImkK/CWkL3XpLrRUohvnyu1Bk/DmMGUsiaGqoUfkuRJLZ0oSOJNfX8dV/ZPLLHWIskmLwQzcsNLcCJ/ZoGP3hQEE3Vu7WDWHvzXyMJA== X-Google-Smtp-Source: AGHT+IH9LciUkFMgfgseeO487VDsby2lLVAncGk968HuXDrxO0unI1L/2o0ApERIdXWitSXazMPY X-Received: by 2002:a05:6358:7e55:b0:17b:78f1:b4fa with SMTP id p21-20020a0563587e5500b0017b78f1b4famr4377710rwm.19.1708813732292; Sat, 24 Feb 2024 14:28:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708813732; cv=pass; d=google.com; s=arc-20160816; b=CX5SipsCkwW0I2Bk2dUNd8BVNmV5rU/hv0F5wbOAHq+CnOitGOl/tN/mtg5q9LSC+Q su05pLT25lL7H1Z6Tmj7nu/u91ifQnAZkDGknpQ6EhE2NT9XMasUqDgXHSNYa5p3CvRd j0dxcHGQsCrDycEC/qdVayrGc+OIj6QqGswSM/HlH6khRonmJtBp4uJbPfpvhP6jGycn Js2M/LoxPAVrwEFJJId2sVz8AKybmyejsfM00tWVTytKymwEV3omVzPp4v7+AZKXhiOg EPONu6XaLLN0OLzLPqFhk/8HaDtNCnklFIFMvGzg6s+PU05gb8UISJudwG6VCq/l1Qps PKaA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:date:cc:to:from:subject :message-id; bh=MULlS3M5DL3da9KRtHEXTdoyTQUjInFUyW8UT3IJkDY=; fh=YRHNhMezCWZgf3Hp4DYnyN755Q1W02zr+khUR6sSvIc=; b=Xxi0zP/05RWXWsoA07Ywof/3+EKzZv8ud+NMoJ7O6thHNbAbqIvsZxgCcSdag7TAWz W6YYqrP2kF2djjL6GclM7OuyHFSVK02I+jXZ00OEVrV726Q4wCrYqAl71phX3Lq3EYeX rUYH6DDV7FtI56z61vdjv1Z/+T/wHpQxdjAyjGzYDiBwlk3lpYUvAEBrsTXzg3B9otVt LRD6wopSsihYs1jForD4fIIw4kFS81Rzn8Rq/7+XoGVTg430b1v5doQYYMTj60vwqNVh 3NrUC+YMw5PybCqqHIr3BRce4TU2Wqb9Bpz8e89ifDkcK/wy4xzJ/PoW52nB+tO2Dq2U GXig==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=perches.com); spf=pass (google.com: domain of linux-kernel+bounces-79889-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79889-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id ay20-20020a05620a179400b00787cbfa7c90si281377qkb.179.2024.02.24.14.28.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 14:28:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79889-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=perches.com); spf=pass (google.com: domain of linux-kernel+bounces-79889-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79889-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 EA2671C20B3A for ; Sat, 24 Feb 2024 22:28:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 028B64D9E1; Sat, 24 Feb 2024 22:28:46 +0000 (UTC) Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) (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 0A540481C6; Sat, 24 Feb 2024 22:28:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.40.44.14 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708813725; cv=none; b=ngfYuXklIrMds4GbQq/aU2cu+slPSiLfS3ywh/Sx+t4e5sDdhKJy7AIhECukUKZaWMQeIYk4Ck89naJZFOPgjNFVqs4Rh2zN98ORMDQ6RIeSfqYNRHEKaZiyjOMMk/d3jho2kYXNqSYlH8gykhmswC5gHvBPij/XXvsY2qWDA2w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708813725; c=relaxed/simple; bh=XFvUuIiArPZtcIaAv5GeV7fVRjc1Q38QRdmJEDP+YqI=; h=Message-ID:Subject:From:To:Cc:Date:Content-Type:MIME-Version; b=j27zvObdMaK9yPEibBE5keEkEkfHYxHf26cATsX9GbUkjkBlVSfcLeP2xLjO5ydyd/vJ1MNswSY4NfalJtrw6AyZmRgi8DYdjSWrJtMkS+EF4ki3mY79dgnlPHp/i9s7RvgF0d9Ew0jFS0DnDwpr514oulCXXHx/K3eL2Zp1/5A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=perches.com; spf=pass smtp.mailfrom=perches.com; arc=none smtp.client-ip=216.40.44.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=perches.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=perches.com Received: from omf17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id DF5C780453; Sat, 24 Feb 2024 22:28:35 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf17.hostedemail.com (Postfix) with ESMTPA id DAB2317; Sat, 24 Feb 2024 22:28:33 +0000 (UTC) Message-ID: <2cf0b77f51b907969ae83993854773961b4e159c.camel@perches.com> Subject: sibyte: pointless if tests From: Joe Perches To: Thomas Bogendoerfer Cc: linux-mips@vger.kernel.org, LKML Date: Sat, 24 Feb 2024 14:28:32 -0800 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Rspamd-Queue-Id: DAB2317 X-Rspamd-Server: rspamout02 X-Stat-Signature: rbkbkkufbwqdzrt4f99nfrgmpaseaoh4 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX1+8vWvWo4t1B6xMC3gg99zgB4EFce9pg9I= X-HE-Tag: 1708813713-824061 X-HE-Meta: U2FsdGVkX1+Uaj7nWPg01jMtq1aN1QyBgqKd4hIUp8kgnnMMpD8AQgkQ59G1gLz5gLxSsCdBlwN/sAaz/Lwq8H7tNI/yngwf54hagJEGeHuKHIgN+g7yHdDMLGgwKOD4bovS0jUzMoVAcGMPRmn0o/oASUxLXmy1UzRtbuXh+DV16aIRowGpzBL7xtyo56qsOyC1koZ6uBGROzytO87qxOCse/lvk3pO7j6D4vN7RyepyXOUWJaM8Jjp1KOdxhLgnLNMH5jrMNtn3OPb3Sxfm54iOnRiG1P/JUejNr6wc3JbqenSKq6P01tF5xuDH/Uc A checkpatch modification was suggested privately about braces around an if test like if (foo) ; so I thought I'd see how many of these possibly pointless if tests exist. There aren't many. Here are a couple in sibyte: Maybe this should be documented as: "well, don't know what to do here" $ cat if_semi.cocci @@ expression e; @@ * if (e) ; $ spatch --very-quiet -sp-file if_semi.cocci . diff -u -p ./arch/mips/sibyte/common/cfe_console.c /tmp/nothing/arch/mips/s= ibyte/common/cfe_console.c --- ./arch/mips/sibyte/common/cfe_console.c +++ /tmp/nothing/arch/mips/sibyte/common/cfe_console.c @@ -22,8 +22,6 @@ static void cfe_console_write(struct con if (str[i] =3D=3D '\n') { do { written =3D cfe_write(cfe_cons_handle, &str[last], i-last); - if (written < 0) - ; last +=3D written; } while (last < i); while (cfe_write(cfe_cons_handle, "\r", 1) <=3D 0) @@ -33,8 +31,6 @@ static void cfe_console_write(struct con if (last !=3D count) { do { written =3D cfe_write(cfe_cons_handle, &str[last], count-last); - if (written < 0) - ; last +=3D written; } while (last < count); }