Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3259833pxv; Mon, 12 Jul 2021 13:07:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxE6mOfkTmKNAznVprye0XXYaNt09lAnR+72owJTSwNy7peokTN33RpDmtUIjr9eWsJB5uH X-Received: by 2002:a05:6e02:c73:: with SMTP id f19mr368839ilj.291.1626120436609; Mon, 12 Jul 2021 13:07:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626120436; cv=none; d=google.com; s=arc-20160816; b=hqyk8yRLAjBfYGvj3cBVnOuACTHh1k5j6a8TQD0xb5Ed9P041m9nKLypRAy8glBOKT 1X7nVgJY8WSGY/4S1zQSCHxVrCLtj4QxfusNxxHWNYCG2KGJh+wXj/0Q+JGTLPdMZBi9 pm4cJ9RT53MZKJqu17qZUhmrHrYuARDfHicNm/jhsJXdCxny3qeyEdmvGa3ZcW/NjFji QcJJAKqyY8rOoXuvNoeL32HCKKgXNVmzajdzNkV+XP+C2T5kL9tJPfPrWY7v0M4bHVZ9 V67QMPIgDt8Wkewy3ddNacEfmHsBFVkuDobTgv0TXj97p33P2GWUbrh5dFH9ZYvf6exX 3w4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=gFiQIMdbMlGiV4kNbAs8pfFngiJ6QhnK3Hudjk2XiOU=; b=ipCkdN1InzTIELC1wo0XoRzRyD2SVnFPt2EZTblUKdN+eRzxh6fya24zDC7MoDgaKa 893Gpl/lKrNF64eesbu17Xq9G0u4V9M5HGLztHFAy/k9nMvZeevxu7KOFxCz0DUiDB6o PQqoh8Lpal8He+vmkklOlgMmxh7zXzRN6EXmP5NCf+VXZnAdjt5usUjqA8hgJ0TJ6tSR QYRi1cR16H/oHJSY9aHzHzKjCxQgZURi+jI1EbHrFsVYNvgUr2Dk8abet4LLys0vY18c ioYDc5gs7s/Uj4gz1inFhn0OQn5v1/jwvg6vqbrBE729bVGNZqSzsMCdlNLD/ijyOKKA fXnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@networkplumber-org.20150623.gappssmtp.com header.s=20150623 header.b=SK++E2Zr; 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 l14si19804390jah.73.2021.07.12.13.07.04; Mon, 12 Jul 2021 13:07:16 -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=@networkplumber-org.20150623.gappssmtp.com header.s=20150623 header.b=SK++E2Zr; 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 S236668AbhGLUIN (ORCPT + 99 others); Mon, 12 Jul 2021 16:08:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231693AbhGLUIM (ORCPT ); Mon, 12 Jul 2021 16:08:12 -0400 Received: from mail-pg1-x533.google.com (mail-pg1-x533.google.com [IPv6:2607:f8b0:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25B06C0613DD for ; Mon, 12 Jul 2021 13:05:24 -0700 (PDT) Received: by mail-pg1-x533.google.com with SMTP id s18so19459587pgg.8 for ; Mon, 12 Jul 2021 13:05:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gFiQIMdbMlGiV4kNbAs8pfFngiJ6QhnK3Hudjk2XiOU=; b=SK++E2Zrabb9y24MNbsqgpf5V9FrMpggUlk9wC5vd7xfg1lLfLcJKNzdWVFHmIVrxM +MBMMeIz4XkqO2EKkpXz04sPF+JQ7je9mpilzkCKfS8n3j4lDqgAtfcArwbycRCv+IzH bbGykPzDaHBAogdGlGSv8CyULO7rjGUookBWyZBmaYv+nO3qWoYyX6lOrYCgKbdkt7d3 F85DFhO/zv3Malp4LqnML+D8Y18E2MECcss5TZjHFGPZVLoOvydbWe+2uhT+4J4q/T4U mdCyLOX2eDX5AcNcag1QkW1p9cx3f2GgI4yzIrDlfeC7y7zDpr2+3xd+WdQilqYjsnYG NOsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gFiQIMdbMlGiV4kNbAs8pfFngiJ6QhnK3Hudjk2XiOU=; b=iotwlzzZnAUu0pfxN4gnDnB6fSpJILVU/2vghTTdfAr4Zp6Pz9fnPaJ57l5vFA77eu 2JUdBV40anPdR+GddNoteC7jIkNKjxeKwoo4Sbov2ZUuWAH8Z2O+Jncn/be/W+Dqw+7A SQJUbnY8/BgO6w+DcXdRH0VTTg0uvmOxYJifdamX9vdWcdB0ghAalUDIAKhypaIFPyGq zuJz0kCP7tMAENjytMOZP2uBx7PrGtmaKafJeUY1b4oaYnm0igJiGWupX1AhgFY5oqCw ZfhQ7oIsMKKfWTAA6cabzEnqoLI/MH3RvClDIfdtm3objG+us1bAVCBuwKFiCEMgh1fs R0bg== X-Gm-Message-State: AOAM53133GHP7FiuT/0nHBNq7hEH0jaPbw5WXWSU1LoDP6J230pX8DgW 7Hbc3Qs8jg0QchB1zukmat5jzQ== X-Received: by 2002:a62:442:0:b029:31d:2e52:f1c4 with SMTP id 63-20020a6204420000b029031d2e52f1c4mr772777pfe.14.1626120323694; Mon, 12 Jul 2021 13:05:23 -0700 (PDT) Received: from hermes.local (204-195-33-123.wavecable.com. [204.195.33.123]) by smtp.gmail.com with ESMTPSA id fv8sm14557493pjb.21.2021.07.12.13.05.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jul 2021 13:05:23 -0700 (PDT) Date: Mon, 12 Jul 2021 13:05:20 -0700 From: Stephen Hemminger To: Salah Triki Cc: kevin.curtis@farsite.co.uk, davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] replace for loop with array initializer Message-ID: <20210712130520.748b6e3a@hermes.local> In-Reply-To: <20210712192450.GA1153790@pc> References: <20210712192450.GA1153790@pc> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 12 Jul 2021 20:24:50 +0100 Salah Triki wrote: > diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c > index b3466e084e84..a90d3b9a8170 100644 > --- a/drivers/net/wan/farsync.c > +++ b/drivers/net/wan/farsync.c > @@ -567,7 +567,7 @@ static void fst_process_int_work_q(struct tasklet_struct *unused); > static DECLARE_TASKLET(fst_tx_task, fst_process_tx_work_q); > static DECLARE_TASKLET(fst_int_task, fst_process_int_work_q); > > -static struct fst_card_info *fst_card_array[FST_MAX_CARDS]; > +static struct fst_card_info *fst_card_array[FST_MAX_CARDS] = { [0 ... FST_MAX_CARDS-1] = NULL }; Why bother, the default initialization in C is 0 (ie. NULL). In fact, checkpatch should complain about useless array initialization for this.