Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp3228970pxb; Tue, 13 Apr 2021 23:42:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5jRvY3eMyLrWcsI9qItWGnkVSFWz4g6gtpF1O6XzMudzenOI9rpvKH0WyI0DEsJ1C+FWe X-Received: by 2002:a50:cdd1:: with SMTP id h17mr39025283edj.178.1618382575827; Tue, 13 Apr 2021 23:42:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618382575; cv=none; d=google.com; s=arc-20160816; b=GbrjMzpouOA75rVlQm48Zh5ko3VGy6m821k+FBlJRDC6rKZJECyZZJbCF7eUCqohj0 EkEmTyS1FgB/uxwML1jQADDb0eviRUTTIC3ZBVddd+sn8BEheOn+Le3hj5cuxHoC9iCC UL41eYB7OYpwUrcTvXRFqiD2M/8EdCfWp3kWKGKPeavZ0nwLX1jwg4TNviKzZI9wgJjh xKtrcMcjmXgvt5v18ryTy+13XcjMDZpd4AyGzsR9DC0m7/zIY5Rnq3MLg9GHAr2PUehg qjpg+XCu6V8EyyQ2YZO+B+pF6jYSnbNtytXYx2oe99RFYwwIlGKjN9yuKyv1Wo+PT8bP jRJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=nbcw4udwhbGZK1KxJG3rMK3oFZk6fMlWAAr8sT0AiFg=; b=l+88qpmGHCmbuZQSRZnD212xJfrbbhlsnnHe7y77uj+/i0Mjtws8CkuCGphEZpdlNE OJdch+SjjdUlx9qEyu1okEQPO1/CcTVE+yUHrGzbaJ5yhb5QndyXY1IamlTblPlG6Wau cD/O5L1gr9ecqT14nphModLQD390Uk2fTcXXa7PIRmyoW0yfr/Tw1PCfaPwOZfMk1gmy 1DgLgXEsdxU0OUtisOy+m48ngjYrHy6rat94nDd/3sTlulpkWaI4rkvDxvKi5MIhgOD8 IVwBxRgYpIJu20Bq5PKihhQ/fpF3wQNsv3vrOB6rx5iDUvrpPXeq1kXVoA0pDCpcLAiq LzQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=qdyXvIjy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dy26si11444185edb.174.2021.04.13.23.42.32; Tue, 13 Apr 2021 23:42:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=qdyXvIjy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231625AbhDMTti (ORCPT + 99 others); Tue, 13 Apr 2021 15:49:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229796AbhDMTth (ORCPT ); Tue, 13 Apr 2021 15:49:37 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B75A2C061574 for ; Tue, 13 Apr 2021 12:49:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=nbcw4udwhbGZK1KxJG3rMK3oFZk6fMlWAAr8sT0AiFg=; b=qdyXvIjyqBvlpBNt/ry9bySb5R SPRLhCOYGcLYrkePQ0JVs+3n80ANCv9IkeaLafifcOjUkmLdvN3+8mqbOGCo/X28I5H/Zk8liKa18 jAraWVwhpjf/I42ZViXzJ/GvacHje0ei9bpch4pUKOBNnZ++qGmZxtIwjeNuB6dHdH+ka+7QuEhNd RhyCVLBfCdX4H6VE9vrnuM+CKHPdBGUQzCnnbods8UIrTPRIWr4fTCBOtGYCdbfy+f3JBYlXicrVZ Pba4ujJv8XNbIreHWgpQVNppvIfdSRMi3m+efGSqW0SbGhY5nMKT23qHpNswMv0ERnEJmQ7rztHH4 AG0IgAZQ==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lWP1g-006BMB-RN; Tue, 13 Apr 2021 19:48:48 +0000 Date: Tue, 13 Apr 2021 20:48:44 +0100 From: Matthew Wilcox To: "Fabio M. De Francesco" Cc: Julia Lawall , Dan Carpenter , outreachy-kernel@googlegroups.com, Greg Kroah-Hartman , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [Outreachy kernel] [PATCH] :staging: rtl8723bs: Remove useless led_blink_hdl() Message-ID: <20210413194844.GR2531743@casper.infradead.org> References: <20210413155908.8691-1-fmdefrancesco@gmail.com> <2400087.QbMOWSuNhY@linux.local> <7008359.Jy8utYDuns@linux.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7008359.Jy8utYDuns@linux.local> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 13, 2021 at 09:45:03PM +0200, Fabio M. De Francesco wrote: > 1) The driver doesn't call that function from anywhere else than the macro. > 2) You have explained that the macro add its symbol to a slot in an array > that would shift all the subsequent elements down if that macro is not used > exactly in the line where it is. > 3) Dan Carpenter said that that array is full of null functions (or empty > slots?). > > Unless that function is called anonymously dereferencing its address from > the position it occupies in the array, I'm not able to see what else means > can any caller use. > > I know I have much less experience than you with C: what can go wrong? Here's where the driver calls that function: $ git grep wlancmds drivers/staging/rtl8723bs/ drivers/staging/rtl8723bs/core/rtw_cmd.c:static struct cmd_hdl wlancmds[] = { drivers/staging/rtl8723bs/core/rtw_cmd.c: if (pcmd->cmdcode < ARRAY_SIZE(wlancmds)) { drivers/staging/rtl8723bs/core/rtw_cmd.c: cmd_hdl = wlancmds[pcmd->cmdcode].h2cfuns;