From patchwork Thu Aug 22 13:39:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Zetao X-Patchwork-Id: 13773402 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) (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 F00431C9440; Thu, 22 Aug 2024 13:31:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.187 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724333497; cv=none; b=hFj3TM0s47roe8TGeo8rIInYoddkXVbCt3nAl9sxaE2Tz6uR5g4BAFqH+WgB96dUVPoUABsHcTFltVoZbFzOnNW3X8dR++d35Z0sXIqbAeQv5206PiFA6yLth7v0XkMDjehbqNIrHY/v6BPw1S9KQ+ojBiYxyLAxNvAerNZmkz4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724333497; c=relaxed/simple; bh=M1n2Xn+9A7edIt9B6vqrsNV3A2y+DbZtbQEJYxLKkro=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=b8T2W+DW1udBbTrzFPwPSpejX4X8Ea0J4ClCY50Msdah95Zj+71VI6EZPNXEt3javgZwnFR0t+LXZdyYnKqH/J/XIv340GkgITr3EUR32LZmLSzMHBKdYoaS+yE5hgC//EVo5qQTVkOHYruK1PhC43tc+UVLmJAFvh5IBp3xdTE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.187 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.252]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4WqPGz2WrxzyRDT; Thu, 22 Aug 2024 21:31:07 +0800 (CST) Received: from kwepemd500012.china.huawei.com (unknown [7.221.188.25]) by mail.maildlp.com (Postfix) with ESMTPS id 31AA91800A4; Thu, 22 Aug 2024 21:31:31 +0800 (CST) Received: from huawei.com (10.90.53.73) by kwepemd500012.china.huawei.com (7.221.188.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.34; Thu, 22 Aug 2024 21:31:29 +0800 From: Li Zetao To: , , , , , , , , , , , , , , , , , , , , , , , , , , , CC: , , , , Subject: [PATCH net-next 0/8] Some modifications to optimize code readability Date: Thu, 22 Aug 2024 21:39:00 +0800 Message-ID: <20240822133908.1042240-1-lizetao1@huawei.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: ceph-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemd500012.china.huawei.com (7.221.188.25) This patchset is mainly optimized for readability in contexts where size needs to be determined. By using min() or max(), or even directly removing redundant judgments (such as the 5th patch), the code is more consistent with the context. Li Zetao (8): atm: use min() to simplify the code Bluetooth: use min() to simplify the code net: caif: use max() to simplify the code libceph: use min() to simplify the code net: remove redundant judgments to simplify the code ipv6: mcast: use min() to simplify the code tipc: use min() to simplify the code SUNRPC: use min() to simplify the code net/atm/addr.c | 4 ++-- net/bluetooth/hidp/core.c | 2 +- net/caif/cfpkt_skbuff.c | 6 ++---- net/ceph/messenger.c | 2 +- net/core/sock.c | 2 +- net/ipv6/mcast.c | 5 +++-- net/sunrpc/xdr.c | 2 +- net/tipc/monitor.c | 2 +- 8 files changed, 12 insertions(+), 13 deletions(-)