[SLIP]: Simplify sl_free_bufs()

We can avoid assignments to the local variable 'tmp' and
actually get rid of tmp alltogether in sl_free_bufs(). This patch does
that. This is safe since both kfree() and slhc_free() handles NULL
pointers gracefully.

Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by Jesper Juhl and committed by David S. Miller 9b200b02 d675c989

+4 -10
+4 -10
drivers/net/slip.c
··· 198 static void 199 sl_free_bufs(struct slip *sl) 200 { 201 - void * tmp; 202 - 203 /* Free all SLIP frame buffers. */ 204 - tmp = xchg(&sl->rbuff, NULL); 205 - kfree(tmp); 206 - tmp = xchg(&sl->xbuff, NULL); 207 - kfree(tmp); 208 #ifdef SL_INCLUDE_CSLIP 209 - tmp = xchg(&sl->cbuff, NULL); 210 - kfree(tmp); 211 - if ((tmp = xchg(&sl->slcomp, NULL)) != NULL) 212 - slhc_free(tmp); 213 #endif 214 } 215
··· 198 static void 199 sl_free_bufs(struct slip *sl) 200 { 201 /* Free all SLIP frame buffers. */ 202 + kfree(xchg(&sl->rbuff, NULL)); 203 + kfree(xchg(&sl->xbuff, NULL)); 204 #ifdef SL_INCLUDE_CSLIP 205 + kfree(xchg(&sl->cbuff, NULL)); 206 + slhc_free(xchg(&sl->slcomp, NULL)); 207 #endif 208 } 209