Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp960372ybm; Wed, 27 May 2020 12:14:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyaT/8SGBihg07XPyjTBhl0vDtmdr1DnRjP7eGC5M+A78OF7vMEKD0PDzPF3JDJuOU8eZoJ X-Received: by 2002:a17:906:560c:: with SMTP id f12mr972818ejq.255.1590606858310; Wed, 27 May 2020 12:14:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590606858; cv=none; d=google.com; s=arc-20160816; b=Kq6MgoVaLxz6IQx0T2DOtGtUK11udDqC5wiY2heBlVqADimu4m0w8mwlD5xSZ0/TC8 VDlHyqf0XmZSporQcWZhuC2Yhjj2D9Z8S0nYT1Z9sSiBni6xRoTAISKDpkFt4P2maoEu TM38Q0piK5yrCRJ29APfsZwNQXMLq8k+KKZzdg59OoAy9bKDzFAVI9pOAW1R9EEsg+ej CWtJl5R3l5gj1zHPr+hwfrJni2vVx+pCjZNb25ZN4CxHfMIQY2MXSfOajEwoelcRtG+f DJHAfxd1ZM670nstIyWZuuehd0NmUfd15z06fYNi3rECYl+ywJicPFOPYp16cf/0abbP /sSA== 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=HOBnpx8HZKNA2mYIrdIzHPO79IIq+OTFtfJlgxpJynw=; b=pGgZ6xs9H0tgdG/dC3uHRjIQZYGwrkdsWYOREmlWAsIFBBRRmb21iF4cQowIiZ2tnA c9FOZdSovnWgD/c1CrHh7fQQFGBZ3wHvyp4M4U3dITcWHDSPXtCEeB3XS1HuYoXxc17b 30w3YoaAeJgVcBQLudkevEIPRW9s3QP3drJ65pdkLUYrh1uQwhbqmwLVMTWqDrlkqOXF dFcKkk88IUsQG33np59+tvkoOJqj6Dghs6cUmcP9Vs6nDBtSjOZipM9gQUM/tzLid2Hv iDMGWLgjuk+hzCja12PRTXHqHngSWqMiFSGOiV9WMZ0vAnQrE96cK04CEwNn7lmHbDVr B3BQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=p4Ckd5wa; 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 h7si2179696ejl.717.2020.05.27.12.13.54; Wed, 27 May 2020 12:14:18 -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=p4Ckd5wa; 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 S2391464AbgE0Qp0 (ORCPT + 98 others); Wed, 27 May 2020 12:45:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387952AbgE0QpZ (ORCPT ); Wed, 27 May 2020 12:45:25 -0400 Received: from mail-pj1-x1042.google.com (mail-pj1-x1042.google.com [IPv6:2607:f8b0:4864:20::1042]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C17A3C05BD1E; Wed, 27 May 2020 09:45:24 -0700 (PDT) Received: by mail-pj1-x1042.google.com with SMTP id fs4so1743114pjb.5; Wed, 27 May 2020 09:45:24 -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=HOBnpx8HZKNA2mYIrdIzHPO79IIq+OTFtfJlgxpJynw=; b=p4Ckd5waAaTuvezAffm07NRV85HZodPW8wNla6B8uK/gXbUpwtX5HwUMRwlRt3Fdfh q2Giqjv+VG1ScvnivS3X3fmz31jXmDS8roFzNGnrS/HiWq4o8MSg+UyNhvKCbCsQv4vy FtPuEoMZSz1dZ7J4ExxMdMRMPIc2OOJiB5+mnuGh5KbMyuqRgRDnFgVlUIb/DoqtyC1I um+HfeHStBaBKv54odL4+T7QBiDqyR3cntNfh9Y+8us1fkWTCMz7Hk8KQCyhqH2EAGjP 9GWSvpiZGfyqffIG24RHMBYKSuKLiAR9TGMuhGwYrfr9IwDxVlFuqDBtCi3JGA1g0DZb nqDw== 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=HOBnpx8HZKNA2mYIrdIzHPO79IIq+OTFtfJlgxpJynw=; b=Lw3F1ykj/alalyaG5ccwoeCnzkyIz8xQWRkgRECJ+7CkPj1jA8Vx5jFlkk+45ZdwOI vpSL/ySISKADeMDYYaZ1bmVMDenmwJIs+R3qC6X6BtvekESDxGGR5J2PBvpxikZFWFIS Ui6Qb6RYkXhO1NpjZiaLamF9JXGmVmCI9e2hyK2GJ/CcJkc7kKKOdC6cYOTm8I0n8l3a 3Jbv3gBTn+9IejhHIice2WrVzovqL/ouN7QtJ9AOrxJIH/4Rd/MbneKILZ4ofzyyIDDi c61kwqWvOfNZ0+aF6krBu5rstxl3AEF+0y52PebsIQ7IozRT2xph+asV0YAbWcRCiPmc BvdQ== X-Gm-Message-State: AOAM533nhhM1Tlx8HFgyOmNK16gETI6a8vDYdAS0B2kYKaxGlb82YgLw +nUl8GUzTpkb5sh8EB+urSI= X-Received: by 2002:a17:902:a584:: with SMTP id az4mr6717595plb.201.1590597924251; Wed, 27 May 2020 09:45:24 -0700 (PDT) Received: from ubuntu-s3-xlarge-x86 ([2604:1380:4111:8b00::1]) by smtp.gmail.com with ESMTPSA id c12sm3147692pjm.46.2020.05.27.09.45.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 May 2020 09:45:23 -0700 (PDT) Date: Wed, 27 May 2020 09:45:21 -0700 From: Nathan Chancellor To: Mauro Carvalho Chehab Cc: Sakari Ailus , linux-media@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Subject: Re: [PATCH 0/7] media: atomisp: Address several clang warnings Message-ID: <20200527164521.GA1239557@ubuntu-s3-xlarge-x86> References: <20200527071150.3381228-1-natechancellor@gmail.com> <20200527104525.5e6cd93b@coco.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200527104525.5e6cd93b@coco.lan> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 27, 2020 at 10:45:25AM +0200, Mauro Carvalho Chehab wrote: > Em Wed, 27 May 2020 00:11:43 -0700 > Nathan Chancellor escreveu: > > > Hi all, > > > > This series aims to clean up the code while addressing the majority of > > clang warnings in this driver, some found by the 0day bot and others > > found by me. > > > > There are several enum conversion warnings that happen, which I do not > > really know how to solve without understanding how exactly this driver > > works. I would appreciate some guidance or a solution. Below are the > > warnings, sorry for not wrapping them but they would be hard to read > > otherwise. > > ... > > ../drivers/staging/media/atomisp//pci/atomisp_compat_css20.h:117:22: note: expanded from macro 'CSS_ID' > > #define CSS_ID(val) (IA_ ## val) > ... > > I actually wrote a patch getting rid of this ugly thing: > > https://git.linuxtv.org/mchehab/experimental.git/commit/?h=atomisp_v3&id=cf6a15543ace1e99364911c0b7a2f6b8f2f43021 > > This one was already submitted upstream (not merged yet), but there > are also lots of other patches on my working tree. Ah excellent, that makes the warnings a lot more readable. I am still not sure how to reconcile the differences, it might be easier to just change the types in the struct to int. ../drivers/staging/media/atomisp/pci/atomisp_subdev.c:49:68: warning: implicit conversion from enumeration type 'enum ia_css_frame_format' to different enumeration type 'enum atomisp_input_format' [-Wenum-conversion] { V4L2_MBUS_FMT_CUSTOM_NV21, 12, 12, IA_CSS_FRAME_FORMAT_NV21, 0, IA_CSS_FRAME_FORMAT_NV21 }, ~ ^~~~~~~~~~~~~~~~~~~~~~~~ ../drivers/staging/media/atomisp/pci/atomisp_subdev.c:49:39: warning: implicit conversion from enumeration type 'enum ia_css_frame_format' to different enumeration type 'enum atomisp_input_format' [-Wenum-conversion] { V4L2_MBUS_FMT_CUSTOM_NV21, 12, 12, IA_CSS_FRAME_FORMAT_NV21, 0, IA_CSS_FRAME_FORMAT_NV21 }, ~ ^~~~~~~~~~~~~~~~~~~~~~~~ ../drivers/staging/media/atomisp/pci/atomisp_subdev.c:48:68: warning: implicit conversion from enumeration type 'enum ia_css_frame_format' to different enumeration type 'enum atomisp_input_format' [-Wenum-conversion] { V4L2_MBUS_FMT_CUSTOM_NV12, 12, 12, IA_CSS_FRAME_FORMAT_NV12, 0, IA_CSS_FRAME_FORMAT_NV12 }, ~ ^~~~~~~~~~~~~~~~~~~~~~~~ ../drivers/staging/media/atomisp/pci/atomisp_subdev.c:48:39: warning: implicit conversion from enumeration type 'enum ia_css_frame_format' to different enumeration type 'enum atomisp_input_format' [-Wenum-conversion] { V4L2_MBUS_FMT_CUSTOM_NV12, 12, 12, IA_CSS_FRAME_FORMAT_NV12, 0, IA_CSS_FRAME_FORMAT_NV12 }, ~ ^~~~~~~~~~~~~~~~~~~~~~~~ ../drivers/staging/media/atomisp/pci/atomisp_subdev.c:47:34: warning: implicit conversion from enumeration type 'enum ia_css_frame_format' to different enumeration type 'enum atomisp_input_format' [-Wenum-conversion] { MEDIA_BUS_FMT_JPEG_1X8, 8, 8, IA_CSS_FRAME_FORMAT_BINARY_8, 0, ATOMISP_INPUT_FORMAT_BINARY_8 }, ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5 warnings generated. > I'll try to apply your patch series on it, once I'll be able to > fix a bug with mmap support. It looks like all of them apply to your experimental branch aside from patch 3, which you handled in a different way. Cheers, Nathan