From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759321AbdAKW6k (ORCPT ); Wed, 11 Jan 2017 17:58:40 -0500 Received: from mail.skyhub.de ([78.46.96.112]:53873 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753932AbdAKW6h (ORCPT ); Wed, 11 Jan 2017 17:58:37 -0500 Date: Wed, 11 Jan 2017 23:58:30 +0100 From: Borislav Petkov To: David Binderman , Mauro Carvalho Chehab Cc: "mchehab@kernel.org" , "linux-edac@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: edac/i7300_edac.c:307: strange macro ? Message-ID: <20170111225830.xkqrvrfzv4swcrik@pd.tnic> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20161014 (1.7.1) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 11, 2017 at 04:48:51PM +0000, David Binderman wrote: > Hello there, > > drivers/edac/i7300_edac.c:307:32: warning: ‘*’ in boolean context, suggest ‘&&’ instead [-Wint-in-bool-context] Are you adding some other -W-switches to the kernel Makefile? :-) > Source code is > > #define IS_SECOND_CH(v) ((v) * (1 << 17)) Looks like a bug to me. According to the chipset doc, bit 17 in REDMEMB is the locator bit for CS[3:2] which probably means the second channel but multiplying the full register value with 131072 looks wrong. > Maybe better code > > #define IS_SECOND_CH(v) ((v) & (1 << 17)) Yap. Mauro, what's up? -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.