All of lore.kernel.org
 help / color / mirror / Atom feed
From: walter harms <wharms@bfs.de>
To: kernel-janitors@vger.kernel.org
Subject: Re: [patch] staging: panel: pass correct lengths to keypad_send_key()
Date: Fri, 30 Nov 2012 09:19:06 +0000	[thread overview]
Message-ID: <50B87A0A.70808@bfs.de> (raw)
In-Reply-To: <20121129143835.GC12199@elgon.mountain>



Am 29.11.2012 15:38, schrieb Dan Carpenter:
> We changed the sizeof() statements in 429ccf058b "staging:panel: Fixed
> coding conventions." so that they could fit inside the 80 character
> line limit.  Unfortunately, the new sizeof() statements are a smaller
> size.  This reverts it.
> 
> There isn't a nice way to stay within the 80 character limit without
> a re-work so I've gone over.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> Untested.  The ->u.kbd.press_str and friends are funny data types.  I'm
> not sure how this code, works but the stuff we have is wrong and I've
> reverted it back to the original.
> 
> diff --git a/drivers/staging/panel/panel.c b/drivers/staging/panel/panel.c
> index d9fec5b..dca42ce 100644
> --- a/drivers/staging/panel/panel.c
> +++ b/drivers/staging/panel/panel.c
> @@ -1758,7 +1758,7 @@ static inline int input_state_high(struct logical_input *input)
>  				char *press_str = input->u.kbd.press_str;
>  				if (press_str[0])
>  					keypad_send_key(press_str,
> -							sizeof(press_str));
> +							sizeof(input->u.kbd.press_str));
>  			}
yep, this looks like the original intention.
NTL i would like to question the use of  press_str and friends.
Moving the if (press_str[0]) into keypad_send_key() seems
more sensible.

just my two cents,

re,
 wh


>  
>  			if (input->u.kbd.repeat_str[0]) {
> @@ -1766,7 +1766,7 @@ static inline int input_state_high(struct logical_input *input)
>  				if (input->high_timer >= KEYPAD_REP_START) {
>  					input->high_timer -= KEYPAD_REP_DELAY;
>  					keypad_send_key(repeat_str,
> -							sizeof(repeat_str));
> +							sizeof(input->u.kbd.repeat_str));
>  				}
>  				/* we will need to come back here soon */
>  				inputs_stable = 0;
> @@ -1805,7 +1805,7 @@ static inline void input_state_falling(struct logical_input *input)
>  				if (input->high_timer >= KEYPAD_REP_START)
>  					input->high_timer -= KEYPAD_REP_DELAY;
>  					keypad_send_key(repeat_str,
> -							sizeof(repeat_str));
> +							sizeof(input->u.kbd.repeat_str));
>  				/* we will need to come back here soon */
>  				inputs_stable = 0;
>  			}
> @@ -1824,7 +1824,7 @@ static inline void input_state_falling(struct logical_input *input)
>  			char *release_str = input->u.kbd.release_str;
>  			if (release_str[0])
>  				keypad_send_key(release_str,
> -						sizeof(release_str));
> +						sizeof(input->u.kbd.release_str));
>  		}
>  
>  		input->state = INPUT_ST_LOW;
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 

  reply	other threads:[~2012-11-30  9:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-29 14:38 [patch] staging: panel: pass correct lengths to keypad_send_key() Dan Carpenter
2012-11-30  9:19 ` walter harms [this message]
2012-12-01  8:08 ` Willy Tarreau
2012-12-01  8:13 ` Willy Tarreau
2012-12-02 11:22 ` Dan Carpenter
2012-12-02 11:53 ` Willy Tarreau
2012-12-02 15:44 ` walter harms

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50B87A0A.70808@bfs.de \
    --to=wharms@bfs.de \
    --cc=kernel-janitors@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.