From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932132AbdJPTWI (ORCPT ); Mon, 16 Oct 2017 15:22:08 -0400 Received: from mail.sigma-star.at ([95.130.255.111]:45996 "EHLO mail.sigma-star.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754168AbdJPTWG (ORCPT ); Mon, 16 Oct 2017 15:22:06 -0400 From: Richard Weinberger To: Daniel Borkmann Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, ast@kernel.org Subject: Re: [PATCH 2/3] bpf: Remove dead variable Date: Mon, 16 Oct 2017 21:22:42 +0200 Message-ID: <2869131.K5Z6hvSGBl@blindfold> In-Reply-To: <59E50473.7040609@iogearbox.net> References: <20171016181856.12497-1-richard@nod.at> <2297422.9nBBslcvMo@blindfold> <59E50473.7040609@iogearbox.net> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Montag, 16. Oktober 2017, 21:11:47 CEST schrieb Daniel Borkmann: > > I can squash it into 1/3, I kept it that way because > > even without 1/3 this variable is unused. > > Hmm, the helper looks like the below. In patch 1/3 you removed > the 'if (unlikely(!task))' test where the variable was used before, > so 2/3 without the 1/3 would result in a compile error. Why a compile error? It emits a warning. > BPF_CALL_0(bpf_get_current_uid_gid) > { > struct task_struct *task = current; > kuid_t uid; > kgid_t gid; > > if (unlikely(!task)) > return -EINVAL; Well, this is the only "user". Okay. > current_uid_gid(&uid, &gid); Here we use current. So, task was always in vain. So, I can happily squash 2/3 into 1/3 and resent. The series just represented the way I've worked on the code... Thanks, //richard