Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1491366 > unrolled thread

[PATCH 0/5] ISDN-Gigaset: Fine-tuning for three function implementations

Started bySF Markus Elfring <elfring@users.sourceforge.net>
First post2016-09-26 17:40 +0200
Last post2016-09-28 20:00 +0200
Articles 20 on this page of 45 — 10 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 0/5] ISDN-Gigaset: Fine-tuning for three function  implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-26 17:40 +0200
    [PATCH 1/5] ISDN-Gigaset: Use kmalloc_array() in two functions SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-26 17:40 +0200
      Re: [PATCH 1/5] ISDN-Gigaset: Use kmalloc_array() in two functions Paul Bolle <pebolle@tiscali.nl> - 2016-09-28 13:40 +0200
        Re: [PATCH 1/5] ISDN-Gigaset: Use kmalloc_array() in two functions SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-28 18:50 +0200
          Re: [PATCH 1/5] ISDN-Gigaset: Use kmalloc_array() in two functions Paul Bolle <pebolle@tiscali.nl> - 2016-09-28 19:50 +0200
    [PATCH 2/5] ISDN-Gigaset: Improve another size determination in  gigaset_initcs() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-26 17:50 +0200
    [PATCH 4/5] ISDN-Gigaset: Release memory in gigaset_initcs() after an  allocation failure SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-26 17:50 +0200
      Re: [PATCH 4/5] ISDN-Gigaset: Release memory in gigaset_initcs()  after an allocation failure Paul Bolle <pebolle@tiscali.nl> - 2016-09-26 23:20 +0200
        Re: ISDN-Gigaset: Release memory in gigaset_initcs() after an  allocation failure SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-27 07:30 +0200
          Re: ISDN-Gigaset: Release memory in gigaset_initcs() after an  allocation failure Paul Bolle <pebolle@tiscali.nl> - 2016-09-27 10:50 +0200
            Re: ISDN-Gigaset: Release memory in gigaset_initcs() after an  allocation failure SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-27 11:40 +0200
              Re: ISDN-Gigaset: Release memory in gigaset_initcs() after an  allocation failure Paul Bolle <pebolle@tiscali.nl> - 2016-09-27 11:50 +0200
              Re: [Gigaset307x-common] ISDN-Gigaset: Release memory in  gigaset_initcs() after an allocation failure Tilman Schmidt <tilman@imap.cc> - 2016-09-27 12:30 +0200
                Re: [Gigaset307x-common] ISDN-Gigaset: Release memory in  gigaset_initcs() after an allocation failure SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-27 13:40 +0200
                  Re: [Gigaset307x-common] ISDN-Gigaset: Release memory in  gigaset_initcs() after an allocation failure Tilman Schmidt <tilman@imap.cc> - 2016-09-27 14:10 +0200
                  Re: [Gigaset307x-common] ISDN-Gigaset: Release memory in  gigaset_initcs() after an allocation failure isdn@linux-pingi.de - 2016-09-27 14:20 +0200
                    Re: [Gigaset307x-common] ISDN-Gigaset: Release memory in  gigaset_initcs() after an allocation failure SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-27 15:00 +0200
                      Re: [Gigaset307x-common] ISDN-Gigaset: Release memory in  gigaset_initcs() after an allocation failure Tilman Schmidt <tilman@imap.cc> - 2016-09-27 16:40 +0200
        Re: [PATCH 4/5] ISDN-Gigaset: Release memory in gigaset_initcs()  after an allocation failure Dan Carpenter <dan.carpenter@oracle.com> - 2016-09-27 09:40 +0200
        Re: [PATCH 4/5] ISDN-Gigaset: Release memory in gigaset_initcs()  after an allocation failure SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-27 17:20 +0200
      Re: [PATCH 4/5] ISDN-Gigaset: Release memory in gigaset_initcs()  after an allocation failure Dan Carpenter <dan.carpenter@oracle.com> - 2016-09-27 09:20 +0200
        Re: ISDN-Gigaset: Release memory in gigaset_initcs() after an  allocation failure SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-27 09:30 +0200
    [PATCH 3/5] ISDN-Gigaset: Delete an error message for a failed memory  allocation SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-26 17:50 +0200
      Re: [PATCH 3/5] ISDN-Gigaset: Delete an error message for a failed  memory allocation Tilman Schmidt <tilman@imap.cc> - 2016-09-27 13:00 +0200
        Re: [PATCH 3/5] ISDN-Gigaset: Delete an error message for a failed  memory allocation Paul Bolle <pebolle@tiscali.nl> - 2016-09-28 13:50 +0200
    [PATCH 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof  operator by parentheses SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-26 17:50 +0200
      RE: [PATCH 5/5] ISDN-Gigaset: Enclose two expressions for the  sizeof operator by parentheses David Laight <David.Laight@ACULAB.COM> - 2016-09-26 18:10 +0200
        Re: [PATCH 5/5] ISDN-Gigaset: Enclose two expressions for the  sizeof operator by parentheses Joe Perches <joe@perches.com> - 2016-09-26 18:30 +0200
          Re: [PATCH 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof  operator by parentheses SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-26 18:50 +0200
            Re: [PATCH 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof  operator by parentheses Julia Lawall <julia.lawall@lip6.fr> - 2016-09-26 19:00 +0200
          [PATCH v2 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof  operator by parentheses SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-26 19:50 +0200
            Re: [PATCH v2 5/5] ISDN-Gigaset: Enclose two expressions for the  sizeof operator by parentheses Paul Bolle <pebolle@tiscali.nl> - 2016-09-26 20:40 +0200
              Re: [PATCH v2 5/5] ISDN-Gigaset: Enclose two expressions for the  sizeof operator by parentheses SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-26 20:50 +0200
            Re: [PATCH v2 5/5] ISDN-Gigaset: Enclose two expressions for the  sizeof operator by parentheses David Miller <davem@davemloft.net> - 2016-09-27 02:20 +0200
              Re: [PATCH v2 5/5] ISDN-Gigaset: Enclose two expressions for the  sizeof operator by parentheses SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-27 07:40 +0200
      Re: [PATCH 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof  operator by parentheses Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2016-09-26 19:40 +0200
        Re: ISDN-Gigaset: Enclose two expressions for the sizeof operator by  parentheses SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-26 20:10 +0200
          Re: ISDN-Gigaset: Enclose two expressions for the sizeof operator  by parentheses Paul Bolle <pebolle@tiscali.nl> - 2016-09-26 20:40 +0200
        Re: [PATCH 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof  operator by parentheses Dan Carpenter <dan.carpenter@oracle.com> - 2016-09-27 09:10 +0200
          Re: [PATCH 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof  operator by parentheses Dan Carpenter <dan.carpenter@oracle.com> - 2016-09-27 09:30 +0200
    Re: [PATCH 0/5] ISDN-Gigaset: Fine-tuning for three function  implementations Paul Bolle <pebolle@tiscali.nl> - 2016-09-26 22:40 +0200
      Re: ISDN-Gigaset: Fine-tuning for three function implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-27 07:20 +0200
    Re: [PATCH 0/5] ISDN-Gigaset: Fine-tuning for three function  implementations Paul Bolle <pebolle@tiscali.nl> - 2016-09-28 14:00 +0200
      Re: ISDN-Gigaset: Fine-tuning for three function implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-28 19:00 +0200
        Re: ISDN-Gigaset: Fine-tuning for three function implementations Paul Bolle <pebolle@tiscali.nl> - 2016-09-28 20:00 +0200

Page 2 of 3 — ← Prev page 1 [2] 3  Next page →


#1491714 — Re: [PATCH 4/5] ISDN-Gigaset: Release memory in gigaset_initcs() after an allocation failure

FromDan Carpenter <dan.carpenter@oracle.com>
Date2016-09-27 09:20 +0200
SubjectRe: [PATCH 4/5] ISDN-Gigaset: Release memory in gigaset_initcs() after an allocation failure
Message-ID<slUQh-6zq-7@gated-at.bofh.it>
In reply to#1491379
This patch creates new bugs.

I have a policy of not telling Markus where the bug is, because
otherwise he'll just resend the patch and I have told him many times to
stop sending these cleanup patches that just introduce bugs and waste
maintainer time.

regards,
dan carpenter

[toc] | [prev] | [next] | [standalone]


#1491717 — Re: ISDN-Gigaset: Release memory in gigaset_initcs() after an allocation failure

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2016-09-27 09:30 +0200
SubjectRe: ISDN-Gigaset: Release memory in gigaset_initcs() after an allocation failure
Message-ID<slUZX-6Cu-1@gated-at.bofh.it>
In reply to#1491714
> This patch creates new bugs.

Thanks for your information.


> I have a policy of not telling Markus where the bug is,

I find this kind of response strange.


> because otherwise he'll just resend the patch

This can also happen when the other contributors request it.


> and I have told him many times to stop sending these cleanup patches

Software "cleanups" seem to stress the review process to some degree.


> that just introduce bugs and waste maintainer time.

I guess that the situation is mixed depending on the subsystem
or concrete software module, isn't it?

Regards,
Markus

[toc] | [prev] | [next] | [standalone]


#1491382 — [PATCH 3/5] ISDN-Gigaset: Delete an error message for a failed memory allocation

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2016-09-26 17:50 +0200
Subject[PATCH 3/5] ISDN-Gigaset: Delete an error message for a failed memory allocation
Message-ID<slGki-5BO-31@gated-at.bofh.it>
In reply to#1491366
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 26 Sep 2016 15:35:47 +0200

Omit an extra message for a memory allocation failure in this function.

Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/isdn/gigaset/common.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/isdn/gigaset/common.c b/drivers/isdn/gigaset/common.c
index f505b42..c05a2a4 100644
--- a/drivers/isdn/gigaset/common.c
+++ b/drivers/isdn/gigaset/common.c
@@ -712,7 +712,6 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels,
 	cs->bcs = kmalloc_array(channels, sizeof(*cs->bcs), GFP_KERNEL);
 	cs->inbuf = kmalloc(sizeof(*cs->inbuf), GFP_KERNEL);
 	if (!cs->bcs || !cs->inbuf) {
-		pr_err("out of memory\n");
 		goto error;
 	}
 	++cs->cs_init;
-- 
2.10.0

[toc] | [prev] | [next] | [standalone]


#1491812 — Re: [PATCH 3/5] ISDN-Gigaset: Delete an error message for a failed memory allocation

FromTilman Schmidt <tilman@imap.cc>
Date2016-09-27 13:00 +0200
SubjectRe: [PATCH 3/5] ISDN-Gigaset: Delete an error message for a failed memory allocation
Message-ID<slYhb-8vQ-1@gated-at.bofh.it>
In reply to#1491382
On Mon, Sep 26, 2016, at 17:42, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Mon, 26 Sep 2016 15:35:47 +0200
> 
> Omit an extra message for a memory allocation failure in this function.
> 
> Link:
> http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>

The patch is fine but the link in the commit message is irrelevant.
Please remove it.
(Yes, I read through the whole presentation to verify that. It was fun,
even.)

-- 
Tilman Schmidt
tilman@imap.cc

[toc] | [prev] | [next] | [standalone]


#1492545 — Re: [PATCH 3/5] ISDN-Gigaset: Delete an error message for a failed memory allocation

FromPaul Bolle <pebolle@tiscali.nl>
Date2016-09-28 13:50 +0200
SubjectRe: [PATCH 3/5] ISDN-Gigaset: Delete an error message for a failed memory allocation
Message-ID<smlx8-66C-29@gated-at.bofh.it>
In reply to#1491812
On Tue, 2016-09-27 at 12:57 +0200, Tilman Schmidt wrote:
> On Mon, Sep 26, 2016, at 17:42, SF Markus Elfring wrote:
> > Omit an extra message for a memory allocation failure in this
> > function.
> > 
> > Link:
> > http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-R
> > efactor_Strings-WSang_0.pdf
> > 
> > Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> 
> The patch is fine but the link in the commit message is irrelevant.
> Please remove it.
> (Yes, I read through the whole presentation to verify that. It was fun,
> even.)

Agree.

Except this patch assumes the superfluous braces would be removed in
4/5. But it turns out that other patch must be dropped. It would have
been better to remove the braces in this patch.


Paul Bolle

[toc] | [prev] | [next] | [standalone]


#1491383 — [PATCH 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof operator by parentheses

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2016-09-26 17:50 +0200
Subject[PATCH 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof operator by parentheses
Message-ID<slGki-5BO-21@gated-at.bofh.it>
In reply to#1491366
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 26 Sep 2016 17:03:56 +0200
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The script "checkpatch.pl" can point information out like the following.

WARNING: sizeof … should be sizeof(…)

Thus fix the affected source code places.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/isdn/gigaset/common.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/isdn/gigaset/common.c b/drivers/isdn/gigaset/common.c
index 2e9382f..d901ed7 100644
--- a/drivers/isdn/gigaset/common.c
+++ b/drivers/isdn/gigaset/common.c
@@ -53,7 +53,7 @@ void gigaset_dbg_buffer(enum debuglevel level, const unsigned char *msg,
 {
 	unsigned char outbuf[80];
 	unsigned char c;
-	size_t space = sizeof outbuf - 1;
+	size_t space = sizeof(outbuf - 1);
 	unsigned char *out = outbuf;
 	size_t numin = len;
 
@@ -1079,7 +1079,7 @@ struct gigaset_driver *gigaset_initdriver(unsigned minor, unsigned minors,
 	unsigned long flags;
 	unsigned i;
 
-	drv = kmalloc(sizeof *drv, GFP_KERNEL);
+	drv = kmalloc(sizeof(*drv), GFP_KERNEL);
 	if (!drv)
 		return NULL;
 
-- 
2.10.0

[toc] | [prev] | [next] | [standalone]


#1491393 — RE: [PATCH 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof operator by parentheses

FromDavid Laight <David.Laight@ACULAB.COM>
Date2016-09-26 18:10 +0200
SubjectRE: [PATCH 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof operator by parentheses
Message-ID<slGDE-5XZ-11@gated-at.bofh.it>
In reply to#1491383
From: SF Markus Elfring
> Sent: 26 September 2016 16:45
...
> The script "checkpatch.pl" can point information out like the following.
> 
> WARNING: sizeof … should be sizeof(…)
...
> ---
>  drivers/isdn/gigaset/common.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/isdn/gigaset/common.c b/drivers/isdn/gigaset/common.c
> index 2e9382f..d901ed7 100644
> --- a/drivers/isdn/gigaset/common.c
> +++ b/drivers/isdn/gigaset/common.c
> @@ -53,7 +53,7 @@ void gigaset_dbg_buffer(enum debuglevel level, const unsigned char *msg,
>  {
>  	unsigned char outbuf[80];
>  	unsigned char c;
> -	size_t space = sizeof outbuf - 1;
> +	size_t space = sizeof(outbuf - 1);

wrong ...
think that is 7 instead of 79.

	David

[toc] | [prev] | [next] | [standalone]


#1491411 — Re: [PATCH 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof operator by parentheses

FromJoe Perches <joe@perches.com>
Date2016-09-26 18:30 +0200
SubjectRe: [PATCH 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof operator by parentheses
Message-ID<slGX0-67A-19@gated-at.bofh.it>
In reply to#1491393
On Mon, 2016-09-26 at 16:00 +0000, David Laight wrote:
> From: SF Markus Elfring Sent: 26 September 2016 16:45
> > The script "checkpatch.pl" can point information out like the following.
> > WARNING: sizeof … should be sizeof(…)
> []
> > diff --git a/drivers/isdn/gigaset/common.c b/drivers/isdn/gigaset/common.c
[]
> > @@ -53,7 +53,7 @@ void gigaset_dbg_buffer(enum debuglevel level, const unsigned char *msg,
> >  {
> >  	unsigned char outbuf[80];
> >  	unsigned char c;
> > -	size_t space = sizeof outbuf - 1;
> > +	size_t space = sizeof(outbuf - 1);

> wrong ...
> think that is 7 instead of 79.


Well, it's sizeof(pointer) so either 4 or 8, but still,
what Markus proposes here is _wrong_.

Markus, do you know the script probably has a lower
style conversion defect introduction rate than you do
when doing these mechanical things.

Please use it to verify what you are doing before
submitting more defective patches.

Excuses and apologies aren't good enough at this point.

[toc] | [prev] | [next] | [standalone]


#1491428 — Re: [PATCH 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof operator by parentheses

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2016-09-26 18:50 +0200
SubjectRe: [PATCH 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof operator by parentheses
Message-ID<slHgl-6ej-13@gated-at.bofh.it>
In reply to#1491411
>>> @@ -53,7 +53,7 @@ void gigaset_dbg_buffer(enum debuglevel level, const unsigned char *msg,
>>>  {
>>>  	unsigned char outbuf[80];
>>>  	unsigned char c;
>>> -	size_t space = sizeof outbuf - 1;
>>> +	size_t space = sizeof(outbuf - 1);
> 
>> wrong ...
>> think that is 7 instead of 79.
> 
> 
> Well, it's sizeof(pointer) so either 4 or 8, but still,
> what Markus proposes here is _wrong_.

You are right at this place.


> Markus, do you know the script probably has a lower
> style conversion defect introduction rate than you do
> when doing these mechanical things.

Would it be nice if the script "checkpatch.pl" could avoid to point
such a false positive out anyhow?


> Please use it to verify what you are doing before
> submitting more defective patches.

Do you expect a resend for this update step so that an other statement
in the function "gigaset_initdriver" would eventually be adjusted?

Regards,
Markus

[toc] | [prev] | [next] | [standalone]


#1491440 — Re: [PATCH 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof operator by parentheses

FromJulia Lawall <julia.lawall@lip6.fr>
Date2016-09-26 19:00 +0200
SubjectRe: [PATCH 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof operator by parentheses
Message-ID<slHq2-6hN-31@gated-at.bofh.it>
In reply to#1491428

On Mon, 26 Sep 2016, SF Markus Elfring wrote:

> >>> @@ -53,7 +53,7 @@ void gigaset_dbg_buffer(enum debuglevel level, const unsigned char *msg,
> >>>  {
> >>>  	unsigned char outbuf[80];
> >>>  	unsigned char c;
> >>> -	size_t space = sizeof outbuf - 1;
> >>> +	size_t space = sizeof(outbuf - 1);
> >
> >> wrong ...
> >> think that is 7 instead of 79.
> >
> >
> > Well, it's sizeof(pointer) so either 4 or 8, but still,
> > what Markus proposes here is _wrong_.
>
> You are right at this place.
>
>
> > Markus, do you know the script probably has a lower
> > style conversion defect introduction rate than you do
> > when doing these mechanical things.
>
> Would it be nice if the script "checkpatch.pl" could avoid to point
> such a false positive out anyhow?

checkpatch reports:

WARNING: sizeof outbuf should be sizeof(outbuf)
#56: FILE: drivers/isdn/gigaset/common.c:56:
+	size_t space = sizeof outbuf - 1;

There is nothing wrong with the report,

julia

>
>
> > Please use it to verify what you are doing before
> > submitting more defective patches.
>
> Do you expect a resend for this update step so that an other statement
> in the function "gigaset_initdriver" would eventually be adjusted?
>
> Regards,
> Markus
> --
> 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
>

[toc] | [prev] | [next] | [standalone]


#1491473 — [PATCH v2 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof operator by parentheses

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2016-09-26 19:50 +0200
Subject[PATCH v2 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof operator by parentheses
Message-ID<slIcp-6Mu-11@gated-at.bofh.it>
In reply to#1491411
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 26 Sep 2016 19:34:27 +0200
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The script "checkpatch.pl" can point information out like the following.

WARNING: sizeof … should be sizeof(…)

Thus fix the affected source code places.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---

v2: Position the desired closing parenthesis behind the variable name for
    a character buffer.

 drivers/isdn/gigaset/common.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/isdn/gigaset/common.c b/drivers/isdn/gigaset/common.c
index 2e9382f..dba44e1 100644
--- a/drivers/isdn/gigaset/common.c
+++ b/drivers/isdn/gigaset/common.c
@@ -53,7 +53,7 @@ void gigaset_dbg_buffer(enum debuglevel level, const unsigned char *msg,
 {
 	unsigned char outbuf[80];
 	unsigned char c;
-	size_t space = sizeof outbuf - 1;
+	size_t space = sizeof(outbuf) - 1;
 	unsigned char *out = outbuf;
 	size_t numin = len;
 
@@ -1079,7 +1079,7 @@ struct gigaset_driver *gigaset_initdriver(unsigned minor, unsigned minors,
 	unsigned long flags;
 	unsigned i;
 
-	drv = kmalloc(sizeof *drv, GFP_KERNEL);
+	drv = kmalloc(sizeof(*drv), GFP_KERNEL);
 	if (!drv)
 		return NULL;
 
-- 
2.10.0

[toc] | [prev] | [next] | [standalone]


#1491501 — Re: [PATCH v2 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof operator by parentheses

FromPaul Bolle <pebolle@tiscali.nl>
Date2016-09-26 20:40 +0200
SubjectRe: [PATCH v2 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof operator by parentheses
Message-ID<slIYN-7lv-5@gated-at.bofh.it>
In reply to#1491473
On Mon, 2016-09-26 at 19:44 +0200, SF Markus Elfring wrote:
> v2: Position the desired closing parenthesis behind the variable name for
>     a character buffer.

Please wait a reasonable amount of time (say a week or two) to collect
all feedback on all patches of a series. If there's feedback you should
resend the entire series (minus those patches that have been NAK-ed, of
course) as an update (v2, v3, etc.).

Don't resubmit one single patch of a series (within hours!) as you did
here.

I hope to have a look at your series within a few days. Show some
patience.

Thanks,


Paul Bolle

[toc] | [prev] | [next] | [standalone]


#1491505 — Re: [PATCH v2 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof operator by parentheses

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2016-09-26 20:50 +0200
SubjectRe: [PATCH v2 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof operator by parentheses
Message-ID<slJ8t-7oT-9@gated-at.bofh.it>
In reply to#1491501
> Don't resubmit one single patch of a series (within hours!)
> as you did here.

I hope that I could reduce the confusion a bit which I introduced
with a change in the last step of my questionable update suggestion.


> I hope to have a look at your series within a few days.
> Show some patience.

Yes, of course.

Regards,
Markus

[toc] | [prev] | [next] | [standalone]


#1491611 — Re: [PATCH v2 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof operator by parentheses

FromDavid Miller <davem@davemloft.net>
Date2016-09-27 02:20 +0200
SubjectRe: [PATCH v2 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof operator by parentheses
Message-ID<slOhP-2ju-5@gated-at.bofh.it>
In reply to#1491473
When you need to make changes to patches that are part of a series,
you must resubmit the entire series, not just the things that
are changes.

[toc] | [prev] | [next] | [standalone]


#1491695 — Re: [PATCH v2 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof operator by parentheses

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2016-09-27 07:40 +0200
SubjectRe: [PATCH v2 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof operator by parentheses
Message-ID<slThv-5xf-7@gated-at.bofh.it>
In reply to#1491611
> When you need to make changes to patches that are part of a series,
> you must resubmit the entire series,

I imagine that will happen when the patch review time passed by a bit
more as Paul Bolle requested it yesterday.


> not just the things that are changes.

Thanks for your reminder.

Regards,
Markus

[toc] | [prev] | [next] | [standalone]


#1491472 — Re: [PATCH 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof operator by parentheses

FromSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date2016-09-26 19:40 +0200
SubjectRe: [PATCH 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof operator by parentheses
Message-ID<slI2K-6Jd-41@gated-at.bofh.it>
In reply to#1491383
Hello.

On 09/26/2016 06:44 PM, SF Markus Elfring wrote:

> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Mon, 26 Sep 2016 17:03:56 +0200
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
>
> The script "checkpatch.pl" can point information out like the following.
>
> WARNING: sizeof … should be sizeof(…)
>
> Thus fix the affected source code places.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  drivers/isdn/gigaset/common.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/isdn/gigaset/common.c b/drivers/isdn/gigaset/common.c
> index 2e9382f..d901ed7 100644
> --- a/drivers/isdn/gigaset/common.c
> +++ b/drivers/isdn/gigaset/common.c
> @@ -53,7 +53,7 @@ void gigaset_dbg_buffer(enum debuglevel level, const unsigned char *msg,
>  {
>  	unsigned char outbuf[80];
>  	unsigned char c;
> -	size_t space = sizeof outbuf - 1;
> +	size_t space = sizeof(outbuf - 1);

    What?! Does that compile?

[...]

MBR, Sergei

[toc] | [prev] | [next] | [standalone]


#1491490 — Re: ISDN-Gigaset: Enclose two expressions for the sizeof operator by parentheses

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2016-09-26 20:10 +0200
SubjectRe: ISDN-Gigaset: Enclose two expressions for the sizeof operator by parentheses
Message-ID<slIvN-79b-63@gated-at.bofh.it>
In reply to#1491472
>> @@ -53,7 +53,7 @@ void gigaset_dbg_buffer(enum debuglevel level, const unsigned char *msg,
>>  {
>>      unsigned char outbuf[80];
>>      unsigned char c;
>> -    size_t space = sizeof outbuf - 1;
>> +    size_t space = sizeof(outbuf - 1);
> 
>    What?! Does that compile?

Yes, of course. - The calculated value will be lower than intended.

Unfortunately, I stumbled on one of my own programming mistakes once again.


I sent a corrected update suggestion for further considerations a few minutes ago.

Regards,
Markus

[toc] | [prev] | [next] | [standalone]


#1491502 — Re: ISDN-Gigaset: Enclose two expressions for the sizeof operator by parentheses

FromPaul Bolle <pebolle@tiscali.nl>
Date2016-09-26 20:40 +0200
SubjectRe: ISDN-Gigaset: Enclose two expressions for the sizeof operator by parentheses
Message-ID<slIYN-7lv-9@gated-at.bofh.it>
In reply to#1491490
Where did the [PATCH 5/5] part of the subject go? You didn't drop it,
did you? Because that's surprisingly annoying.


Paul Bolle

[toc] | [prev] | [next] | [standalone]


#1491710 — Re: [PATCH 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof operator by parentheses

FromDan Carpenter <dan.carpenter@oracle.com>
Date2016-09-27 09:10 +0200
SubjectRe: [PATCH 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof operator by parentheses
Message-ID<slUGC-6wg-39@gated-at.bofh.it>
In reply to#1491472
On Mon, Sep 26, 2016 at 08:38:14PM +0300, Sergei Shtylyov wrote:
> >@@ -53,7 +53,7 @@ void gigaset_dbg_buffer(enum debuglevel level, const unsigned char *msg,
> > {
> > 	unsigned char outbuf[80];
> > 	unsigned char c;
> >-	size_t space = sizeof outbuf - 1;
> >+	size_t space = sizeof(outbuf - 1);
> 
>    What?! Does that compile?
> 
> [...]

It prints a Smatch warning.  Smatch ignores these if they happen inside
a macro where you pass a pointer and it takes the sizeof() the argument.

regards,
dan carpenter

[toc] | [prev] | [next] | [standalone]


#1491716 — Re: [PATCH 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof operator by parentheses

FromDan Carpenter <dan.carpenter@oracle.com>
Date2016-09-27 09:30 +0200
SubjectRe: [PATCH 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof operator by parentheses
Message-ID<slUZX-6Cu-3@gated-at.bofh.it>
In reply to#1491710
On Tue, Sep 27, 2016 at 10:08:37AM +0300, Dan Carpenter wrote:
> On Mon, Sep 26, 2016 at 08:38:14PM +0300, Sergei Shtylyov wrote:
> > >@@ -53,7 +53,7 @@ void gigaset_dbg_buffer(enum debuglevel level, const unsigned char *msg,
> > > {
> > > 	unsigned char outbuf[80];
> > > 	unsigned char c;
> > >-	size_t space = sizeof outbuf - 1;
> > >+	size_t space = sizeof(outbuf - 1);
> > 
> >    What?! Does that compile?
> > 
> > [...]
> 
> It prints a Smatch warning.  Smatch ignores these if they happen inside
> a macro where you pass a pointer and it takes the sizeof() the argument.

Reading that again, I realize it's not clear.  Smatch ignores these any
time they happen in a macro whether they're valid or not.  (Many times
they are valid).

regards,
dan carpenter

[toc] | [prev] | [next] | [standalone]


Page 2 of 3 — ← Prev page 1 [2] 3  Next page →

Back to top | Article view | linux.kernel


csiph-web