From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753585AbcHUVSy (ORCPT ); Sun, 21 Aug 2016 17:18:54 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:34123 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752602AbcHUVSw (ORCPT ); Sun, 21 Aug 2016 17:18:52 -0400 Date: Sun, 21 Aug 2016 17:07:10 +0200 From: Greg Kroah-Hartman To: Colin King Cc: Ian Abbott , H Hartley Sweeten , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: comedi: dt2811: add parentheses to fix logic on s->subdev_flags Message-ID: <20160821150710.GA16155@kroah.com> References: <1469485525-17632-1-git-send-email-colin.king@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1469485525-17632-1-git-send-email-colin.king@canonical.com> User-Agent: Mutt/1.7.0 (2016-08-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 25, 2016 at 11:25:25PM +0100, Colin King wrote: > From: Colin Ian King > > We need to add parentheses around ternary operations because currently > the expression SDF_READABLE | (it->options[2] == 1) always evaluates to > true, meaning s->subdev_flags is always assigned SDF_DIFF. Putting the > parentheses around the ternarary operations results in the intended > expression of SDF_REABLE logically or'd with one of SDF_DIFF, > SDF_COMMON or SDF_GROUND. > > Signed-off-by: Colin Ian King > Fixes: 7c9574090d30 ("staging: comedi: dt2811: simplify A/D reference configuration") > Cc: # 4.7+ > Reviewed-by: Ian Abbott Dan sent a patch for this before you did :( And this went into 4.8-rc1, not 4.7. thanks, greg k-h