Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp856132ybg; Mon, 27 Jul 2020 01:05:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyzxL8njH46MwhIgRIYDCn/XZfgIkTeypVhF1xhARfi4c+qT/njSBHxnoK2UCMkqxQyo7P2 X-Received: by 2002:a17:906:528d:: with SMTP id c13mr20143405ejm.61.1595837147662; Mon, 27 Jul 2020 01:05:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595837147; cv=none; d=google.com; s=arc-20160816; b=qCy/pNSc022SAlUT8YqBJU9dFUrIk9gN+2KOw9nJjuRrtzTKqBhAJSoYt84b8mN6Rx 1eGJEQcn7wE468ROc+KXA+NhmcPvvaadD1Qu7Es0oyjpwh3e5EWg+iU57rBZQFI9Nbkk yJ/ICOqlcMhH7EzhMD/W/S4MHCBS7Cio24G1hNVWmwpHeYdi6Q+Mb04aM/VhdIm1xMhx L0y0LC9wai7vTs1ya8yxB04YYoPnra2EgRP7EMsOBp2lGOuNdFnWfUK2kF3qqBEDpnv/ lSItZRUhQXdLJqAewts2HIWQ3KX5QTWfjHzqNfhw1aePZdhs2K7otM3edwdR69K29CYs LblA== 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 :in-reply-to:references:mime-version; bh=NyjTx4FLdLfoE+Yp8xxI4Cnv2evDxGgqW1g8l3wBdEc=; b=ohzxIQ6BsbOgQdryqs5cKf+7nT8uRn9gHOWs7mgX8EXY8sRJzzZGbdr9HLz5UsoXYb 5XI4MMFN7R4h5KLRJ1br2ySF+DStD1Q9dorfeVXHmbQjEiW8MtkcgiBM2wXSn7zBixpR gqMD7lavYAWJg1HP9BUhXnt2lnqtNu0FV5DubpvolkkYdX1vBMXxtsS9ltL8vk1XFd4y IGAKqiAX3MEJbjjaoF4VFi71MhzximpiWxoKruLET6In1s4v4qYtc1u7jeceam8zHm+k hhqqXY1JMLP/KLHVHoBshjWPffIRzcFfIGCI4wzttTxOUQUZaU92sgtqAcX2kHuCNUNr 9Z9A== ARC-Authentication-Results: i=1; mx.google.com; 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 re10si5315701ejb.156.2020.07.27.01.05.25; Mon, 27 Jul 2020 01:05:47 -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; 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 S1726313AbgG0IFI (ORCPT + 99 others); Mon, 27 Jul 2020 04:05:08 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:56915 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726184AbgG0IFI (ORCPT ); Mon, 27 Jul 2020 04:05:08 -0400 Received: from mail-qt1-f182.google.com ([209.85.160.182]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.145]) with ESMTPSA (Nemesis) id 1MyKU6-1kj0fe0Ly0-00ykYi; Mon, 27 Jul 2020 10:05:06 +0200 Received: by mail-qt1-f182.google.com with SMTP id a32so11555223qtb.5; Mon, 27 Jul 2020 01:05:05 -0700 (PDT) X-Gm-Message-State: AOAM533+FovHUCRXEqbpIWNVTVuRsVPhfKBGs0i4bG36nqwacykKFLHF SRiuqGmy6zPl0DvqoRii+CHIrd7wjKSeNArFhdg= X-Received: by 2002:ac8:688e:: with SMTP id m14mr13917515qtq.7.1595837104846; Mon, 27 Jul 2020 01:05:04 -0700 (PDT) MIME-Version: 1.0 References: <20200726031154.1012044-1-shorne@gmail.com> <20200726125325.GC80756@lianli.shorne-pla.net> In-Reply-To: <20200726125325.GC80756@lianli.shorne-pla.net> From: Arnd Bergmann Date: Mon, 27 Jul 2020 10:04:49 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] io: Fix return type of _inb and _inl To: Stafford Horne Cc: Andy Shevchenko , LKML , Wei Xu , John Garry , Linux-Arch Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:PdHhCj7oiiqrJXYdq0ITMJFDMx5Lrek/Fal+pyeSGA1J+haBUJC fDbOujYyH+EZNKI1WWBaleyt/wQ/jlHsAmWzCXAatX2Bd307q0vrnIxNsMWhwmsWX59z6HV aJ8JFYATc+xNNcAyVgcLVgagzUfS1UBZw7tZ/gNgbeCAimoNwWWoUIW90X0ZgyouFl82yBM X88EohCnbhX5lHYyYFK0w== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:dzVgJ0ItLgY=:3gVwWM0cahYnhz2ri1t6Qo zGSRiNeXw+Fvjv/TA8VXud7ceY6UX+E3lZ26yBnvvKpkDDuY9jS0/VIhyYrheVP8iOaRjPUCb j19fymZojz5UYqMS2aafBSC0rjKywyFWD8GBV4zoqxavYlXnXg+gKX3blrd+ioaP8FHP/ZbP6 2JYWv3bUvKieUvexS6Ws7AkVhtHuaolnBBabl2O/lI1YPzayomPkPX0EUyyGpV/fJfE19UDVS KbMd1zEx7K6QiMOO524MUI41JseveSq8JtGyH6PI7wJb9eiYY+q6vxTte25Bv9J5p81QMUTkn 5muNN3v+/0Ms+6w+a3IOB2St/TQfAuox60q6H8cAQb2LixRGIjOCdKwcZra2hhmYhkINvdkyk FRT+OUQiXnujHoguSjaMiKcpa9hZPwIhGYwMFWUAcPklHX+RWEdLVUh4V6320BM/AKJ5WXXky GmNOkCG3jqRllL+uV4dwHRoNk2qCzmR78WqBs03WQ/cONwd2fwx0ZXyoj2eLfgaXtVO1LYMqp 9/4KafOuzE+uePi+xlZP8d9kiu7ZqZKGd80FZ+tINm2DvX/EBTjmGPjq4Ki6oxOnzgAQJIuGe DUEJLuejGHlhdsfcbT5pRkLh0tS11rfV40NLPZ2tee0btKu0RETYw1kCk/AljcAb50M964md2 O92w1pR0xAdLYj0mZ7JM2EbJwq1/PZ0sn1Fa6vqFcQhURl2bmYUWg8wHLPC8kZQeO2jMvWX90 dQgAi3ttGzgPazcudjqz2HZ4JpN9flzBTuUsjIsJba/4z5i21GqJAykh3PdEyfc1bPXHcnpz4 7HiI7mMfdFVZaDuG4iknsh+jBhLYP07M2k0cfRMkCLUujmGI2Heyhahb6cc5KPDkgIsgfBZn/ h/lQRD7kjkh+r/9JJF5jfso1UWgAqbXaMDsJ/FQXbjkOkjR9rvCjJYcqCV5jXy0ly/F4zAgbA wsZ6pRv0a3aCHscg0yAcFkmvY7PHIQ6VQs/74pPgdLFR+9Osq52YW Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jul 26, 2020 at 2:53 PM Stafford Horne wrote: > > On Sun, Jul 26, 2020 at 12:00:37PM +0300, Andy Shevchenko wrote: > > On Sun, Jul 26, 2020 at 6:14 AM Stafford Horne wrote: > > > > > > The return type of functions _inb, _inw and _inl are all u16 which looks > > > wrong. This patch makes them u8, u16 and u32 respectively. > > > > > > The original commit text for these does not indicate that these should > > > be all forced to u16. > > > > Is it in alight with all architectures? that support this interface natively? > > > > (Return value is arch-dependent AFAIU, so it might actually return > > 16-bit for byte read, but I agree that this is weird for 32-bit value. > > I think you have elaborate more in the commit message) > > Well, this is the generic io code, at least these api's appear to not be different > for each architecture. The output read by the architecture dependant code i.e. > __raw_readb() below is getting is placed into a u8. So I think the output of > the function will be u8. > > static inline u8 _inb(unsigned long addr) > { > u8 val; > > __io_pbr(); > val = __raw_readb(PCI_IOBASE + addr); > __io_par(val); > return val; > } > > I can expand the commit text, but I would like to get some comments from the > original author to confirm if this is an issue. I think your original version is fine, this was clearly just a typo and I've applied your fix now and will forward it to Linus in the next few days, giving John the chance to add his Ack or further comments. Thanks a lot for spotting it and sending a fix. Arnd