Patchwork fix acpid compiler warning on some platforms

login
register
mail settings
Submitter Christian Betz
Date May 15, 2011, 4:16 a.m.
Message ID <1305433012-13000-2-git-send-email-christian.betz@gmail.com>
Download mbox | patch
Permalink /patch/4061/
State Accepted
Headers show

Comments

Christian Betz - May 15, 2011, 4:16 a.m.
---
 recipes/acpid/acpid-1.0.10/netlink.diff |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Paul Menzel - May 15, 2011, 10:41 a.m.
Dear Christian,


Am Sonntag, den 15.05.2011, 00:16 -0400 schrieb Christian Betz:

thank you for your fast response. Next time please also add the commit
message. The one you provided in your first message would have been
enough. You can even change/improve commit messages using `git commit
--amend` (or `git rebase …`) before doing `git format-patch …`.

I will add the commit message when applying your patch.

You also forgot your Signed-off-by line. Please reply to this message
with just that line since it is required by our commit policy.

Passing `-s` to `git commit` or `git format-patch` adds that line
automatically to  the commit message.

> ---
>  recipes/acpid/acpid-1.0.10/netlink.diff |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/recipes/acpid/acpid-1.0.10/netlink.diff b/recipes/acpid/acpid-1.0.10/netlink.diff
> index 635c550..ebdec58 100644
> --- a/recipes/acpid/acpid-1.0.10/netlink.diff
> +++ b/recipes/acpid/acpid-1.0.10/netlink.diff
> @@ -2019,7 +2019,7 @@ diff -ruN acpid-1.0.10/libnetlink.c acpid-1.0.10-netlink2/libnetlink.c
>  +
>  +int addraw_l(struct nlmsghdr *n, int maxlen, const void *data, int len)
>  +{
> -+	if ((int)NLMSG_ALIGN(n->nlmsg_len) + NLMSG_ALIGN(len) > maxlen) {
> ++	if ((int)NLMSG_ALIGN(n->nlmsg_len) + (int)NLMSG_ALIGN(len) > maxlen) {
>  +		fprintf(stderr, "addraw_l ERROR: message exceeded bound of %d\n",maxlen);
>  +		return -1;
>  +	}


Thanks,

Paul
Christian Betz - May 17, 2011, 1:10 a.m.
Signed-off-by: Christian Betz <christian.betz@gmail.com>
---------------------------------------------------------
I'm sorry I missed the part about officially signing off.

Would you mind telling me the sequence of git format-patch and git
send-email that you typically use?

This is what I plan to do next time

  git format-patch -s 2b621ed98259fa87b2e7ad05d4787d2dbf618608
  git send-email --annotate 0001-fix-something.patch

I will put the commit message as the subject and then detail why the
fix is needed in my editor in annotate mode.

Or maybe there is an official wiki document you (someone) can point me to?

Christian


On Sun, May 15, 2011 at 6:41 AM, Paul Menzel
<paulepanter@users.sourceforge.net> wrote:
> Dear Christian,
>
>
> Am Sonntag, den 15.05.2011, 00:16 -0400 schrieb Christian Betz:
>
> thank you for your fast response. Next time please also add the commit
> message. The one you provided in your first message would have been
> enough. You can even change/improve commit messages using `git commit
> --amend` (or `git rebase …`) before doing `git format-patch …`.
>
> I will add the commit message when applying your patch.
>
> You also forgot your Signed-off-by line. Please reply to this message
> with just that line since it is required by our commit policy.
>
> Passing `-s` to `git commit` or `git format-patch` adds that line
> automatically to  the commit message.
>
>> ---
>>  recipes/acpid/acpid-1.0.10/netlink.diff |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/recipes/acpid/acpid-1.0.10/netlink.diff b/recipes/acpid/acpid-1.0.10/netlink.diff
>> index 635c550..ebdec58 100644
>> --- a/recipes/acpid/acpid-1.0.10/netlink.diff
>> +++ b/recipes/acpid/acpid-1.0.10/netlink.diff
>> @@ -2019,7 +2019,7 @@ diff -ruN acpid-1.0.10/libnetlink.c acpid-1.0.10-netlink2/libnetlink.c
>>  +
>>  +int addraw_l(struct nlmsghdr *n, int maxlen, const void *data, int len)
>>  +{
>> -+    if ((int)NLMSG_ALIGN(n->nlmsg_len) + NLMSG_ALIGN(len) > maxlen) {
>> ++    if ((int)NLMSG_ALIGN(n->nlmsg_len) + (int)NLMSG_ALIGN(len) > maxlen) {
>>  +            fprintf(stderr, "addraw_l ERROR: message exceeded bound of %d\n",maxlen);
>>  +            return -1;
>>  +    }
>
>
> Thanks,
>
> Paul
>
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
>
>
Paul Menzel - May 17, 2011, 10:54 a.m.
Am Montag, den 16.05.2011, 21:10 -0400 schrieb Christian Betz:
> Signed-off-by: Christian Betz <christian.betz@gmail.com>
> ---------------------------------------------------------
> I'm sorry I missed the part about officially signing off.

No problem. This has happened to all of us. I committed your patch in
[1]. Please update the state in the patch queue [2].

> Would you mind telling me the sequence of git format-patch and git
> send-email that you typically use?
> 
> This is what I plan to do next time
> 
>   git format-patch -s 2b621ed98259fa87b2e7ad05d4787d2dbf618608
>   git send-email --annotate 0001-fix-something.patch
> 
> I will put the commit message as the subject and then detail why the
> fix is needed in my editor in annotate mode.

The subject should just contain the summary and the body further
information [3]. So what you wanted to write into annotate you should
put that into the commit message, i. e., when you run `git commit`.

So an example work flow could be the following.

git commit -s # quick note if you are in a hurry
git commit --amend -s # to improve the commit message
git rebase -i HEAD~20 # 20 is an example. This way you can reformat/reorder/edit committed patches.
git format-patch -1 -s # -1 takes the last commit
git send-email 0001-fix-something.patch # You do not need `--annotate` if you formatted and improved everything above.


`-s` is only needed once in that series but it is ignored if the
Signed-off-by line is already present.

> Or maybe there is an official wiki document you (someone) can point me to?

I found [4] and [5]. The manual pages are also very elaborate and
accessible using `git help yourcommand`, e. g., `git help format-patch`.


Thanks,

Paul


[1] http://cgit.openembedded.org/cgit.cgi/openembedded/commit/?id=e0d2de398e156fbdc913cc4decf75c357fcf2b33
[2] http://openembedded.org/index.php/Patchwork
[3] http://lists.linuxtogo.org/pipermail/openembedded-devel/2011-May/032692.html
[4] http://openembedded.org/index.php/Git
[5] http://en.opensuse.org/Git

Patch

diff --git a/recipes/acpid/acpid-1.0.10/netlink.diff b/recipes/acpid/acpid-1.0.10/netlink.diff
index 635c550..ebdec58 100644
--- a/recipes/acpid/acpid-1.0.10/netlink.diff
+++ b/recipes/acpid/acpid-1.0.10/netlink.diff
@@ -2019,7 +2019,7 @@  diff -ruN acpid-1.0.10/libnetlink.c acpid-1.0.10-netlink2/libnetlink.c
 +
 +int addraw_l(struct nlmsghdr *n, int maxlen, const void *data, int len)
 +{
-+	if ((int)NLMSG_ALIGN(n->nlmsg_len) + NLMSG_ALIGN(len) > maxlen) {
++	if ((int)NLMSG_ALIGN(n->nlmsg_len) + (int)NLMSG_ALIGN(len) > maxlen) {
 +		fprintf(stderr, "addraw_l ERROR: message exceeded bound of %d\n",maxlen);
 +		return -1;
 +	}