Received: by 10.213.65.68 with SMTP id h4csp479032imn; Tue, 13 Mar 2018 10:19:34 -0700 (PDT) X-Google-Smtp-Source: AG47ELu66kx8VtWwJ2Z3n4216DNuMQA+kli2RzGaYszkH5y1r62BylEla1gQLVJnwbEZgDR1liiT X-Received: by 10.98.196.199 with SMTP id h68mr1346553pfk.42.1520961574381; Tue, 13 Mar 2018 10:19:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520961574; cv=none; d=google.com; s=arc-20160816; b=tOrHh1ioAAQIUpzml4qHKxguBkgtrvUla+Wxg6xWc3beKx8kP81o51bJRv+WxHl+zx wjLIxuy5sQrKtWAb+RfGX4MK4KTTtaCyZelBPJ0+vog0yi72U7Y3lIJtV88Rr1IhGsez e7YP4neoZZEhXE6ZEIVw6lL2n764LOjmD9VT8FOW6QSKjg7p8p3x2U/sA9j3cGOT+mAH PeXziwBrYEprUUHHET9bIHfwrO67/9LdRnzOioSN6X54LFoRtHO266IoulHe7uZW+EUe p6z6sJGKDCG8+gdvdtSV7byCc/p3xPMvXCn0heM27uqMO+furdQh13yPfPYujyErvoor o3wQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=gZtUPLFDc4knnENLcczM4SPYsbFVesTWiEA+6VbIvq8=; b=JGRwXbGl326qAYz3Y4t+VpN1jKAb1o0iiyM2P9YDCAEmcfAK92/6/La30mvXnpaEQJ S67wME7YFjIFKCuixQ+UMLLCM68sFyjGQU8Imom985yciTkODPQ8dfd0fxiOkjPo0nd1 sE9at3YNLi8Ma2THdA6NvgCJpMYPxeNHzRDGYx0tepa0/9bWVBU9imW3pZkywqvDenFL PHa95vjHaq3qbSna/ds8fcVr3OOdiJizK9Qqnn4MlnZQOCeZ4sTscLo9rtH2COc76JSg 9FhDHtrY8cdvk2RlgnzNm0+OFrVUlBG6rNsY4IPOV8xlhNxCu3n/U1s4IQqsvAvzmIvP HXKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BTCMJhgj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id f1si382471pgr.761.2018.03.13.10.19.19; Tue, 13 Mar 2018 10:19:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BTCMJhgj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1752455AbeCMRQv (ORCPT + 99 others); Tue, 13 Mar 2018 13:16:51 -0400 Received: from mail-qt0-f173.google.com ([209.85.216.173]:35678 "EHLO mail-qt0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751362AbeCMRQp (ORCPT ); Tue, 13 Mar 2018 13:16:45 -0400 Received: by mail-qt0-f173.google.com with SMTP id z14so419590qti.2 for ; Tue, 13 Mar 2018 10:16:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=gZtUPLFDc4knnENLcczM4SPYsbFVesTWiEA+6VbIvq8=; b=BTCMJhgjAaa6bzoZZMtG4GzFqHpFryAWlstXWXGyeOI+C5S9RLEYE8enDJ2K7P3L0Y Nff3wRTjgsLBJxEnRvPZKB+8nmELNvosj9uUajTos3U0sb34GK4YtaWZpbEl3lpj1cVe wJw4h2ZolleT4wrMWf25oWLKJ+9/JiWWO9AQLYv9/x55yRNB2iC7/JtCsgIELePEes+H MkbAsJbrV91q1mTtqVHdsdwzzrcFaMcqlYCJYcuYPq+KTzjXVgB7w2SjSDfsr0fyQ04P CIuMDAOdR/SF3Wo2RuoJTww7k6nFk6U7GopI2HkOxAGojZdaevcN99hp6zrFwWCqP8xI D+Zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=gZtUPLFDc4knnENLcczM4SPYsbFVesTWiEA+6VbIvq8=; b=kImTbxI/PzbqLQ4vhX9jrQBjOAKo3CYcy3bIqrbDLS0EJqui5LG77dB6x6O6K0UQ88 VLC4cFAwB8y+HbAbCQcUxouGQ8fKjWZElQ5PZPDzZd+JWHyK3uHZR3e7H9zW9Nvl6Wn5 F3TuEZ35eWqlnUZcUDAQw4nQ/ltB+q8dBljNYGUZuR5wB41dboAGmlhqCl/xlyjzGjft 6YMCyaXI+1j8rFvKmcaN7v8qxs3CLbv/NPJNcGmcqLa+JJvZY4EfdzhBfgUYXuyp9W6P 0/vbH/JG6fEj2yQxDvbVi7elqnKuIo3reLY5QMknZS0QfieF0NMNno9gPUbMkE8GYkHL FHEQ== X-Gm-Message-State: AElRT7HvjGR/0WFUvg/1CdWFjIi/2hRce2oJdBAMXBEKI19QZbP/OrfX r0iEOjXrtg3jhwW+yFGABEdkndoPXK2EH8EUsZA= X-Received: by 10.200.39.217 with SMTP id x25mr2178921qtx.266.1520961405065; Tue, 13 Mar 2018 10:16:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.12.195.80 with HTTP; Tue, 13 Mar 2018 10:16:44 -0700 (PDT) In-Reply-To: <152055664720.63229.16209149030018336339.stgit@sosxen2.amd.com> References: <152055660594.63229.5131049527614494130.stgit@sosxen2.amd.com> <152055664720.63229.16209149030018336339.stgit@sosxen2.amd.com> From: Andy Shevchenko Date: Tue, 13 Mar 2018 19:16:44 +0200 Message-ID: Subject: Re: [PATCH v2 1/5] iommu/amd - Add debugfs support To: Gary R Hook Cc: iommu@lists.linux-foundation.org, Joerg Roedel , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 9, 2018 at 2:50 AM, Gary R Hook wrote: > + default n Redundant > +#include > +#include > +#include Keep in order? > +#include "amd_iommu_proto.h" > +#include "amd_iommu_types.h" > +/* DebugFS helpers */ > +#define OBUFP (obuf + oboff) > +#define OBUFLEN obuflen > +#define OBUFSPC (OBUFLEN - oboff) > +#define OSCNPRINTF(fmt, ...) \ > + scnprintf(OBUFP, OBUFSPC, fmt, ## __VA_ARGS__) I don't see any advantages of this. Other way around, they will simple makes things hard to read an understand in place. > + for (i = start ; i <= end ; i++) Missed {} > + if ((amd_iommu_dev_table[i].data[0] ^ 0x3) > + || amd_iommu_dev_table[i].data[1]) > + n++; > + return n; > +} > + > +static ssize_t amd_iommu_debugfs_dtecount_read(struct file *filp, > + char __user *ubuf, > + size_t count, loff_t *offp) > +{ > + struct amd_iommu *iommu = filp->private_data; > + unsigned int obuflen = 512; Sounds like way too much. > + if (!iommu) > + return 0; When this possible? > + obuf = kmalloc(OBUFLEN, GFP_KERNEL); > + if (!obuf) > + return -ENOMEM; > + > + n = amd_iommu_count_valid_dtes(0, 0xFFFF); > + oboff += OSCNPRINTF("%d\n", n); > + return ret; > +} > @@ -89,6 +89,7 @@ > #define ACPI_DEVFLAG_ATSDIS 0x10000000 > > #define LOOP_TIMEOUT 100000 > + > /* > * ACPI table definitions > * Doesn't belong to the patch. > +#endif > + > + Extra unneeded line. -- With Best Regards, Andy Shevchenko