Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp529169pxk; Wed, 2 Sep 2020 08:04:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+x2RSPAGFi03m8kOUOoeq5gyA10YVVxAcKa+cogpp2+v5l/k9iV6pleoFrdflv1u5LLce X-Received: by 2002:aa7:db89:: with SMTP id u9mr440122edt.267.1599059080030; Wed, 02 Sep 2020 08:04:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599059080; cv=none; d=google.com; s=arc-20160816; b=PBj8Xki8K6P/P3zqB/TuodSupyqgTvAGc/iWJjgRDI2mKOc8Gb1C1fhyvuvy+PsS5x KlbDFQUu/b2xrozpMr3oQQ5o0J9TpM2b6lgZ6BWCd8gNjtdl4OG6yJo41PW4DMK6GAVR K8AixOfo4+LB5+htwOQfIaIkSEa1sDl5Gp/BZmEzhyothLPhAKDZ+3DsgcnT5uQDanbA PveAc96GxXUHCE3zs9iyr77HDWQBv6W1+mC01GTg1+wsDAOjL5oIBdLlpDmZn6ikl0hc Md7QzOmNq3Kkkjcz3n+8zIiwj9Qr/4v6If6Pg92ZlN9OqwY9hJlvY9k2dYzcZ1Ef3M8U PJSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:date:from:dkim-signature; bh=4dcRwjz1s1csX6AJeRsJaJoQkhF+IffbkvIIRG1ifvo=; b=vbp6yYPARizmUq+yV4cZxercrhWTScnZbgx6kXNiH1RzncQLYpEa9UISfAkAQh237v 6Gx+oCSQ7d8s6bVONajrf+RcMVuKQrHr7tS9WTp98CFqJisz1Stj5tINFC6usDEIHqJX NrgpMeWriqVjeFbxI1tHkukjNxzyskGg9oQzKcYErHMX+tPTKSA2zPSlw904B0pq4Fjf 4s/8n73tE/qqjQCRHysOz9dRbkkCdjsOn0q2qNs6veZmFRJIiviShVyLUr6fAKbxJOan B8+W9FhbITOtP8+rWcGX3OWxFI0N2GKaZIdVVQd4NhZAoxWMKgMYfEB66m4gqS+kZm+/ EcBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GxNyzBhm; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r15si2606511ejx.326.2020.09.02.08.04.14; Wed, 02 Sep 2020 08:04:40 -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=@gmail.com header.s=20161025 header.b=GxNyzBhm; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726938AbgIBO5w (ORCPT + 99 others); Wed, 2 Sep 2020 10:57:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726400AbgIBOAJ (ORCPT ); Wed, 2 Sep 2020 10:00:09 -0400 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 303C4C061245; Wed, 2 Sep 2020 07:00:06 -0700 (PDT) Received: by mail-pj1-x1041.google.com with SMTP id ls14so2383720pjb.3; Wed, 02 Sep 2020 07:00:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=4dcRwjz1s1csX6AJeRsJaJoQkhF+IffbkvIIRG1ifvo=; b=GxNyzBhmbUbco22yiPt89zB0uDIK5sv/wJtKrrZQZKYJYir5JrZI+VujGdPxpnrncU MSE8jSu+n5w1xqLilKadjA8pGGHPFmrQIy4aivBmKA/WqhP1S5iXGxIEObGvQEx5uSlF mOJldA+0y1jmqZ7A84vJdCG/MWIvbxlvqrni2aGpxpC6ukzEPFblx+GHDlFP2Y1Q0/SO H25Wfovg6NZC+o2jE4XGNmE0ZCZUfd9s90s/R8XDKaywrWyouOpaCSLMpa8y+6oH5bQs wjZdKSKBPtUx+g/lQAid6UaK1B8wGAxn2OynHDYHEPpotx2S96ENktBTrmBDKW3hADFN vJtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=4dcRwjz1s1csX6AJeRsJaJoQkhF+IffbkvIIRG1ifvo=; b=JfqVZrYrFwLjoceiQ35LUFJ9cZ8DLJrO6fMYHaUgPwZUs+exw6LSxGajxl6kE4YWHJ 3UhlGk/EOvIl0ez+5h7dow2n5UnxVfZdZtHWX9iiEkb/+IHqam67CE1plJ11isSA3drU XtCOblOCRarPiuWB2LVRoxodHjxE7Mk6DBcV87xWenGTlG7sB71Xc/AcmOKS9Nfx/eDA 5XxaXbRlDfNmBmxkaqq2Fj/kSxiOU8siDXmLQHITkVy1sk3deWb7K1X0GRIlvf3Orgt7 FuF4cOgltUn6lqAf8D6tjMcEds+ULDtM/yLDfz9TX2kv6FTaQEK8MGnHogN/b5DvnvQX FCRQ== X-Gm-Message-State: AOAM532M/wWawIeZEQTxFZuAlbhv70/EbarlwzlOeAPL0P0jNQHWSsaU Jp0pYeMIcT+E8CWpNlp0Xr4= X-Received: by 2002:a17:90a:d315:: with SMTP id p21mr2475624pju.88.1599055205640; Wed, 02 Sep 2020 07:00:05 -0700 (PDT) Received: from localhost ([2001:e42:102:1532:160:16:113:140]) by smtp.gmail.com with ESMTPSA id lb1sm4321084pjb.26.2020.09.02.07.00.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Sep 2020 07:00:05 -0700 (PDT) From: Coiby Xu X-Google-Original-From: Coiby Xu Date: Wed, 2 Sep 2020 22:00:00 +0800 To: Benjamin Poirier Cc: devel@driverdev.osuosl.org, Manish Chopra , "supporter:QLOGIC QLGE 10Gb ETHERNET DRIVER" , Greg Kroah-Hartman , Dan Carpenter , "open list:QLOGIC QLGE 10Gb ETHERNET DRIVER" , open list Subject: Re: [PATCH v2] staging: qlge: fix build breakage with dumping enabled Message-ID: <20200902140000.jcarw6eqryyergig@Rk> References: <20200826232735.104077-1-coiby.xu@gmail.com> <20200827005010.GA46897@f3> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200827005010.GA46897@f3> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 27, 2020 at 09:50:10AM +0900, Benjamin Poirier wrote: >On 2020-08-27 07:27 +0800, Coiby Xu wrote: >> This fixes commit 0107635e15ac >> ("staging: qlge: replace pr_err with netdev_err") which introduced an >> build breakage of missing `struct ql_adapter *qdev` for some functions >> and a warning of type mismatch with dumping enabled, i.e., >> >> $ make CFLAGS_MODULE="QL_ALL_DUMP=1 QL_OB_DUMP=1 QL_CB_DUMP=1 \ >> QL_IB_DUMP=1 QL_REG_DUMP=1 QL_DEV_DUMP=1" M=drivers/staging/qlge >> >> qlge_dbg.c: In function ‘ql_dump_ob_mac_rsp’: >> qlge_dbg.c:2051:13: error: ‘qdev’ undeclared (first use in this function); did you mean ‘cdev’? >> 2051 | netdev_err(qdev->ndev, "%s\n", __func__); >> | ^~~~ >> qlge_dbg.c: In function ‘ql_dump_routing_entries’: >> qlge_dbg.c:1435:10: warning: format ‘%s’ expects argument of type ‘char *’, but argument 3 has type ‘int’ [-Wformat=] >> 1435 | "%s: Routing Mask %d = 0x%.08x\n", >> | ~^ >> | | >> | char * >> | %d >> 1436 | i, value); >> | ~ >> | | >> | int >> qlge_dbg.c:1435:37: warning: format ‘%x’ expects a matching ‘unsigned int’ argument [-Wformat=] >> 1435 | "%s: Routing Mask %d = 0x%.08x\n", >> | ~~~~^ >> | | >> | unsigned int >> >> Fixes: 0107635e15ac ("staging: qlge: replace pr_err with netdev_err") >> Reported-by: Benjamin Poirier >> Suggested-by: Benjamin Poirier >> Signed-off-by: Coiby Xu >> --- >> drivers/staging/qlge/qlge.h | 20 ++++++++++---------- >> drivers/staging/qlge/qlge_dbg.c | 24 ++++++++++++++++++------ >> drivers/staging/qlge/qlge_main.c | 8 ++++---- >> 3 files changed, 32 insertions(+), 20 deletions(-) >> >[...] >> @@ -1632,6 +1635,8 @@ void ql_dump_wqicb(struct wqicb *wqicb) >> >> void ql_dump_tx_ring(struct tx_ring *tx_ring) >> { >> + struct ql_adapter *qdev = tx_ring->qdev; >> + >> if (!tx_ring) >> return; > >Given the null check for tx_ring, it seems unwise to dereference tx_ring >before the check. > >Looking at ql_dump_all(), I'm not sure that the check is needed at all >though. Maybe it should be removed. > >Same problem in ql_dump_rx_ring(). Thank you for the spotting this issue! I'll remove the check. > >> netdev_err(qdev->ndev, "===================== Dumping tx_ring %d ===============\n", >> @@ -1657,6 +1662,8 @@ void ql_dump_tx_ring(struct tx_ring *tx_ring) >> void ql_dump_ricb(struct ricb *ricb) >> { >> int i; >> + struct ql_adapter *qdev = >> + container_of(ricb, struct ql_adapter, ricb); > >Here, davem would point out that the variables are not declared in >"reverse xmas tree" order. I'll make davem happy then:) -- Best regards, Coiby