All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fixes issue with bit shift in rf69_get_modulation
@ 2017-11-08 17:13 Marcus Wolf
  2017-12-06  9:02 ` [PATCH] staging: pi433: " Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Marcus Wolf @ 2017-11-08 17:13 UTC (permalink / raw)
  To: gregkh, dan.carpenter, devel, linux-kernel; +Cc: Marcus Wolf

Fixes issue with bit shift in rf69_get_modulation

Signed-off-by: Marcus Wolf <linux@wolf-entwicklungen.de>
---
 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) {
 	case DATAMODUL_MODULATION_TYPE_OOK: return OOK;
 	case DATAMODUL_MODULATION_TYPE_FSK: return FSK;
 	default:			    return undefined;
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] staging: pi433: Fixes issue with bit shift in rf69_get_modulation
  2017-11-08 17:13 [PATCH] Fixes issue with bit shift in rf69_get_modulation Marcus Wolf
@ 2017-12-06  9:02 ` Greg KH
  2017-12-06 10:02   ` Marcus Wolf
  0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2017-12-06  9:02 UTC (permalink / raw)
  To: Marcus Wolf; +Cc: dan.carpenter, devel, linux-kernel

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 <linux@wolf-entwicklungen.de>
> ---
>  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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] staging: pi433: Fixes issue with bit shift in rf69_get_modulation
  2017-12-06  9:02 ` [PATCH] staging: pi433: " Greg KH
@ 2017-12-06 10:02   ` Marcus Wolf
  2017-12-06 14:23     ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Marcus Wolf @ 2017-12-06 10:02 UTC (permalink / raw)
  To: Greg KH, Marcus Wolf; +Cc: dan.carpenter, devel, linux-kernel



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 <linux@wolf-entwicklungen.de>
>> ---
>>   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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] staging: pi433: Fixes issue with bit shift in rf69_get_modulation
  2017-12-06 10:02   ` Marcus Wolf
@ 2017-12-06 14:23     ` Greg KH
  0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2017-12-06 14:23 UTC (permalink / raw)
  To: Marcus Wolf; +Cc: Marcus Wolf, devel, linux-kernel, dan.carpenter

On Wed, Dec 06, 2017 at 12:02:13PM +0200, Marcus Wolf wrote:
> 
> 
> 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 <linux@wolf-entwicklungen.de>
> > > ---
> > >   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.

Ok, then this should go into 4.15-final, I'll queue it up to that tree.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-12-06 14:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-08 17:13 [PATCH] Fixes issue with bit shift in rf69_get_modulation Marcus Wolf
2017-12-06  9:02 ` [PATCH] staging: pi433: " Greg KH
2017-12-06 10:02   ` Marcus Wolf
2017-12-06 14:23     ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.