From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63422C4363D for ; Fri, 2 Oct 2020 20:02:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1E9EA2072E for ; Fri, 2 Oct 2020 20:02:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725775AbgJBUCG (ORCPT ); Fri, 2 Oct 2020 16:02:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725300AbgJBUCF (ORCPT ); Fri, 2 Oct 2020 16:02:05 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 925FAC0613D0 for ; Fri, 2 Oct 2020 13:02:05 -0700 (PDT) Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.94) (envelope-from ) id 1kORFj-00FR9L-TE; Fri, 02 Oct 2020 22:02:04 +0200 Message-ID: <1b1089b3ff392b46bc3d4b975b07cd4e34081719.camel@sipsolutions.net> Subject: Re: [PATCH 1/5] netlink: simplify netlink_policy_dump_start() prototype From: Johannes Berg To: Jakub Kicinski Cc: netdev@vger.kernel.org Date: Fri, 02 Oct 2020 22:02:03 +0200 In-Reply-To: <20201002083144.39af89e8@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> References: <20201002090944.195891-1-johannes@sipsolutions.net> <20201002110205.35dfe0fb3299.If2afc69c480c29c3dfc7c373c9a8b45678939746@changeid> <20201002083144.39af89e8@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-1.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Fri, 2020-10-02 at 08:31 -0700, Jakub Kicinski wrote: > On Fri, 2 Oct 2020 11:09:40 +0200 Johannes Berg wrote: > > From: Johannes Berg > > > > Since moving the call to this to a dump start() handler we no > > longer need this to deal with being called after having been > > called already. Since that is the preferred way of doing things > > anyway, remove the code necessary for that and simply return > > the pointer (or an ERR_PTR()). > > > > Signed-off-by: Johannes Berg > > Reviewed-by: Jakub Kicinski > > > - return netlink_policy_dump_start(op.policy, op.maxattr, &ctx->state); > > + ctx->state = netlink_policy_dump_start(op.policy, op.maxattr); > > + if (IS_ERR(ctx->state)) > > + return PTR_ERR(ctx->state); > > + return 0; > > PTR_ERR_OR_ZERO()? Hah! I didn't even know about that, thanks. johannes