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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0060EC433FE for ; Fri, 14 Oct 2022 11:08:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229586AbiJNLIw (ORCPT ); Fri, 14 Oct 2022 07:08:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229541AbiJNLIv (ORCPT ); Fri, 14 Oct 2022 07:08:51 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D5E910B43 for ; Fri, 14 Oct 2022 04:08:51 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id AE14861AB9 for ; Fri, 14 Oct 2022 11:08:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 51B09C433D6; Fri, 14 Oct 2022 11:08:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665745730; bh=Wa+XSvXMIQxJXBB9eF2WbJqdeXzxcRo7e2fz7ZaZvRg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gW8UsOshEwAxjfOIBIzXdgnp9U+2HrhO6lbkxLSoEjL4v3PnHd3gfNVrD4lZKqT9j Spb1mVKVsYiSDjwu7HTQ3AxrgcTSO8t8mGdrS8aDP/c7RIBSZvk+sCsqqBVRvpVQNA z9xyJgVGBSIH0w8hJiYcmBw/KyNmK9JeAvc+oWlwIMdZPASI+nTmzgweO6cs1EGGsP I7yFPqJaSXop4kVga9TS2CtjCxljwovrTlOBDCrDkQscsPNBKcPcdqxDdu57HVR3aJ O0aZR4ClmyQTxO5BX7nzX/NxRrJpCYxOnf+3u0QHKfhrBY6I3PRXFPRDtcvxQb3rO2 8UE3qfjhV2PLQ== Date: Fri, 14 Oct 2022 14:08:45 +0300 From: Leon Romanovsky To: Sabrina Dubroca Cc: netdev@vger.kernel.org, Antoine Tenart Subject: Re: [PATCH net 3/5] macsec: fix secy->n_rx_sc accounting Message-ID: References: <1879f6c8a7fcb5d7bb58ffb3d9fed26c8d7ec5cb.1665416630.git.sd@queasysnail.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Fri, Oct 14, 2022 at 09:43:41AM +0200, Sabrina Dubroca wrote: > 2022-10-14, 09:16:56 +0300, Leon Romanovsky wrote: > [...] > > > @@ -1897,15 +1899,16 @@ static int macsec_add_rxsc(struct sk_buff *skb, struct genl_info *info) > > > secy = &macsec_priv(dev)->secy; > > > sci = nla_get_sci(tb_rxsc[MACSEC_RXSC_ATTR_SCI]); > > > > > > - rx_sc = create_rx_sc(dev, sci); > > > + > > > + if (tb_rxsc[MACSEC_RXSC_ATTR_ACTIVE]) > > > + active = !!nla_get_u8(tb_rxsc[MACSEC_RXSC_ATTR_ACTIVE]); > > > > You don't need !! to assign to bool variables and can safely omit them. > > Yeah, but I'm just moving existing code, see below. Not really, original code was "rx_sc->active = ...", but you changed to use local value. So it is perfectly fine to fix the !! too. Thanks