Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp144830ybh; Wed, 11 Mar 2020 22:49:03 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsSZkauDY9rUzGCDlwsWkpSQczR+exkhIijIyjTEX4MLkai8hiTNMOjjD/ga4wJZZP1VzuJ X-Received: by 2002:a9d:1a4:: with SMTP id e33mr4950479ote.343.1583992142935; Wed, 11 Mar 2020 22:49:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583992142; cv=none; d=google.com; s=arc-20160816; b=g1JR09EbOwauv87xW5tCI2IdNqXAt4Va5Ko05GJQPAookOnkzRm3w/tDFgdc41O6Kv LQjzEmR3XZ/KYieZi49Zqds1+GFpGKTF5dwOyK0itFks56v4GL5TxOe4jO8Ig2eFgtPe ozzfk/FaQsRRsne8ihjhiBF/y7YKJTnf+sbXpZ9g3Po41+utyqIxtmPrlXv66H8nMCDF qIhZ1h3gXW8n2gxfYehAcywqULfyycRhDUVuSU2BdH7kBzCPFrfZXlJYcmcYR7/mOPST +bpzGXf4sssWn7CVkWcM1HEYsxWYjQ6xQTjJg4dHiyLaDeOhHwrqWbF+6cwYY3Wh8FTa pA9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date; bh=O08vLBhrnmgibIpnfIn866twkgNeQi6VNT7Vo/xzdB4=; b=QqHM2wHeTg9QKGM+FlpDXK2f2IvggjSwaDnNoYu93rU52E1VlrcCFSiQ490QGAuQHC 4Hd3DH18YysAGr/uUBxyKTg5s/N5hRKMJ09zwJMlfQbR6rhigczHgNt8Dnr/NXJwyMut /OZfXSjj9rQXnuDdS/e02Y12e+UGz0utOcUQVw87TaLIJ58PlM2HP8CPpBrPQJG6a1Za DvPDS9jZ7CEyY/0B5BKx+aNWmJm/+a6fOiCdPz5b4kdI/1npkRG7cwAtzros/HlQ887w NzHHnbtX65AfdFjV1n8gBL0y6uTFnyfK4GHeavVp52JtiO9+E09XaI2Q6Ux9zGmpSgBP RcHQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p19si2325912oic.39.2020.03.11.22.48.50; Wed, 11 Mar 2020 22:49:02 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387874AbgCLFsX (ORCPT + 99 others); Thu, 12 Mar 2020 01:48:23 -0400 Received: from shards.monkeyblade.net ([23.128.96.9]:55896 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387677AbgCLFsX (ORCPT ); Thu, 12 Mar 2020 01:48:23 -0400 Received: from localhost (unknown [IPv6:2601:601:9f00:477::3d5]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 3AE4D14BA6B87; Wed, 11 Mar 2020 22:48:22 -0700 (PDT) Date: Wed, 11 Mar 2020 22:48:21 -0700 (PDT) Message-Id: <20200311.224821.1526910923298377538.davem@davemloft.net> To: mkubecek@suse.cz Cc: netdev@vger.kernel.org, kuba@kernel.org, jiri@resnulli.us, andrew@lunn.ch, f.fainelli@gmail.com, linville@tuxdriver.com, johannes@sipsolutions.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next 04/15] ethtool: add ethnl_parse_bitset() helper From: David Miller In-Reply-To: <70fe704ddd961de7250e2cb7800369509ed6e1d8.1583962006.git.mkubecek@suse.cz> References: <70fe704ddd961de7250e2cb7800369509ed6e1d8.1583962006.git.mkubecek@suse.cz> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Wed, 11 Mar 2020 22:48:22 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Michal Kubecek Date: Wed, 11 Mar 2020 22:40:23 +0100 (CET) > +int ethnl_parse_bitset(unsigned long *val, unsigned long *mask, > + unsigned int nbits, const struct nlattr *attr, > + ethnl_string_array_t names, > + struct netlink_ext_ack *extack) > +{ ... > + if (bit_val) > + set_bit(idx, val); > + if (!no_mask) > + set_bit(idx, mask); You can certainly use non-atomic __set_bit() in this context.