Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp326240ybg; Sun, 26 Jul 2020 05:54:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzl/XECnbAJSTmiZ2wE0iTZOb0XPGkQDuTNMX85wqi/654Il1Up0zpxlmC7pcFB3RsJR2e7 X-Received: by 2002:a50:cf43:: with SMTP id d3mr17842889edk.40.1595768076544; Sun, 26 Jul 2020 05:54:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595768076; cv=none; d=google.com; s=arc-20160816; b=0udos+6nwfkHOvVHqG4DBIak7/tKDIgDQR5zLRA6Mqe8rVCFWPLGzNSgxDetRp40sB ZFfR3BzvmDGPurmbBBV/m7LCJl7g8pwNjROYAzDZst+bByu0cI9M2fWqtFwCnR3sjXOe m5bJ4v49gl4B1A6fMkfPs6zFE7cmMwOpW9mS5eRSfAcZVbOd7sxcud0AInzJ1Tl+V8+N Lr6IXS48V34BaHleofIlJb7gnYAfT4skum+n11ig03TvkwaXmTYY23hC4Qd3y2ZsI3jF czF0ksT/8dWiHiJ4jmb10UurOFD9DhGBW1qd9u6LucR4A7pK6gh5FGMDRfY99RwfS0my u20A== 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-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=R4T7tQMcRvlhK7jzS9wpJG+H4i1GMckJZWYDGHoH/II=; b=IoE7aoEjQTVH98ygTVef3Zu95lTgRHoWcasAQUZKeddq3pE1f36W9PpS6P2VSI0o0Y nJoiL4eL+bEqX88Hrmen+gjcrw4N6XooD5bieWa68RiKTu52emwmmkLV0Fi95t5LmBAZ dQitMzhlT7T4RvwvttM3ciry9Osr69OMw+FH3bZK7Rt7STWhpix31E39dl6rh4sbXF0g y7185SMOmfGuJceZsjgdL3L4Vln34M4cTFtZdhjZB56jo1T6kNhuJLv3zQfpfm86TdXv rPybknrfP6V/jZkzM9ZkvwE+DnW3RSWodeHysp1Ka7Tq+it8/NhE77cp02+9zWTahO+3 NRTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rU77LQ6i; 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 d9si3738823edv.44.2020.07.26.05.54.14; Sun, 26 Jul 2020 05:54:36 -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=rU77LQ6i; 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 S1726741AbgGZMxd (ORCPT + 99 others); Sun, 26 Jul 2020 08:53:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725848AbgGZMxd (ORCPT ); Sun, 26 Jul 2020 08:53:33 -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 62B39C0619D2; Sun, 26 Jul 2020 05:53:33 -0700 (PDT) Received: by mail-pj1-x1041.google.com with SMTP id a9so7716367pjd.3; Sun, 26 Jul 2020 05:53:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=R4T7tQMcRvlhK7jzS9wpJG+H4i1GMckJZWYDGHoH/II=; b=rU77LQ6i8gZi61P3L9deG+VaqhuXUapmjk1algjVPC2JSElAiPIN/5qEGgW38mfTnj QAX7dULkwcwM6Ubq5rMyHZsOsi4GSWpYDtUCAt5fVozNjLCfpbA9MQy5fD90PADw/mka QepdRFrkGRoT+DQDXJnHe0qwyJ5zifDt9SQeCav2jscmmAFfU5a7fGVZQKdcr8Ocl9kV IxxVrcZluClcwuEl9Di+lcSeqBmbw42UN9IwJezMGs2v/kRpGPn42zDHTyVWK7dVm9uW UCJ1dtoem9CCYI39A0ajsZlt26ESpArPyPRcYNnHgnuvcbey0juBUIOljbZb499WWeJT AXmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=R4T7tQMcRvlhK7jzS9wpJG+H4i1GMckJZWYDGHoH/II=; b=oKu1VNwSlLGA6ikAXfaZN7bf3h7FnFYWVycelq7Ri4IwG26HAzb0O9eus4xDZ8q4Hf jkmqptU4Squr0X+GQ8+S5pVs7DxI2jyK7OyqeXx5ni81wgRCvaC4CjdGgLGqzE7mQcUp QCs/GnkYgAdaMgDQI4rYHqZ3IQKx5Qd6oTNhcvxtEQFm/a7eyfQRpJrb/CesUW80yr9Y IHd5xnngYiqYZIPqPPF+Ws0dBIpcqxI+Va17VLKhCzrba6023eB8k6ThhvroFpU27X/u bkJLl5hs9Jj1acKaTmwaz9WKHoYzgDpSSGkHUgWi/QbYk7SQkpW3Abh02l0eLbjmXlov 1eUQ== X-Gm-Message-State: AOAM532BPBeYJOKJIcgmMo4SPtZJIuyVLfpn/WozWStRMIPMlQIjQ1M9 vX8TNbDXoxXX4glnXqoOxiTZBMbx6t4= X-Received: by 2002:a17:902:8f8b:: with SMTP id z11mr14408279plo.49.1595768012739; Sun, 26 Jul 2020 05:53:32 -0700 (PDT) Received: from localhost (g155.222-224-148.ppp.wakwak.ne.jp. [222.224.148.155]) by smtp.gmail.com with ESMTPSA id x7sm12033589pfq.197.2020.07.26.05.53.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Jul 2020 05:53:32 -0700 (PDT) Date: Sun, 26 Jul 2020 21:53:25 +0900 From: Stafford Horne To: Andy Shevchenko Cc: LKML , Arnd Bergmann , Wei Xu , John Garry , Linux-Arch Subject: Re: [PATCH] io: Fix return type of _inb and _inl Message-ID: <20200726125325.GC80756@lianli.shorne-pla.net> References: <20200726031154.1012044-1-shorne@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 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. -Stafford