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 X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 36A32C6778A for ; Tue, 3 Jul 2018 15:55:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D010122B72 for ; Tue, 3 Jul 2018 15:55:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D010122B72 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=perches.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933502AbeGCPzp (ORCPT ); Tue, 3 Jul 2018 11:55:45 -0400 Received: from smtprelay0161.hostedemail.com ([216.40.44.161]:52306 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932234AbeGCPzn (ORCPT ); Tue, 3 Jul 2018 11:55:43 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay03.hostedemail.com (Postfix) with ESMTP id EAB02837F27F; Tue, 3 Jul 2018 15:55:42 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: jump16_31b79732acd36 X-Filterd-Recvd-Size: 2497 Received: from XPS-9350.home (unknown [47.151.153.53]) (Authenticated sender: joe@perches.com) by omf07.hostedemail.com (Postfix) with ESMTPA; Tue, 3 Jul 2018 15:55:41 +0000 (UTC) Message-ID: Subject: Re: [PATCH] iommu/amd: fix missing tag from dev_err message From: Joe Perches To: Gary R Hook , Colin King , Joerg Roedel , iommu@lists.linux-foundation.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Date: Tue, 03 Jul 2018 08:55:40 -0700 In-Reply-To: References: <20180703064005.18908-1-colin.king@canonical.com> <6763ec382f8d629f5f356f4cc023f20c2f76b26a.camel@perches.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.28.1-2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2018-07-03 at 07:56 -0500, Gary R Hook wrote: > On 07/03/2018 05:07 AM, Joe Perches wrote: > > On Tue, 2018-07-03 at 07:40 +0100, Colin King wrote: > > > Currently tag is being assigned but not used, it is missing from > > > the dev_err message, so add it in. > > > > > > Cleans up clang warning: > > > warning: variable 'tag' set but not used [-Wunused-but-set-variable] > > > > [] > > > diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c > > > > [] > > > @@ -616,9 +616,9 @@ static void iommu_print_event(struct amd_iommu *iommu, void *__evt) > > > pasid = ((event[0] >> 16) & 0xFFFF) > > > | ((event[1] << 6) & 0xF0000); > > > tag = event[1] & 0x03FF; > > > - dev_err(dev, "INVALID_PPR_REQUEST device=%02x:%02x.%x pasid=0x%05x address=0x%016llx flags=0x%04x]\n", > > > + dev_err(dev, "INVALID_PPR_REQUEST device=%02x:%02x.%x pasid=0x%05x address=0x%016llx flags=0x%04x tag=0x%03x]\n", > > > PCI_BUS_NUM(devid), PCI_SLOT(devid), PCI_FUNC(devid), > > > - pasid, address, flags); > > > + pasid, address, flags, tag); > > > > Seems to have a superfluous ] that should be removed. > > Yeah, I pretty much messed up all of the log messages in that function. > My apologies. I'll create a patch for that problem; it shouldn't be > fixed here. I also wonder why event is declared volatile and then dereferenced with [] multiple times. Maybe each array dereference should be stored as a local variable instead.