From patchwork Tue Nov 15 19:00:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Martin KaFai Lau X-Patchwork-Id: 695202 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3tJHNj3x4jz9t0J for ; Wed, 16 Nov 2016 06:23:17 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=fb.com header.i=@fb.com header.b="WAwBroZw"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754369AbcKOTXN (ORCPT ); Tue, 15 Nov 2016 14:23:13 -0500 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:43665 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751633AbcKOTXL (ORCPT ); Tue, 15 Nov 2016 14:23:11 -0500 Received: from pps.filterd (m0001303.ppops.net [127.0.0.1]) by m0001303.ppops.net (8.16.0.17/8.16.0.17) with SMTP id uAFJLGuS014007 for ; Tue, 15 Nov 2016 11:23:10 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fb.com; h=from : to : cc : subject : date : message-id : mime-version : content-type : content-transfer-encoding; s=facebook; bh=iKDKq4g+r7sptlnUEEA36GjZl1lCDf0lm98cXo75JQc=; b=WAwBroZwC4KcDvRrU7kY4D2/Jh7F4kel//UPfD44ujp40TvMAqLXfoxJfPaNpCQ5uqwM Zl4uJwCkrjRNXUxbD4mV1sVLst4pqBLzXpwebTnGUwiOAvCVn7joHf92izTSSCH2WA4W onqcv9JzBY0OjF1u5z9Ss9QNFlVGBDPb25A= Received: from mail.thefacebook.com ([199.201.64.23]) by m0001303.ppops.net with ESMTP id 26r7d3ggdt-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Tue, 15 Nov 2016 11:23:10 -0800 Received: from mx-out.facebook.com (192.168.52.123) by PRN-CHUB05.TheFacebook.com (192.168.16.15) with Microsoft SMTP Server (TLS) id 14.3.294.0; Tue, 15 Nov 2016 11:23:09 -0800 Received: from facebook.com (2401:db00:11:d0a6:face:0:33:0) by mx-out.facebook.com (10.212.232.63) with ESMTP id b855e61cab6511e681920002c992ebde-631fca50 for ; Tue, 15 Nov 2016 11:00:05 -0800 Received: by devbig298.prn1.facebook.com (Postfix, from userid 6611) id C13F94BA092F; Tue, 15 Nov 2016 11:00:04 -0800 (PST) From: Martin KaFai Lau To: , David Miller CC: Alexei Starovoitov , Daniel Borkmann , Kernel Team Subject: [PATCH net-next] bpf: Fix compilation warning in __bpf_lru_list_rotate_inactive Date: Tue, 15 Nov 2016 11:00:04 -0800 Message-ID: <1479236404-3906780-1-git-send-email-kafai@fb.com> X-Mailer: git-send-email 2.5.1 MIME-Version: 1.0 X-FB-Internal: Safe X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-11-15_06:, , signatures=0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org gcc-6.2.1 gives the following warning: kernel/bpf/bpf_lru_list.c: In function ‘__bpf_lru_list_rotate_inactive.isra.3’: kernel/bpf/bpf_lru_list.c:201:28: warning: ‘next’ may be used uninitialized in this function [-Wmaybe-uninitialized] The "next" is currently initialized in the while() loop which must have >=1 iterations. This patch initializes next to get rid of the compiler warning. Fixes: 3a08c2fd7634 ("bpf: LRU List") Reported-by: David Miller Signed-off-by: Martin KaFai Lau Acked-by: Alexei Starovoitov --- kernel/bpf/bpf_lru_list.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/bpf/bpf_lru_list.c b/kernel/bpf/bpf_lru_list.c index bfebff0..89b7ef4 100644 --- a/kernel/bpf/bpf_lru_list.c +++ b/kernel/bpf/bpf_lru_list.c @@ -170,7 +170,7 @@ static void __bpf_lru_list_rotate_inactive(struct bpf_lru *lru, struct bpf_lru_list *l) { struct list_head *inactive = &l->lists[BPF_LRU_LIST_T_INACTIVE]; - struct list_head *cur, *next, *last; + struct list_head *cur, *last, *next = inactive; struct bpf_lru_node *node; unsigned int i = 0;