lkml.org 
[lkml]   [2015]   [Feb]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subjectcheckpatch: CHECK: No space is necessary after a cast
Date

Hi Joe,

we have come across a checkpatch false-positive:

>>>>
static void batadv_recv_handler_init(void)
{
int i;

for (i = 0; i < ARRAY_SIZE(batadv_rx_handler); i++)
batadv_rx_handler[i] = batadv_recv_unhandled_packet;

for (i = BATADV_UNICAST_MIN; i <= BATADV_UNICAST_MAX; i++)
batadv_rx_handler[i] = batadv_recv_unhandled_unicast_packet;

/* compile time checks for sizes */
BUILD_BUG_ON(sizeof(struct batadv_bla_claim_dst) != 6);
BUILD_BUG_ON(sizeof(struct batadv_ogm_packet) != 24);
BUILD_BUG_ON(sizeof(struct batadv_icmp_header) != 20);
..
}
<<<<<

The following warnings are triggered:

CHECK: No space is necessary after a cast
#440: FILE: main.c:440:
+ BUILD_BUG_ON(sizeof(struct batadv_bla_claim_dst) != 6);

CHECK: No space is necessary after a cast
#441: FILE: main.c:441:
+ BUILD_BUG_ON(sizeof(struct batadv_ogm_packet) != 24);

CHECK: No space is necessary after a cast
#442: FILE: main.c:442:
+ BUILD_BUG_ON(sizeof(struct batadv_icmp_header) != 20);

Can you make a suggestion / patch for checkpatch to better handle this case ?

Thanks,
Marek
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2015-02-19 07:01    [W:0.055 / U:2.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site