<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">&lt;<a href="mailto:baspeters93@gmail.com" target="_blank">baspeters93@gmail.com</a>&gt;</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-&gt;debug &amp; 0x20)<br>
                        printk(KERN_DEBUG &quot;isdn_ppp: VJC_COMP\n&quot;);<br>
                {<br>
                        struct sk_buff *skb_old = skb;<br>
                        int pkt_len;<br>
                        skb = dev_alloc_skb(skb_old-&gt;len + 128);<br>
<br>
                        if (!skb) {<br>
                                printk(KERN_WARNING &quot;%s: Memory squeeze, dropping packet.\n&quot;, dev-&gt;name);<br>
                                skb = skb_old;<br>
                                goto drop_packet;<br>
                        }<br>
                        skb_put(skb, skb_old-&gt;len + 128);<br>
                        skb_copy_from_linear_data(skb_old, skb-&gt;data,<br>
                                                  skb_old-&gt;len);<br>
                        if (net_dev-&gt;local-&gt;ppp_slot &lt; 0) {<br>
                                printk(KERN_ERR &quot;%s: net_dev-&gt;local-&gt;ppp_slot(%d) out of range\n&quot;,<br>
                                       __func__, net_dev-&gt;local-&gt;ppp_slot);<br>
                                goto drop_packet;<br>
                        }<br>
                        pkt_len = slhc_uncompress(ippp_table[net_dev-&gt;local-&gt;ppp_slot]-&gt;slcomp,<br>
                                                  skb-&gt;data, skb_old-&gt;len);<br>
                        kfree_skb(skb_old);<br>
                        if (pkt_len &lt; 0)<br>
                                goto drop_packet;<br>
<br>
                        skb_trim(skb, pkt_len);<br>
                        skb-&gt;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&#39;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&#39;m sorry if I&#39;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>