From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753528AbbBRAz0 (ORCPT ); Tue, 17 Feb 2015 19:55:26 -0500 Received: from smtprelay0009.hostedemail.com ([216.40.44.9]:42113 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752040AbbBRAzO (ORCPT ); Tue, 17 Feb 2015 19:55:14 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::,RULES_HIT:41:355:379:541:599:960:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:1801:2393:2553:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3865:3866:3867:3868:3871:3872:3874:4321:4398:4605:5007:6261:6691:10004:10400:10848:11026:11232:11658:11914:12043:12296:12517:12519:12740:13069:13161:13229:13311:13357:14096:14097:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: wind46_84cf7674de121 X-Filterd-Recvd-Size: 2475 Message-ID: <1424220910.25416.13.camel@perches.com> Subject: Re: [PATCH] ipc: Remove uses of return value of seq_printf/seq_puts From: Joe Perches To: Al Viro Cc: Andrew Morton , LKML Date: Tue, 17 Feb 2015 16:55:10 -0800 In-Reply-To: <20150218002751.GP29656@ZenIV.linux.org.uk> References: <1424202288.25416.5.camel@perches.com> <20150217145246.e0821f61bcebe2e50b057ef9@linux-foundation.org> <20150217231634.GO29656@ZenIV.linux.org.uk> <1424218184.25416.11.camel@perches.com> <20150218002751.GP29656@ZenIV.linux.org.uk> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.12.7-0ubuntu1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2015-02-18 at 00:27 +0000, Al Viro wrote: > On Tue, Feb 17, 2015 at 04:09:44PM -0800, Joe Perches wrote: > > On Tue, 2015-02-17 at 23:16 +0000, Al Viro wrote: > > > Most of the time checking return value of seq_...() is better replaced with > > > not doing that. And "must check return value and Do Something(tm)" is too > > > strong habit for enough people to cause recurring trouble. > > > > Does SEQ_SKIP still have value? > > Yes, it does, but it's not an error - it's an equivalent of "empty the buffer > before returning". Basically, it's "I've decided that this entry shouldn't > produce anything". Look at the caller: Yeah. I should have looked at the traverse function first. > error = m->op->show(m, p); > if (error < 0) > break; > if (unlikely(error)) { > error = 0; > m->count = 0; > } Basically all the show functions that I converted to use seq_has_overflowed() should just return 0. There are only 3 current uses of SEQ_SKIP drivers/infiniband/hw/qib/qib_debugfs.c:119: return SEQ_SKIP; drivers/infiniband/hw/qib/qib_debugfs.c:177: return SEQ_SKIP; drivers/infiniband/hw/qib/qib_debugfs.c:183: return SEQ_SKIP; As far as I can tell, these uses would be fine not using SEQ_SKIP and just emitting 0 instead of nothing.