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


Groups > linux.kernel > #1305029

Re: [PATCH v4.4-rc8 6/7] isdn: eicon: diddfunc: Silence frame size warning

From Tim Gardner <tim.gardner@canonical.com>
Newsgroups linux.kernel
Subject Re: [PATCH v4.4-rc8 6/7] isdn: eicon: diddfunc: Silence frame size warning
Date 2016-01-08 23:20 +0100
Message-ID <qONy2-4Fy-9@gated-at.bofh.it> (permalink)
References <qOEuJ-6IK-3@gated-at.bofh.it> <qOEuK-6IK-23@gated-at.bofh.it> <qOLwe-3l9-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 01/08/2016 01:04 PM, Sergei Shtylyov wrote:
> Hello.
> 
> On 01/08/2016 03:32 PM, tim.gardner@canonical.com wrote:
> 
>> From: Tim Gardner <tim.gardner@canonical.com>
>>
>> drivers/isdn/hardware/eicon/diddfunc.c: In function 'connect_didd':
>> drivers/isdn/hardware/eicon/diddfunc.c:77:1: warning: the frame size
>> of 1152 bytes is larger than 1024 bytes [-Wframe-larger-than=]
>>
>> gcc version 5.3.1 20151219 (Ubuntu 5.3.1-4ubuntu1)
>>
>> Cc: Armin Schindler <mac@melware.de>
>> Cc: Karsten Keil <isdn@linux-pingi.de>
>> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
>> ---
>>   drivers/isdn/hardware/eicon/diddfunc.c | 17 +++++++++++++----
>>   1 file changed, 13 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/isdn/hardware/eicon/diddfunc.c
>> b/drivers/isdn/hardware/eicon/diddfunc.c
>> index b0b23ed..a9feb4f 100644
>> --- a/drivers/isdn/hardware/eicon/diddfunc.c
>> +++ b/drivers/isdn/hardware/eicon/diddfunc.c
>> @@ -52,9 +52,13 @@ static int __init connect_didd(void)
>>       int x = 0;
>>       int dadapter = 0;
>>       IDI_SYNC_REQ req;
>> -    DESCRIPTOR DIDD_Table[MAX_DESCRIPTORS];
>> +    DESCRIPTOR *DIDD_Table;
>>
>> -    DIVA_DIDD_Read(DIDD_Table, sizeof(DIDD_Table));
>> +    DIDD_Table = kcalloc(MAX_DESCRIPTORS, sizeof(*DIDD_Table),
>> GFP_KERNEL);
> 
>   Previously the array didn't seem to be zeroed, perhaps it's better to
> use kmalloc_array()?
> 
> [...]
> 
> MHR, Sergei
> 

The last patch in the series (isdn: eicon: consolidate descriptor
allocation) consolidates the allocation code into one function. I used
kmalloc() there because I noticed that diva_didd_read_adapter_array()
does zero the buffer before using it.

Do you think that is sufficient ?

rtg
-- 
Tim Gardner tim.gardner@canonical.com

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v4.4-rc8 0/7] isdn: eicon: Silence frame size warnings tim.gardner@canonical.com - 2016-01-08 13:40 +0100
  [PATCH v4.4-rc8 2/7] isdn: eicon: capifunc: Silence frame size warning tim.gardner@canonical.com - 2016-01-08 13:40 +0100
  [PATCH v4.4-rc8 6/7] isdn: eicon: diddfunc: Silence frame size warning tim.gardner@canonical.com - 2016-01-08 13:40 +0100
    Re: [PATCH v4.4-rc8 6/7] isdn: eicon: diddfunc: Silence frame size  warning Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2016-01-08 21:10 +0100
      Re: [PATCH v4.4-rc8 6/7] isdn: eicon: diddfunc: Silence frame size  warning Tim Gardner <tim.gardner@canonical.com> - 2016-01-08 23:20 +0100
        Re: [PATCH v4.4-rc8 6/7] isdn: eicon: diddfunc: Silence frame size  warning Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2016-01-08 23:30 +0100
  [PATCH v4.4-rc8 1/7] isdn: eicon: message: Silence frame size warning tim.gardner@canonical.com - 2016-01-08 13:40 +0100
  [PATCH v4.4-rc8 3/7] isdn: eicon: idifunc: Silence frame size warning tim.gardner@canonical.com - 2016-01-08 13:40 +0100
  [PATCH v4.4-rc8 7/7] isdn: eicon: consolidate descriptor allocation tim.gardner@canonical.com - 2016-01-08 13:40 +0100
  Re: [PATCH v4.4-rc8 0/7] isdn: eicon: Silence frame size warnings David Miller <davem@davemloft.net> - 2016-01-11 05:00 +0100

csiph-web