From patchwork Fri Dec 11 23:28:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 7833381 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 77D4BBEEE1 for ; Fri, 11 Dec 2015 23:28:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AF23E20480 for ; Fri, 11 Dec 2015 23:28:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B39E820465 for ; Fri, 11 Dec 2015 23:28:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753422AbbLKX2G (ORCPT ); Fri, 11 Dec 2015 18:28:06 -0500 Received: from resqmta-po-10v.sys.comcast.net ([96.114.154.169]:42142 "EHLO resqmta-po-10v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752863AbbLKX2F (ORCPT ); Fri, 11 Dec 2015 18:28:05 -0500 Received: from resomta-po-11v.sys.comcast.net ([96.114.154.235]) by resqmta-po-10v.sys.comcast.net with comcast id sPTo1r00354zqzk01PU4k4; Fri, 11 Dec 2015 23:28:04 +0000 Received: from mail.gonehiking.org ([73.181.52.62]) by resomta-po-11v.sys.comcast.net with comcast id sPU31r0051LXgTt01PU3cH; Fri, 11 Dec 2015 23:28:03 +0000 Received: from lorien.internal (lorien-wl.internal [192.168.1.40]) by mail.gonehiking.org (Postfix) with ESMTP id F416B9F2E5; Fri, 11 Dec 2015 16:28:02 -0700 (MST) From: Shuah Khan To: mchehab@osg.samsung.com, hans.verkuil@cisco.com Cc: Shuah Khan , linux-media@vger.kernel.org Subject: [PATCH] v4l-utils: mc_nextgen_test fix compile warnings Date: Fri, 11 Dec 2015 16:28:01 -0700 Message-Id: <1449876481-5624-1-git-send-email-shuahkh@osg.samsung.com> X-Mailer: git-send-email 2.5.0 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20140121; t=1449876484; bh=UqmQ24m9x92sXcV/rElLkqrPJ4aCx6Bp87Yq8tHoNYc=; h=Received:Received:Received:From:To:Subject:Date:Message-Id: MIME-Version:Content-Type; b=IuS7QWUEcL8B9mLCXTH0G6TlK+lcu7ubTVWamum7ZAKO4hA1ZNhaVB4TpjuQq0gGl 1rFZxvFtAUnmE+J2YBypBloT2cxY/aR/8bG7IJPvMrHq3xWNYSkYv5zX45N1iPvuIV sTz4wKyULeQ/2zxovVF6w1R0MM2Ba9nWobgCoIrIMa+I8JIJL+CwrDjAt8+UEDfejW TaYBn26Q3tW3BCAhnfyd5st/X9OOp9rEaIdtAWZLznbbg/HEtK42yyyzh6QOCbsrbr MqlGjb1aOkki6Ie8GRdp7/HYiGzUtKXtaPRUkqAt+5fwn4PYGTP8A+7AHKN0j1EwgV QnIo5RcUBVnBg== Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix the following compile warnings: CC mc_nextgen_test-mc_nextgen_test.o mc_nextgen_test.c: In function ‘media_get_ifname’: mc_nextgen_test.c:410:3: warning: ignoring return value of ‘asprintf’, declared with attribute warn_unused_result [-Wunused-result] asprintf(&name, "%s", devname); ^ mc_nextgen_test.c: In function ‘media_get_ifname_udev’: mc_nextgen_test.c:335:4: warning: ignoring return value of ‘asprintf’, declared with attribute warn_unused_result [-Wunused-result] asprintf(&name, "%s", p); ^ mc_nextgen_test.c: In function ‘objname’: mc_nextgen_test.c:249:2: warning: ignoring return value of ‘asprintf’, declared with attribute warn_unused_result [-Wunused-result] asprintf(&name, "%s%c%d", gobj_type(id), delimiter, media_localid(id)); ^ Signed-off-by: Shuah Khan --- contrib/test/mc_nextgen_test.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/contrib/test/mc_nextgen_test.c b/contrib/test/mc_nextgen_test.c index 743ddee..cf71bec 100644 --- a/contrib/test/mc_nextgen_test.c +++ b/contrib/test/mc_nextgen_test.c @@ -246,7 +246,11 @@ static inline const char *ent_function(uint32_t function) static char *objname(uint32_t id, char delimiter) { char *name; - asprintf(&name, "%s%c%d", gobj_type(id), delimiter, media_localid(id)); + int ret; + + ret = asprintf(&name, "%s%c%d", gobj_type(id), delimiter, media_localid(id)); + if (ret < 0) + return NULL; return name; } @@ -323,6 +327,7 @@ static char *media_get_ifname_udev(struct media_v2_intf_devnode *devnode, struct dev_t devnum; const char *p; char *name = NULL; + int ret; if (udev == NULL) return NULL; @@ -332,7 +337,9 @@ static char *media_get_ifname_udev(struct media_v2_intf_devnode *devnode, struct if (device) { p = udev_device_get_devnode(device); if (p) { - asprintf(&name, "%s", p); + ret = asprintf(&name, "%s", p); + if (ret < 0) + return NULL; } } @@ -406,9 +413,11 @@ char *media_get_ifname(struct media_v2_interface *intf, void *priv) * libudev. */ if (major(devstat.st_rdev) == intf->devnode.major && - minor(devstat.st_rdev) == intf->devnode.minor) - asprintf(&name, "%s", devname); - + minor(devstat.st_rdev) == intf->devnode.minor) { + ret = asprintf(&name, "%s", devname); + if (ret < 0) + return NULL; + } return name; }