Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp2521359pxf; Sun, 14 Mar 2021 01:29:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJzUIR2nr1BTnpafOUcQ3eeNllnAWTLvX2wdKsR+/0Hr+P68OzS3VQnaUoiFwvkausK/929+ X-Received: by 2002:a05:6402:50ce:: with SMTP id h14mr23917034edb.279.1615714175685; Sun, 14 Mar 2021 01:29:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615714175; cv=none; d=google.com; s=arc-20160816; b=a2Fy+gk2wyzuJB/yXIwPOLsEzddr3ok4z+Ce0mIeIsAkxKKG70BrSfZMEYkfY90cuF /ABP0uh2v5FZ7OWUSI+TiFazAdtFxSu9UqERHXJXqiDf3RlIpC7ZQd6gHAZ1l+C/FG5u lwAnN+FBsnARpxwyZYv+98N2qOL9/dhk5TKpDMuz+sGqOkigoMqMd5skT1xTCXjNCZUD Wpb3kwszTnnnDZg3sy5M4sDioIomjG+p+23+r7UFhftRLV22Xbf+CAnh9JXaMkevBWgW /xRaAcGGoZFsx0v7uRbOIkLGk6xFc2AOjJq7uXO9gg9/jCWVWAj5xyybiEy5W2SZHZT8 ukVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=KTn27SWTTppffDOXdwFr8TEUED8mSEMXPQd5OiirCmA=; b=BTYCLXxegAWCbZe3i+uv9LYjKDG0rEqZ8EYm8x9VMKt8B4NC/sbhwc67dbUEV2b3ZZ jqojpmkK3KjtDfCwBKVtisgJMBviA+qF8eOoZPehwdTLHT/L9nlzTIzWs2u8KwIhp2d5 4G8IPlu9FB0BjSeEprPsLxfz3z2EI/+oOntNjHS6wLDwGm1PiNPm4qkL/sHPpmOz0J+Z 3wJpDwLR/0LQYZFHkFrjPZWRwWbxYNDF/NxLEqWxHqJ/BmE8GMySUZ2zGSUXtFxDGuCd QAT9Agg8SpEqpMCcTKw1KcwvkP5MUpMhCjcQQ+h3ZMoYG74M71MS2isz49dky+1bI/D4 DZSg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v5si8489666edx.253.2021.03.14.01.29.00; Sun, 14 Mar 2021 01:29:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230482AbhCNJ0R (ORCPT + 99 others); Sun, 14 Mar 2021 05:26:17 -0400 Received: from einhorn-mail-out.in-berlin.de ([217.197.80.21]:52823 "EHLO einhorn-mail-out.in-berlin.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229495AbhCNJ0N (ORCPT ); Sun, 14 Mar 2021 05:26:13 -0400 X-Envelope-From: stefanr@s5r6.in-berlin.de Received: from authenticated.user (localhost [127.0.0.1]) by einhorn.in-berlin.de with ESMTPSA id 12E9KeEg004322 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Sun, 14 Mar 2021 10:20:41 +0100 Date: Sun, 14 Mar 2021 10:20:39 +0100 From: Stefan Richter To: Jiapeng Chong Cc: linux1394-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH] firewire: Use bitwise instead of arithmetic operator for flags Message-ID: <20210314102039.21bbb75d@kant> In-Reply-To: <1615273899-88446-1-git-send-email-jiapeng.chong@linux.alibaba.com> References: <1615273899-88446-1-git-send-email-jiapeng.chong@linux.alibaba.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mar 09 Jiapeng Chong wrote: > Fix the following coccicheck warnings: > > ./drivers/firewire/core-device.c:973:22-23: WARNING: sum of probable > bitmasks, consider |. > > ./drivers/firewire/core-device.c:954:22-23: WARNING: sum of probable > bitmasks, consider |. > > Reported-by: Abaci Robot > Signed-off-by: Jiapeng Chong > --- > drivers/firewire/core-device.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/firewire/core-device.c b/drivers/firewire/core-device.c > index 6821698..e04832d 100644 > --- a/drivers/firewire/core-device.c > +++ b/drivers/firewire/core-device.c > @@ -951,7 +951,7 @@ static void set_broadcast_channel(struct fw_device *device, int generation) > if (device->bc_implemented == BC_UNKNOWN) { > rcode = fw_run_transaction(card, TCODE_READ_QUADLET_REQUEST, > device->node_id, generation, device->max_speed, > - CSR_REGISTER_BASE + CSR_BROADCAST_CHANNEL, > + CSR_REGISTER_BASE | CSR_BROADCAST_CHANNEL, > &data, 4); > switch (rcode) { > case RCODE_COMPLETE: > @@ -970,7 +970,7 @@ static void set_broadcast_channel(struct fw_device *device, int generation) > BROADCAST_CHANNEL_VALID); > fw_run_transaction(card, TCODE_WRITE_QUADLET_REQUEST, > device->node_id, generation, device->max_speed, > - CSR_REGISTER_BASE + CSR_BROADCAST_CHANNEL, > + CSR_REGISTER_BASE | CSR_BROADCAST_CHANNEL, > &data, 4); > } > } It's "base address + address offset". The arithmetic operator is correct. -- Stefan Richter -======--=-= --== -===- http://arcgraph.de/sr/