<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 2, 2015 at 11:26 AM, Bas Peters <span dir="ltr"><<a href="mailto:baspeters93@gmail.com" target="_blank">baspeters93@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I was checking some code in drivers/isdn/isdn_pp and came across the following:<br>
<br>
case PPP_VJC_COMP:<br>
if (is->debug & 0x20)<br>
printk(KERN_DEBUG "isdn_ppp: VJC_COMP\n");<br>
{<br>
struct sk_buff *skb_old = skb;<br>
int pkt_len;<br>
skb = dev_alloc_skb(skb_old->len + 128);<br>
<br>
if (!skb) {<br>
printk(KERN_WARNING "%s: Memory squeeze, dropping packet.\n", dev->name);<br>
skb = skb_old;<br>
goto drop_packet;<br>
}<br>
skb_put(skb, skb_old->len + 128);<br>
skb_copy_from_linear_data(skb_old, skb->data,<br>
skb_old->len);<br>
if (net_dev->local->ppp_slot < 0) {<br>
printk(KERN_ERR "%s: net_dev->local->ppp_slot(%d) out of range\n",<br>
__func__, net_dev->local->ppp_slot);<br>
goto drop_packet;<br>
}<br>
pkt_len = slhc_uncompress(ippp_table[net_dev->local->ppp_slot]->slcomp,<br>
skb->data, skb_old->len);<br>
kfree_skb(skb_old);<br>
if (pkt_len < 0)<br>
goto drop_packet;<br>
<br>
skb_trim(skb, pkt_len);<br>
skb->protocol = htons(ETH_P_IP);<br>
}<br>
break;<br>
<br>
Could you explain to me why there are braces AFTER the printk invocation? Was it perhaps intended that the printk was included in the braces?<br></blockquote><div>I think it is intended and in my opinion it is because he didn't want to declare</div><div>the local variables at the beginning of the function. He probably wanted</div><div>that piece of code which is inside the braces as standalone.</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I'm sorry if I'm missing something completely obvious here, but it seems kind of strange to me.<br>
<br>
With kind regards,<br>
<br>
Bas<br>
<br>
_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
</blockquote></div><br></div></div>