Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754156AbcKQCZ0 (ORCPT ); Wed, 16 Nov 2016 21:25:26 -0500 Received: from ex13-edg-ou-001.vmware.com ([208.91.0.189]:18172 "EHLO EX13-EDG-OU-001.vmware.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751953AbcKQCZY (ORCPT ); Wed, 16 Nov 2016 21:25:24 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=syeh@vmware.com; Date: Wed, 16 Nov 2016 18:25:08 -0800 From: Sinclair Yeh To: Arnd Bergmann CC: Thomas Hellstrom , VMware Graphics , David Airlie , Brian Paul , Charmaine Lee , , Subject: Re: [PATCH] drm/vmwgfx: avoid gcc-7 parentheses warning Message-ID: <20161117022507.GA10572@promb-2n-dhcp150.eng.vmware.com> References: <20161116141949.2052696-1-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20161116141949.2052696-1-arnd@arndb.de> User-Agent: Mutt/1.6.1 (2016-04-27) X-Originating-IP: [208.91.1.34] X-ClientProxiedBy: CO2PR18CA0018.namprd18.prod.outlook.com (10.161.80.28) To DM5PR05MB3244.namprd05.prod.outlook.com (10.173.220.10) X-Microsoft-Exchange-Diagnostics: 1;DM5PR05MB3244;2:V6Zw/dpxmMXUFsy/66DqxY/QvyVfYzLrDZlQG6keVOrdPLC+xnGnNTlwSRcOdXrNaiBhuFp3YOUYbi5RvzkTlOqizgIZ7cRdZ1J654CtdoFEf+8hT3IchLOdFWjC/kiltLC/djT7m1uRcG5IC4XbTquhDg1XyF97WpMzE7YyojE=;3:wwvwDqdxZqQVeXoUNlOWEElC46czhmuzsf+Fc0MAVOFHhOv9IWsCJgRelW+fz8Z612bitx76eMebq5vFYAuGJ3E+MqKENBlZKS5ZPSzbVVSmyf1s6gWUiFQghKuIk6Um4QbUXqo3uJsNAS3/Tjtbb6iPnaojZGvfhALOdi+VwmM=;25:XO8tHdWP/vyBCnUEkz+HxUsDZyvxPUHwjkzKHpUqlqQUSg8bZbMPdIAek1jq1tlSjyefyxN0t6JWR6rpxjCTi9jir4p7wgiO9Uxyi1vrOYA6lFzxWd36ls6rqzFOlF9UvTQeQa37oRU1W0DMbJCtNj4FXmuQCEMyjB37iOyCwzlcBzzfcsyagfTW/lOzbDdV6slKNDYueube7opSR79Jh5BHniqKotrP0bEcRkayuur742wq4OCYj976rvqij/fpNPCtwsuqw5jQrsD3JtV7ft3AA8IhuSNPTNGbwTiNoG6yXiQLwmQNCCnL255i5Fbc/0AALWFvN3wri7Ck2mG5BxgwKP2LkQ444SumEsMAocX+2kBRKogPGyvmHC0g0el3ECZqrrY+EMWtz44F7LbYWeM3kyP2SqMIba75h3YjpjIygx5w2ISkvxrOFlN8+b5yDxt9uG7orysafR7W7gGO2w== X-MS-Office365-Filtering-Correlation-Id: 588049af-5a87-4f3f-1e11-08d40e90f8c6 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:DM5PR05MB3244; X-LD-Processed: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0,ExtAddr X-Microsoft-Exchange-Diagnostics: 1;DM5PR05MB3244;31:Oj4zoGbAATzYaiRx8EJXf3V+SQHbOgjvIuoBPDa/XAe86Md7zkmr+x5iqepxqXxgkl7kIrTPTjBMCbHWNqljmwKn0+c1ZKNHx2fxH2jn8QyUEiAgLeMtBmxmOQO2anBZcJ1UUHoH+YAMQgKPnHQMKkaV8yJgMXoae2ErypkfqeXEWGdm3l7Jo0vNMm6q3oXjO0Fhem0gbmhkVHA++gMvtrkXjPexjbSjNvB4fpI8gqnTVLdQqu1GcnMZquWvpZYkI0MhnZn0tNZlzjvdh1zRtDAm1IZS/5OyjloGUFCIOso=;20:WSUhmQMqCakmNgth7U/1IjQkm8uK/6OpfZG0W/OufJD9nDPMakFU5H/pnvWddh7rCZVhJi8rdk5KR//08nnePCiIx2IUr+1CSC3diElojxX0zds7j0d4Puwsitj93eXy1Pm84rNbnecpH4OB5cEkStF5ze+FPD7TuVnf0hdq3Ald4pO+huyB8LEQjFXSjceF+oJQN1Z52K6TyJ8ENf/gvuVE0DhckAREm3FgaCZyHE/at+veY6c41BGsQe8xUic/1h5VR4VPmyXaHJiUMu7K5HGvVd9qfZjAo85G73M1K2xFsAkS/82/b+oyiTnYveiOyL7fiUlxaxzF7J8sh82HAgkbWv+s12E1TpR3dxux6AdqZnpnYVVAIj8oSsS/HcB8+WUk/shboPIyb5m0UMFRqlssjjKBC/LvPQ9ykL830VPW7FGUBfhs2vikJxfOZNH22BRKUSDIX3aBQPReVaqorF0yoHjJPBUd5y6MNOow74wwGo/1Vt2R0Cf99M7VTcBO X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(61668805478150); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6060326)(6040281)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6041223)(6061324);SRVR:DM5PR05MB3244;BCL:0;PCL:0;RULEID:;SRVR:DM5PR05MB3244; X-Microsoft-Exchange-Diagnostics: 1;DM5PR05MB3244;4:9RwMQJNn2sBcFl9iExNX+8yPjnDjxt5VZUKc7kHuUNPc73glwgd2KxqqMI5WGNcE/nbPTgIgvImga1We/WmOufRaBTY5htw3r9A/m0I48pEvwa6hkHITSuuEaEtp5TfNEVhOJqyCQEgfle83RtSXITS1LAYdl44G7GZjXgZYJLyMjnYG1v8jS0Fuow+p2jKrpc0ajUDCPq4jkfvfxFnOrk0KhXajeijMTVmXTcuyfWgCLds26NHqe545/WaesqMWtpIrr3NZwfsx9nbRy9cPhCG5yPlS7/ES6ctEpDlHLla7fEmWSfwo065iHp5/ngdIp4HigZh8Rr3BfH2WSPsa27NF/gke92t2DB2HCbSHrnT92V90UFqZ0Cwf8GG/x0ycxDooODYaaUgFysOw2a/fiKK7wlTOfp54AuctLfdiwMyxSPfttJairAtzvv2OFfTHC0NPxEEdg1X1wIGNY/vn1RvfXVWKV6Sy4SOHFkaG7CT7jhSQ2SrNd6X29Df3RrGg X-Forefront-PRVS: 01294F875B X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(7916002)(199003)(24454002)(189002)(3846002)(110136003)(23726003)(6116002)(305945005)(105586002)(106356001)(33656002)(97736004)(229853002)(97756001)(189998001)(42186005)(1076002)(68736007)(7846002)(50466002)(7736002)(4001350100001)(86362001)(47776003)(50986999)(8676002)(77096005)(66066001)(2950100002)(6916009)(6666003)(5660300001)(2906002)(46406003)(92566002)(81156014)(54356999)(83506001)(81166006)(76176999)(101416001)(4326007)(7099028)(18370500001);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR05MB3244;H:promb-2n-dhcp150.eng.vmware.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;DM5PR05MB3244;23:k27XlDUMnDQybZVYtJ6aOtLSMqACAN0g13i6xNfZ0?= =?us-ascii?Q?tPfQjFJY85qoSN4QUeKAi/EgBADyJzaWDKX9XU1SNqzXUEjAQL0UGSu2T9S7?= =?us-ascii?Q?8oZ8GUiyM+eYdJDBqqwyqQyrDuGwOMefdDnwRO4mpgM9My0QA9FWXORUvJAx?= =?us-ascii?Q?Pw0JvKwz3qE/ZdlhVsr0an1qtIwh6peVbH7SbPyGK4JxUvxFqAKY8PPNHPVZ?= =?us-ascii?Q?pGukHwGWegaI2R/Ce4BbQ6sFdTu+pIKBPIwOGlqX9nRldVm/XVPK4o2oETF5?= =?us-ascii?Q?GDFLRj7qG38NmxAP8mLAREqj9e//OYaQlJxqqSDzjq5yPF4BOa8xRTZw1k5O?= =?us-ascii?Q?rPIy7FyQkeKOhiHa5mUU/gzieJrkF/xWxo0872Ie5Ua8B9dSQ+9tq25mBmOe?= =?us-ascii?Q?sC7b7E9gIxaFoTwIetf7hbS65FDPoeTEGAnngQwdbl+PqaAugVsKoxEi9DTX?= =?us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1z92iDU= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Nov 2016 02:25:17.0749 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR05MB3244 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1687 Lines: 42 Looks good to me, thanks! I'll incorporate this into the next pull request. Reviewed-by: Sinclair Yeh On Wed, Nov 16, 2016 at 03:19:31PM +0100, Arnd Bergmann wrote: > gcc-7 warns about slightly suspicious code in vmw_cmd_invalid: > > drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c: In function 'vmw_cmd_invalid': > drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c:522:23: error: the omitted middle operand in ?: will always be 'true', suggest explicit middle operand [-Werror=parentheses] > > The problem is that it is mixing boolean and integer values here. > I assume that the code actually works correctly, so making it use > a literal '1' instead of the implied 'true' makes it more readable > and avoids the warning. > > The code has been in this file since the start, but it could > make sense to backport this patch to stable to make it build cleanly > with gcc-7. > > Fixes: fb1d9738ca05 ("drm/vmwgfx: Add DRM driver for VMware Virtual GPU") > Signed-off-by: Arnd Bergmann > --- > drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c > index c7b53d987f06..3f343e55972a 100644 > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c > @@ -519,7 +519,7 @@ static int vmw_cmd_invalid(struct vmw_private *dev_priv, > struct vmw_sw_context *sw_context, > SVGA3dCmdHeader *header) > { > - return capable(CAP_SYS_ADMIN) ? : -EINVAL; > + return capable(CAP_SYS_ADMIN) ? 1 : -EINVAL; > } > > static int vmw_cmd_ok(struct vmw_private *dev_priv, > -- > 2.9.0 >