Re: [RFC] Add ff-memless-next driver

2013-12-15 Thread Michal Malý
On Saturday 14 of December 2013 18:04:02 Joe Perches wrote:
> On Sun, 2013-12-15 at 01:19 +0100, Michal Malý wrote:
> > diff --git a/drivers/input/ff-memless-next.c
> > b/drivers/input/ff-memless-next.c
> []
> 
> > +static inline s32 mlnx_clamp_level(const s32 level)
> > +{
> > +   return (level > 0x7fff) ? 0x7fff : ((level < -0x7fff) ? -0x7fff :
> > level);
> 
>   clamp(level, -0x7fff, 0x7fff);
> []
> 
> > +static inline int mlnx_is_conditional(const struct ff_effect *effect)
> > +{
> > +   return (effect->type == FF_DAMPER) || (effect->type == FF_FRICTION) ||
> > (effect->type == FF_INERTIA) || (effect->type == FF_SPRING); +}
> 
> Maybe try to run your patch through scripts/checkpatch.pl
> 
> bool?
> 80 char line max? (true for the file, not just here)
> switch?
>   switch (effect->type) {
>   case FF_DAMPER:
>   case FF_FRICTION:
>   case FF_INERTIA:
>   case FF_SPRING:
>   return true;
>   }
>   return false;

Okay, thanks for the input. I found a problem regarding effect updating in the 
code anyway. I'll submit a corrected version of the patch once I'm sure it's 
fixed.

Michal
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC] Add ff-memless-next driver

2013-12-15 Thread Michal Malý
On Saturday 14 of December 2013 18:04:02 Joe Perches wrote:
 On Sun, 2013-12-15 at 01:19 +0100, Michal Malý wrote:
  diff --git a/drivers/input/ff-memless-next.c
  b/drivers/input/ff-memless-next.c
 []
 
  +static inline s32 mlnx_clamp_level(const s32 level)
  +{
  +   return (level  0x7fff) ? 0x7fff : ((level  -0x7fff) ? -0x7fff :
  level);
 
   clamp(level, -0x7fff, 0x7fff);
 []
 
  +static inline int mlnx_is_conditional(const struct ff_effect *effect)
  +{
  +   return (effect-type == FF_DAMPER) || (effect-type == FF_FRICTION) ||
  (effect-type == FF_INERTIA) || (effect-type == FF_SPRING); +}
 
 Maybe try to run your patch through scripts/checkpatch.pl
 
 bool?
 80 char line max? (true for the file, not just here)
 switch?
   switch (effect-type) {
   case FF_DAMPER:
   case FF_FRICTION:
   case FF_INERTIA:
   case FF_SPRING:
   return true;
   }
   return false;

Okay, thanks for the input. I found a problem regarding effect updating in the 
code anyway. I'll submit a corrected version of the patch once I'm sure it's 
fixed.

Michal
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC] Add ff-memless-next driver

2013-12-14 Thread Joe Perches
On Sun, 2013-12-15 at 01:19 +0100, Michal Malý wrote:
> diff --git a/drivers/input/ff-memless-next.c b/drivers/input/ff-memless-next.c
[]
> +static inline s32 mlnx_clamp_level(const s32 level)
> +{
> + return (level > 0x7fff) ? 0x7fff : ((level < -0x7fff) ? -0x7fff : 
> level);

clamp(level, -0x7fff, 0x7fff);
[]
> +static inline int mlnx_is_conditional(const struct ff_effect *effect)
> +{
> + return (effect->type == FF_DAMPER) || (effect->type == FF_FRICTION) || 
> (effect->type == FF_INERTIA) || (effect->type == FF_SPRING);
> +}

Maybe try to run your patch through scripts/checkpatch.pl

bool?
80 char line max? (true for the file, not just here)
switch?
switch (effect->type) {
case FF_DAMPER:
case FF_FRICTION:
case FF_INERTIA:
case FF_SPRING:
return true;
}
return false;



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC] Add ff-memless-next driver

2013-12-14 Thread Joe Perches
On Sun, 2013-12-15 at 01:19 +0100, Michal Malý wrote:
 diff --git a/drivers/input/ff-memless-next.c b/drivers/input/ff-memless-next.c
[]
 +static inline s32 mlnx_clamp_level(const s32 level)
 +{
 + return (level  0x7fff) ? 0x7fff : ((level  -0x7fff) ? -0x7fff : 
 level);

clamp(level, -0x7fff, 0x7fff);
[]
 +static inline int mlnx_is_conditional(const struct ff_effect *effect)
 +{
 + return (effect-type == FF_DAMPER) || (effect-type == FF_FRICTION) || 
 (effect-type == FF_INERTIA) || (effect-type == FF_SPRING);
 +}

Maybe try to run your patch through scripts/checkpatch.pl

bool?
80 char line max? (true for the file, not just here)
switch?
switch (effect-type) {
case FF_DAMPER:
case FF_FRICTION:
case FF_INERTIA:
case FF_SPRING:
return true;
}
return false;



--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/