From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 19286C433F5 for ; Mon, 9 May 2022 16:49:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239393AbiEIQww (ORCPT ); Mon, 9 May 2022 12:52:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239382AbiEIQwr (ORCPT ); Mon, 9 May 2022 12:52:47 -0400 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A5E1239B18 for ; Mon, 9 May 2022 09:48:52 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id bu29so24892399lfb.0 for ; Mon, 09 May 2022 09:48:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ieee.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5g8PMEr0fUha/SOThrUTETc1ItXC2lJPUN9/NQxWRVg=; b=MTLQyColdjkZgneoiO2JCqBMXtCiy+AfIci1x5bN8m/pMI1K+N6mWUuJqIXJO485zB ckPvI6zubY6h6FFL90K0wOdEgJ+OYvs71xh7lZMNbvmpa+88N3wAmAbTRa7164xC4Wpn kPadB+F+/aVDf+cfcn3fiXl+O/FKqeSw7T34E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5g8PMEr0fUha/SOThrUTETc1ItXC2lJPUN9/NQxWRVg=; b=1SrxW00QeezklVOZSGfPm7Qrpb6zkeIHCUuy5ormB2Aoz8MVH4rK9/xgUt8DLHqGoI 2cQJDV0rgoRUriwW/GC3E0PN7idooRlb/5TSYpHNKjMgyMlWdOCgpn2nAtymVNWQzrb/ Zpm6OQm6HCl4DhA3v1HP/UzuerZxlhEr4VhM1dVXiqh/RennqjAKHVBn48v3//aVAh6B x9CtLGGPm1TE632RffKaWd6XNCDTAk/cwWYp2feCU61yviodL5L05vgrHl/uAvl4b5+Y PKUb8/BRhytxR4L+aF2THk0WrsuA09Rq9OP2+OohBJ2FT3uw5AO5UI8OW3cs3rlOvc8L VtfQ== X-Gm-Message-State: AOAM531IJS9HcCzcFM/W94GKx6dg15QyI4GyXy23w+2UWCLB84P7fm9Y fV0ebuS6G7edRpp9sIRcdNyI+aEw50XabmObv664pg== X-Google-Smtp-Source: ABdhPJwPo5JqWbaAlLxvMlGR2NliI+YODauqw3FDoQdF3n9yPSWsygJ1qVypKeLMyEtd6+ld8sdQSlHGmbJqcJBBw/c= X-Received: by 2002:a05:6512:2313:b0:473:a307:b1ee with SMTP id o19-20020a056512231300b00473a307b1eemr13201763lfu.159.1652114930854; Mon, 09 May 2022 09:48:50 -0700 (PDT) MIME-Version: 1.0 References: <20220508214500.60446-1-colin.i.king@gmail.com> <20220509124427.GG4009@kadam> In-Reply-To: <20220509124427.GG4009@kadam> From: Ozgur Date: Mon, 9 May 2022 20:48:39 +0400 Message-ID: Subject: Re: [PATCH] x25: remove redundant pointer dev To: Dan Carpenter Cc: Colin Ian King , Martin Schiller , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-x25@vger.kernel.org, netdev@vger.kernel.org, kernel-janitors@vger.kernel.org, lkml Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 9, 2022 at 4:44 PM Dan Carpenter wrote: > > On Mon, May 09, 2022 at 04:57:40AM +0400, Ozgur wrote: > > On Mon, May 9, 2022 at 1:45 AM Colin Ian King wrote: > > > > > > Pointer dev is being assigned a value that is never used, the assignment > > > and the variable are redundant and can be removed. Also replace null check > > > with the preferred !ptr idiom. > > > > > > > Hello, > > > > *dev pointer is device assign global linked list and shouldnt be > > touched by the driver so *dev wont get any value right? > > Why are you talking about "*dev" instead of "dev"? > Hi Dan, I just realized this, i thought dev was necessary for launch functions device and to activate. if carries this with x25, dev is useless I understand. > > Also seems to use this while network interface is initializing because > > some activation information and stats information is also kept here, > > for example, open *dev will call when ifconfig is called from. > > > > route, link, forward these inital activate and move all values with > > net_device *dev? > > It's not clear what you are saying... > > When I review these kinds of patches I ask: > 1) Does Colin's patch change run time behavior? Obviosly not. > 2) Is the current code buggy? Sometimes when there is a static checker > warning it indicates a typo in the code. I do not see a bug in the > original code before Colin's patch. > 3) What was the author's original intent? This code predates git but > I think the "dev" was just a going to be a shorter name to type than > "x25->neighbour->dev". Actually i thought similarly because when this patch remove dev from i thought would depend on other source code whose x25 interface will be implemented are not ready. I thought any x25 interface or x25route was using it. > I honestly have no idea what you are saying. At first I thought you > might be saying that this is stub code. But that seems wrong. Also we > do not allow stub code in the kernel. thanks for enlightening, Regards > regards, > dan carpenter > -- Ozgur Kara Linux Kernel Developer ozgurk@ieee.org