Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp6441707imm; Mon, 27 Aug 2018 16:17:00 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZflKn2tWEC5y3RfsleHZMOpWNBissex7Xla5k1gASJK5IACpCa5RV+ULwND113A3k5qSuS X-Received: by 2002:a63:4702:: with SMTP id u2-v6mr2997815pga.95.1535411820158; Mon, 27 Aug 2018 16:17:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535411820; cv=none; d=google.com; s=arc-20160816; b=khyhdUJfXt0qpUOcN28guLxhqTpFOxWe79MWPswLcOlaWXqH7c11BcQG8RRlzCCi2G lqkkagu6OLJPnxyxoc4VPwl/uxnto/qAdwUMoO0TsYzrkEkRoRrRwqKsGcHdhGoBto9y MFLaxh5AkQkxaoCzgNxa70Klyl3+8lfgk33jjpFnl1PKzHyNyraguOuW0i4jJCP71EBU quYDxqNiSrRCsZfEMp0ZS4AJ/bMU0BW6A4WHpwk2DFKoKAmW4PklsCe3vPmMRA6Tjwrz cOWmJEFSJBs2NtCGJsgfrUFvGQ8ACtjEhVc+/TyXIfRvQC/9mZYo+nGXF6qXcpPtBZ0Y oQHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=yj4y8eTpQ0R3ShrvEALICNFx33TktyV8V3ebc5F433s=; b=nKjKuu24oNt8JgcTGeHJtxwwAQBoWj+MwwLdR0Do7VBeYGSuMj72vrkLAxsAbwoyqx 8uTSbKAmSslVXVqx0SZJLAqj5dH2eH2nvdnCfBAO9ACYXOrZNYOf+vC3ed34tLdTKQpH ni/DpSq0oxPyIlbGbnTcQqwvisCpJppD9QWSsxF1Qf5gC/0N6AXo8eWaQ7ctaWbgckDt 76yTFcV9BaY7K1oNzg9EHmtISzt9cuHxnQK/B26vn9cKMcggad8OjtAeNpaP8u0SoiXz VUaR4DvKEt4qIkKhneb68kqdcV/F5LwuCoRN/9iPOXNfgTtztRvMJq5yJrbPBG/3L61A V4mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Gl1wcZmf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g16-v6si367739pgi.373.2018.08.27.16.16.43; Mon, 27 Aug 2018 16:17:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Gl1wcZmf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727434AbeH1DEU (ORCPT + 99 others); Mon, 27 Aug 2018 23:04:20 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:36012 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726994AbeH1DET (ORCPT ); Mon, 27 Aug 2018 23:04:19 -0400 Received: by mail-ed1-f68.google.com with SMTP id f4-v6so7268edq.3 for ; Mon, 27 Aug 2018 16:15:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=yj4y8eTpQ0R3ShrvEALICNFx33TktyV8V3ebc5F433s=; b=Gl1wcZmfKP+S482JvnZ52hnU8qUqTnkZPYsq/x2eXDxx7exHfgHVR+1YJXSli6eDlw uYnf7HXi5JoJ8WDXWayIhZkb/XKANByru6I6Cn0k2ONTuhS0+0cHm5Wk4+oW3U8ZVpHR 7lgcqjTV+Svc23iy8kVCfVZbIDbaxE3ygsKq/qsnqqDUsgt9gyg6irn622YXCDbrM08X u/I0bb9Mg/mFv5K2tL9jfe0Is2jsrxKOgm12e2UiUrTNNUvne8xPGXb8xGwMFiX2wGzW C1kC75zMJICJGgh6JumXhfVTcFC4KOQaf+TBN5UOLKJdZUR0vFMiOunS5P+6iu0UtKVN L9rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=yj4y8eTpQ0R3ShrvEALICNFx33TktyV8V3ebc5F433s=; b=VyVH4h2pJPr5kBMo3UgDp/6ZIyBta9AzJWZ9ssynWZpQglORNg4S753Qj65kMA0kWJ a1yq+Nt+UTGoYNj0AXJDn+9ThvwcDExOGnFs95C57Z/bYzRgmEdOTMue14aRMrugFJS+ JE82nTXMpyQXEm7CTG/LWZ8sg/IbVyYGa5ukRcV/Ei8Gwbca7zRhujiyVXKRLFKh6i5V vbP8sBPLBTbidRGsqf3vx8/Kez+PRKM3joD+1zF8h7jCEUYnklK30BYsXDUCvK0HOX2W q6o2IvnBLhvqsRXRBt65rBYSQp3xkIqqpquHvR2BB09WQgEX2rUnJpdqBS5pkakgfXuJ Dw8g== X-Gm-Message-State: APzg51DhNCT4a1WqBP4ok7XlpeirBsvonQAwexhffKskkwT/butNLHk4 FRglpk/LHrKHXB+3aZZZpQ== X-Received: by 2002:a50:90c5:: with SMTP id d5-v6mr18806881eda.76.1535411732791; Mon, 27 Aug 2018 16:15:32 -0700 (PDT) Received: from localhost.localdomain (nat4-minsk-pool-46-53-177-92.telecom.by. [46.53.177.92]) by smtp.gmail.com with ESMTPSA id u3-v6sm173918edo.44.2018.08.27.16.15.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Aug 2018 16:15:32 -0700 (PDT) From: Alexey Dobriyan To: akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org, Alexey Dobriyan Subject: [PATCH 01/13] seq_file: rewrite seq_puts() in terms of seq_write() Date: Tue, 28 Aug 2018 02:14:51 +0300 Message-Id: <20180827231503.26899-1-adobriyan@gmail.com> X-Mailer: git-send-email 2.16.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Space savings -- 42 bytes! seq_puts 71 29 [-42] Signed-off-by: Alexey Dobriyan --- fs/seq_file.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/fs/seq_file.c b/fs/seq_file.c index 1dea7a8a5255..0c282a88a896 100644 --- a/fs/seq_file.c +++ b/fs/seq_file.c @@ -653,14 +653,7 @@ EXPORT_SYMBOL(seq_putc); void seq_puts(struct seq_file *m, const char *s) { - int len = strlen(s); - - if (m->count + len >= m->size) { - seq_set_overflow(m); - return; - } - memcpy(m->buf + m->count, s, len); - m->count += len; + seq_write(m, s, strlen(s)); } EXPORT_SYMBOL(seq_puts); -- 2.16.4