Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2681320ybc; Wed, 20 Nov 2019 18:57:03 -0800 (PST) X-Google-Smtp-Source: APXvYqypj5KQPW6ziegR7kLyHeaA9x1/OW87FNj8joyhqWun3KNQ3TcBw+5yMB0QWMH5e4ODEXsv X-Received: by 2002:a17:906:af5a:: with SMTP id ly26mr10416418ejb.252.1574305023556; Wed, 20 Nov 2019 18:57:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574305023; cv=none; d=google.com; s=arc-20160816; b=KDyjNoMwu52MMUIBs1v/aJrDzB7PqdeFbWgh6RnZc9gGYQypvajhget31PV+CX0brw aeX6Wzb6hA6B5psHuSKcDlPNjSufBhsGKJEJEH6vIvkk0geQQxea4ZPwGDeYhX9EOFWL E8NfRm2qoi49LvelvdDDZae0UgvsF3eyra1KtUY9KdjVrK012nK/Vluc1cCi2+tj+2qA 1G5bGhVk2DxZ9d2Kllll8a6CMz5HJWQaVV2o4gElb1fxucHDpm26A8CSWcNhDvhAzqdr hIi/kYbKt6XO7gUsEea8jvie6GGeWKzaI5TxSSBpT1F6YuP/vMZpmvIORTnNgh8InxsR e7Vw== 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:dkim-signature; bh=HRBpb1NofTDSzn/r03yAMNZB5b+BCFqizd3KS9TU4pA=; b=lD9ASKJeCzonlPdnrpcEvbzRzhJI/OkX0G4w53M3rmaJFwae2Xe9xGQNSAZ/MXSoYh EWBhERY989Ws3uIdQ3Wlvpis3HG+t8ZUGZAIvwyWHJuqG7+k9AmY8M1sGk8AfL7reEww 23FYWBf/NNrm0uIuxThQyJFN8V9K0T3qF2vbma6CToSW+FSq1nu9TSKRRHhkntgrwEdi sy7STjWh6zYQi4kkE0oIdLwBh+eqzxXf9cW6HrHexN7ZNV8P1VLWLSX7REeiTin2eoH4 SvF5efQAwAW6c4ED5oof0peOxm1a4pLvOkTtbG7dJZWgUr6ba6Up/cRrNaX2/3PfZ2vh N/LQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@jms.id.au header.s=google header.b=eM8XKCwL; 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 cb6si744511ejb.359.2019.11.20.18.56.39; Wed, 20 Nov 2019 18:57:03 -0800 (PST) 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=@jms.id.au header.s=google header.b=eM8XKCwL; 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 S1726541AbfKUCwy (ORCPT + 99 others); Wed, 20 Nov 2019 21:52:54 -0500 Received: from mail-qk1-f193.google.com ([209.85.222.193]:38015 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725842AbfKUCwx (ORCPT ); Wed, 20 Nov 2019 21:52:53 -0500 Received: by mail-qk1-f193.google.com with SMTP id e2so1819411qkn.5 for ; Wed, 20 Nov 2019 18:52:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jms.id.au; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HRBpb1NofTDSzn/r03yAMNZB5b+BCFqizd3KS9TU4pA=; b=eM8XKCwLiBTrYDBgxBsRw2BnAmazqG7Yh6EbctgrhhDT/VkJWtpyd4I0jgafYvddrh D66QjPZTHqlc9/T9Pq6r+XndN0ChjvCNCAbtD1ti+CxMAcIA0x8gA/v8a9/8DxOw6uTh MX6B2lo/1ZzdCXW7YoJyaVCv3hhhg1OJvwgSQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HRBpb1NofTDSzn/r03yAMNZB5b+BCFqizd3KS9TU4pA=; b=bqJEbPv+Foov9OTxlUr2DXS4b3zp8i4otojewThV1/1VCMmqYbAuFwYq5ypwigtrmL cXs4tTTAA07vk6VfgVwGLGU/FBI7VW1MyXEQGi9JejY0iksqFCaKUBZZPHg8cQAqQUTq Volubkarb3CS1fCSE1XI/93AatCNb39F66KefRYKbMGPXIYzePEdWDQBf146Y9Hh0HVd XPFbPe/chncd4ZHhT6LsyUrpQhzEuCs7x7j1brhIAGlXzHGrRSxOGTLLf5ze6UKCtZ74 7CA1qxE5puKwKtBk9AHI1W4eihnOLFME4E55Yq7LH2w4PruYpvsUd4MwIe8ZN0Wz///I 37FQ== X-Gm-Message-State: APjAAAUp+FouMZUMInMLg90HUuaPpNDom0R/eMH69aEMMma4NGFyplcU dq8zE3aYP9wkJWcjC6Tr2UyZxLL2qFQzo/JZAEKB2wi8SEY= X-Received: by 2002:a37:dcc7:: with SMTP id v190mr5861034qki.330.1574304771112; Wed, 20 Nov 2019 18:52:51 -0800 (PST) MIME-Version: 1.0 References: <20191120000647.30551-1-luc.vanoostenryck@gmail.com> <787e54c2-2fe3-4afc-a69b-94771726194b@www.fastmail.com> In-Reply-To: <787e54c2-2fe3-4afc-a69b-94771726194b@www.fastmail.com> From: Joel Stanley Date: Thu, 21 Nov 2019 02:52:39 +0000 Message-ID: Subject: Re: [PATCH] aspeed: fix snoop_file_poll()'s return type To: Andrew Jeffery Cc: Luc Van Oostenryck , Linux Kernel Mailing List , Robert Lippert , Patrick Venture , linux-aspeed , Linux ARM 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 Wed, 20 Nov 2019 at 05:42, Andrew Jeffery wrote: > > On Wed, 20 Nov 2019, at 10:36, Luc Van Oostenryck wrote: > > snoop_file_poll() is defined as returning 'unsigned int' but the > > .poll method is declared as returning '__poll_t', a bitwise type. > > > > Fix this by using the proper return type and using the EPOLL > > constants instead of the POLL ones, as required for __poll_t. > > > > CC: Joel Stanley > > CC: Andrew Jeffery > > CC: linux-aspeed@lists.ozlabs.org > > CC: linux-arm-kernel@lists.infradead.org > > Signed-off-by: Luc Van Oostenryck > > --- > > drivers/soc/aspeed/aspeed-lpc-snoop.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/soc/aspeed/aspeed-lpc-snoop.c > > b/drivers/soc/aspeed/aspeed-lpc-snoop.c > > index 48f7ac238861..f3d8d53ab84d 100644 > > --- a/drivers/soc/aspeed/aspeed-lpc-snoop.c > > +++ b/drivers/soc/aspeed/aspeed-lpc-snoop.c > > @@ -97,13 +97,13 @@ static ssize_t snoop_file_read(struct file *file, > > char __user *buffer, > > return ret ? ret : copied; > > } > > > > -static unsigned int snoop_file_poll(struct file *file, > > +static __poll_t snoop_file_poll(struct file *file, > > struct poll_table_struct *pt) > > { > > struct aspeed_lpc_snoop_channel *chan = snoop_file_to_chan(file); > > > > poll_wait(file, &chan->wq, pt); > > - return !kfifo_is_empty(&chan->fifo) ? POLLIN : 0; > > + return !kfifo_is_empty(&chan->fifo) ? EPOLLIN : 0; > > Looks fine to me as POLLIN and EPOLLIN evaluate to the same value despite > the type difference. I assume Luc was using sparse to check: CHECK ../drivers/soc/aspeed/aspeed-lpc-snoop.c ../drivers/soc/aspeed/aspeed-lpc-snoop.c:112:19: warning: incorrect type in initializer (different base types) ../drivers/soc/aspeed/aspeed-lpc-snoop.c:112:19: expected restricted __poll_t ( *poll )( ... ) ../drivers/soc/aspeed/aspeed-lpc-snoop.c:112:19: got unsigned int ( * )( ... ) If you fix the return type: CHECK ../drivers/soc/aspeed/aspeed-lpc-snoop.c ../drivers/soc/aspeed/aspeed-lpc-snoop.c:106:45: warning: incorrect type in return expression (different base types) ../drivers/soc/aspeed/aspeed-lpc-snoop.c:106:45: expected restricted __poll_t ../drivers/soc/aspeed/aspeed-lpc-snoop.c:106:45: got int Reviewed-by: Joel Stanley I will send this to the ARM SOC maintainer. Thanks Luc! Cheers, Joel