Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754803AbdLFKCZ (ORCPT ); Wed, 6 Dec 2017 05:02:25 -0500 Received: from dd39320.kasserver.com ([85.13.155.146]:46772 "EHLO dd39320.kasserver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754301AbdLFKCV (ORCPT ); Wed, 6 Dec 2017 05:02:21 -0500 Subject: Re: [PATCH] staging: pi433: Fixes issue with bit shift in rf69_get_modulation To: Greg KH , Marcus Wolf Cc: dan.carpenter@oracle.com, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org References: <1510161236-30840-1-git-send-email-linux@wolf-entwicklungen.de> <20171206090228.GA9137@kroah.com> From: Marcus Wolf Message-ID: Date: Wed, 6 Dec 2017 12:02:13 +0200 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171206090228.GA9137@kroah.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-DE Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1329 Lines: 46 Am 06.12.2017 um 11:02 schrieb Greg KH: > On Wed, Nov 08, 2017 at 07:13:56PM +0200, Marcus Wolf wrote: >> Fixes issue with bit shift in rf69_get_modulation > > What "issue"? > >> >> Signed-off-by: Marcus Wolf >> --- >> drivers/staging/pi433/rf69.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/staging/pi433/rf69.c b/drivers/staging/pi433/rf69.c >> index 290b419..c945b4b 100644 >> --- a/drivers/staging/pi433/rf69.c >> +++ b/drivers/staging/pi433/rf69.c >> @@ -102,7 +102,7 @@ enum modulation rf69_get_modulation(struct spi_device *spi) >> >> currentValue = READ_REG(REG_DATAMODUL); >> >> - switch (currentValue & MASK_DATAMODUL_MODULATION_TYPE >> 3) { // TODO improvement: change 3 to define >> + switch (currentValue & MASK_DATAMODUL_MODULATION_TYPE) { > > Doesn't this change the logic here? > > thanks, > > greg k-h > Hi Greg, yes, it does. This is one of the very few changes to pi433 driver, that does not modify the architecture or optics of the code, but really fixes a bug. This function wasn't working from the very beginning, and we had already several reports and patches (from me and otheres), announcing or trying to fix the bug. But so far all patches were skipped for some reason. Please take the patch. Marcus