Received: by 10.213.65.68 with SMTP id h4csp1060427imn; Wed, 14 Mar 2018 08:26:28 -0700 (PDT) X-Google-Smtp-Source: AG47ELt6SXJHyu0iNfSM8sIvRLdZ+tQ1tlFDZvjL9NEVKTik87Seth9z7xm9wkbxdhPqPhM+6+X+ X-Received: by 2002:a17:902:ba96:: with SMTP id k22-v6mr3413733pls.111.1521041188400; Wed, 14 Mar 2018 08:26:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521041188; cv=none; d=google.com; s=arc-20160816; b=nY2Qu1qIMpyZAe3jXXqZePT0XDHMy/eSfenhLrkJYKsMIjkhM8eB8bjdgtTqxSsrZ9 LDeKRFP8AyIjLzFiMf845Fhpe0mAwM/OBMNJ4PkKToXXx+i6/kUwfJ6LNDIRApkmjdoz XRCVRZBRLZnAUWq/6YeCvYiifGwbpoerX1F+BYElFe6vHPNei1v74L/xFDf5/FBdYuE3 Dpz7yuoyUOr0g1dypGktFOCsOUX9f8xB5SYpF9CETL07HpXgUjPNp+w0RgTmPujAVgZc xMZ43779rj8PLFB6sD6rFmN/dgRVY6Pg6XF+qBCloZ2lPxvk7gnf8qLjPcBh+OztwF3x FKHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:arc-authentication-results; bh=wy+8/GfHBBZP+PYcT85OOFdCI/E29ufUSXGsd7zaLRU=; b=HuMIpC7NCtimhIN6wcqepOtot4GdjvpYnW0vY82HPbPn70f6zfdSCEQRkk8VQhzBE/ d49dk1LyIuW9X8VmOaY1xz3ZQlAiYxPhTalw/kmxUZ9iXBtMx1mdg2kebI6FS/fi6WPB TjiOHDnEgh8MmLQLKCNMJT3q55v9001eIf5ehBkeTWH1nq2vzTukBR0nZI3qrq0cOy/W jPcAeyPXOf9fj20u70voGwuhrwfGeZ2yEWIM8mzs7S4CRUMPLEYGOBAvSl1avOmIlBn3 KLtyl6FPK8q7kV9ka4qrC/UpVt6lBOTHtKMgq+G+9jDNfboi1ev+B/RQG2bYmactj+O9 CKIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=owEy9rOg; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u6-v6si2098384pls.424.2018.03.14.08.26.04; Wed, 14 Mar 2018 08:26:28 -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=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=owEy9rOg; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751748AbeCNPZA (ORCPT + 99 others); Wed, 14 Mar 2018 11:25:00 -0400 Received: from mail-bl2nam02on0075.outbound.protection.outlook.com ([104.47.38.75]:17678 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751362AbeCNPYw (ORCPT ); Wed, 14 Mar 2018 11:24:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=wy+8/GfHBBZP+PYcT85OOFdCI/E29ufUSXGsd7zaLRU=; b=owEy9rOgvpGqASSvsZhTHRgwS1F8BqXfTHwH3VSiSjrtXvQ8nc+YB5iDlJw2Wnn3q37Eum7AxHXgrEWzMIl+EZh/JBnmrKKsTtU0k5vYUX5RRWBanRxbW7RTpkhfS+feVabEhsT/7B2edQS2Z4FA9ei2AfpI60pLqT2Jw0aCnBw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Gary.Hook@amd.com; Received: from [10.236.109.62] (165.204.78.1) by BLUPR12MB0692.namprd12.prod.outlook.com (2a01:111:e400:5951::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.567.14; Wed, 14 Mar 2018 15:24:49 +0000 Subject: Re: [PATCH v2 5/5] iommu/amd - Add a debugfs entry to specify a IOMMU device table entry To: Andy Shevchenko Cc: "iommu@lists.linux-foundation.org" , Joerg Roedel , Linux Kernel Mailing List References: <152055660594.63229.5131049527614494130.stgit@sosxen2.amd.com> <152055669123.63229.1692099069085978884.stgit@sosxen2.amd.com> <3969f155-c3bf-44c5-d056-825e71d42152@amd.com> From: Gary R Hook Message-ID: <5c84192d-8110-b06f-740d-723cd3099a42@amd.com> Date: Wed, 14 Mar 2018 10:24:45 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: BN6PR14CA0026.namprd14.prod.outlook.com (2603:10b6:404:13f::12) To BLUPR12MB0692.namprd12.prod.outlook.com (2a01:111:e400:5951::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 594a5bab-41b1-41de-6983-08d589bfba11 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:BLUPR12M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hGU260dDX9/zRKPQ7O3HDHphbQihonZLuqqwQB8Z2KMM5XHIUEHDngpExO4n/UUIbjlWDEIs81cjarpvWvMJhQ1VxLbVhyLlOjMx8DnXyzsWuj/OMSwWDp0sYAajdYkNT28Ft+rWY9Dv9EKqdNFmkuNVhNYVf/OMeB5V6ct30y9TYMMledTJTQ+9/Sj9jJKu0kEfEdrimHdtKcLBrw/FdZtzWjLs72GaCqKPrAbpi54NbA/kUGxqoLshFIgdhkU9nqt6b+s+E15VbXr9Be7hgVZ4zWca+s1dPHGcQQ8lPUKYdcByoIP4laM/RJ1qeSdtS8XOfblbKTKT8RTXhSYuOZqQDza+armpsWHzWTOeA+ZshD7X1zUWzt8aK1nwI7wiseTjOQLUx29EQ;4:jzhELlrNRZisc4xs0N0evn7uvyru8ByJVXtRGyFr/wwKoiGfrFX8CE3ByCcNgHmfJZdIQADimIMEByfIFMbY+KLyO1bxEiybIkd1iCuqQ7VtISrK1dhUYQWFwVgG7flvGg+9rno/fnwi6s0MTkJcVS3symYgmbAP75WtDIdlDoxHVodFWv5knT61108jMn1lJwf2D8BcrpS4v25+frEIpijLbD2ImwfLBp3lqArpm0y54lwo62BupbBMcPWIUy5FtCcfUOiLrF+XXndI4MMswIvk8mzXXFay5uGRNipftKotmdyJtIpvkG67GhpKFjEK X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231221)(944501244)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123560045)(20161123558120)(6072148)(201708071742011);SRVR:BLUPR12MB0692;BCL:0;PCL:0;RULEID:;SRVR:BLUPR12MB0692; X-Forefront-PRVS: 0611A21987 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6049001)(346002)(39380400002)(39860400002)(376002)(396003)(366004)(199004)(189003)(7736002)(6666003)(229853002)(316002)(106356001)(2950100002)(5660300001)(2906002)(65826007)(65956001)(16526019)(72206003)(305945005)(47776003)(65806001)(6116002)(39060400002)(3846002)(26005)(86362001)(53546011)(16576012)(386003)(230700001)(6486002)(66066001)(31696002)(478600001)(77096007)(105586002)(25786009)(81156014)(36756003)(6246003)(53936002)(68736007)(97736004)(4326008)(76176011)(93886005)(186003)(8676002)(81166006)(58126008)(54906003)(8936002)(64126003)(2486003)(31686004)(67846002)(50466002)(23676004)(6916009)(52116002)(52146003);DIR:OUT;SFP:1101;SCL:1;SRVR:BLUPR12MB0692;H:[10.236.109.62];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTFVQUjEyTUIwNjkyOzIzOjFHUldPWTRGbUp5ZTdVQTBvWmJ2KzlCRDd1?= =?utf-8?B?dkZQTk94aDFVaFB2dVkzNDdON245QmhmOElWcVJ2Z2ozaFBlbEp6S2Nqbmht?= =?utf-8?B?L29seElqUFlvbUxrZW5sQnFQNXFYeWtaUEJRQ0RvWU95Y3I4dElCcmV1UEU3?= =?utf-8?B?NE1vM2VSOUFHbFJxdURTWGlmUHVoV2RBNVk3L21CVFozQXBUZ1czWXZDVEs4?= =?utf-8?B?L2N1dm5hbkwwNWdTTUZnOWRudExQcnI0WlRJNzV1QnFmLzZhWEVzYUc5eUdr?= =?utf-8?B?NUppSnh2M2RidS80TVBOa0NIdUZPdjhaVVlJWkdmL2hpU1FkUWlQYnRNQjU0?= =?utf-8?B?ZHM5SmRPMWxJWS82anQyUm94dUxsc3lUUm81MjZtam53N0dqT1RiejV3cSs0?= =?utf-8?B?bFRRbkpuMmQ2dzY5THZJclRQdno0aGVldHJqamROLzd6S2krajJrWDcrS2pV?= =?utf-8?B?Y2U1bG1ndWI2dVdGZFgydE04T0VnTTBKT0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FA/h4I/7WfV3A2xKrqZvT/HTjR7EeGtgg4iJ2u X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Mar 2018 15:24:49.3442 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 594a5bab-41b1-41de-6983-08d589bfba11 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR12MB0692 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/13/2018 03:56 PM, Andy Shevchenko wrote: > On Tue, Mar 13, 2018 at 8:54 PM, Gary R Hook wrote: >> On 03/13/2018 12:20 PM, Andy Shevchenko wrote: > >>>> + } else if (obuf[0] == '0' && obuf[1] == 'x') { >>>> + n = sscanf(obuf, "%x", &amd_iommu_devid); >>>> + } else { >>>> + n = sscanf(obuf, "%d", &amd_iommu_devid); >>>> + } > >>> kstrtoint() ? > >> I see various mechanisms for this sort of thing, and simply chose one. >> Am happy to use whatever is preferred. > > sscanf() has an enormous overhead for cases like this. > > simple > > ret = kstrtoint(); > if (ret) > ... do error handling ... > > Gotcha. Fixed. Thanks, Gary